-
-
Notifications
You must be signed in to change notification settings - Fork 661
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It appears as a black image somebody help me #958
Comments
Hi @isJihan, it looks like there is an issue in Flutter: flutter/flutter#151273 |
it looks, this issue is of flutter itself. @isJihan did you find any solutions to this?? |
I was able to fix the issue. The issue is in the image itself. If you have access to the place where it is stored, then use https://tinyjpg.com/ service, do the minimum compression, and update the image. It worked for me. |
not yet... |
I have an internal network version that produces the same image correctly. Therefore, it doesn't seem to be a problem with the image itself. In my external network version, only a few specific images appear in black like that, and the rest appear properly. The internal network version of Flutter is 2.5.0. |
Could you please share at least one link to an image that appears in black? |
The issue only appears with jpeg or any other image format?? because the issue mentioned in the chat shows it only to be related with jpeg. |
I noticed this issue only in JPEG images. |
Thanks a lot for sharing the image! I noticed that the issue happens only on Chromium-based browsers when using CanvasKit renderer. Here is a small demo that shows how to fix the issue:
Source codeimport 'package:flutter/material.dart';
void main() {
runApp(const MainApp());
}
class MainApp extends StatelessWidget {
const MainApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
body: Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: [
const Text('Original:'),
Image.asset(
'assets/original.jpg',
height: 100,
width: 100,
),
const SizedBox(height: 10),
const Text('After tinyjpg.com:'),
Image.asset(
'assets/edited.jpg',
height: 100,
width: 100,
),
],
),
),
),
);
}
} |
But why do images received through the same API appear correctly on a website created with Flutter 2.5.0-1 version? without use https://tinyjpg.com/?? |
Honestly, I don't know. Which renderer is used in that web application: CanvasKit or HTML? |
both web application are CanvasKit. |
<script src="main.dart.js" type="application/javascript" data-entrypoint="web_entrypoint.dart" data-renderer="html"></script> Is this how we change the renderer to html from canvaskit. if yes, then it is still not loading. and if no, please tell me the correct way. Thank you |
<script src="main.dart.js" type="application/javascript" data-entrypoint="web_entrypoint.dart" data-renderer="html"></script> Hi @slowlydeveloped! |
We had this same error recently in our flutter app only on web and only on Chromium browsers it turned out to be an issue with Chrome not recognising that the image is different if you change the image by 1 pixel it will fix it |
CachedNetworkImage(imageUrl: afterImageURL!)
This is my code. afterImageURL,
afterImageURL receives the value from API.
However, under the same conditions, only certain images intermittently appear on a black image.
The URL address is not wrong, and the image appears properly on the network.
Even if it is displayed as an errorWidget, it does not appear as an errorWidget and is a black image.
I am using cached_network_image: ^3.3.1 and flutter version is 3.16.7.
somebody help me....
The text was updated successfully, but these errors were encountered: