问题
I have a webview that loads a webpage and sometimes in this webpage there are pictures. However, i have encountered 2 instances where the image does not load and they each give different outcome.
Outcome #1 : Webpage is loaded but image is not loaded (Format used : .jpeg)
Outcome #2 : Webpage is loaded but image is not loaded. However, at where the image should be, there is a icon with a question mark. (Format used : .jpg)
I have other webpages that have images of the same format and from the same directory too and works fine. All the images are taken from the same place which is at another website's server.
I have read on various websites to use loadDataWithBaseURL() and they give me the same results.
I am now at a loss at what to do. Do i need to save the image with a certain format and with certain settings ? Or is there something else that i need to do.
UPDATE : I believe the image's format and size does not matter as i have tried to visit the webpages using Dolphin and the default web browser but the results are the same. However, if i used Opera Web Browser, it is able to display the images.
回答1:
We found out that our JPG images were of 32 Bit depth. Once we re-export it to 24 Bit depth using GIMP, the images were able to show.
Also, if the images were in PNG, it should work even though it is 32 Bit depth.
Hope this helps other people out there.
来源:https://stackoverflow.com/questions/13487734/image-not-loading-through-android-webview