'Proper way to show image when Firestorage is down or Error loading preview in Firestorage for iOS

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.


Solution 1:[1]

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.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Doug Stevenson