0

I have been getting Error loading preview from Firestorage console.

enter image description here

It was working perfectly two days ago. But now all my data is loading in my application except images. And in those cases where I am showing gif (using gif parser) in image view, the application is getting crashed. So my question is,

  1. What is the reason behind not loading the image even in the Fire storage console?
  2. When this happens, how should I handle this properly to load images or gifs? By checking URL to Data > if data != nill? Because URL is there, but the image is not showing.
halfer
  • 19,824
  • 17
  • 99
  • 186
Tulon
  • 4,011
  • 6
  • 36
  • 56
  • Per your comments, even if you upload the .png directly in console, it still won't open? If that's correct, double click the file on your Mac, which should open in Preview then go to the Tools menu->Show Inspector and see what kind of file Preview thinks it is. – Jay Jan 01 '20 at 15:06
  • I did it. It is png. And it's not only happening for any particular image. All of my png images which were working perfectly since two days ago now stop showing the preview on console and of course on iOS application. – Tulon Jan 01 '20 at 20:59
  • @Jay I checked my other two applications which were getting the support of Firebstorage from another Gmail id, facing the same problem. No image at all. And these are all complete projects, in service for the last 3 months. – Tulon Jan 01 '20 at 21:01
  • Well. I just now uploaded a .png file to my Firestore Storage and when I click on the blue link on the right, it's displaying. I tried it in Safari and Firefox. Perhaps you are having a browser issue? – Jay Jan 01 '20 at 22:05
  • I have tried all of my browsers. Safari, Brave, Chrome, and Firefox. It's behaving the same in all. I have sent the issue to the firebase support, but they will response after two days. I think the problem is in their end. You can take have a look into this question also. https://stackoverflow.com/questions/59532052/image-loading-and-uploading-to-firebase-storage-not-working-in-android-and-fireb Thanks! – Tulon Jan 01 '20 at 22:13

1 Answers1

0

It's almost certainly because the file you've uploaded is not actually a PNG, as the content type suggests. Or, the data has been corrupted, so it can no longer be parsed and displayed.

Since we don't know what you're using in your app to display the image, we can't really say what you have to do to make sure the image is valid, so you will want to check the documentation of the library you're using, assuming it has a way to detect errors in the rendering of the image.

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
  • Thanks a lot for the response. How do you detect the content type? I am seeing all png here and I have exported the images by PS CC 2019 from jpeg to png. And these all images were showing perfectly till two days ago. Why it is complaining right now? I am debugging the gif parser, will let you know. – Tulon Jan 01 '20 at 04:46
  • If you don't say what the content type is, Cloud Storage will guess based on the file extension. These are just guesses here. Since we don't have any code or details to reproduce, it's impossible to say for sure. – Doug Stevenson Jan 01 '20 at 05:14
  • Ok, I get the point. But strangely when I upload a png image directly from my mac to storage through their console it's also not loading this time. Can you please suggest where should I set or introduce content type on fire storage while uploading something? – Tulon Jan 01 '20 at 05:25