Web view - doesn't show icon anymore

Today I upgraded to latest daily build (from 23xx).

The following line doesn’t anymore displays the icon in the webview (only shows the placeholder):

<img src="…/Icon-hdpi.png"  height=“57” width=“57”>

The html is located inside the “HTML” folder so “…/” should be fine.

It worked till the upgrade.

Can you throw together a simple example main.lua that has the issue and post it here.  I’ll test it on my iPhone.  I don’t have an Android device with me to test it there.

Rob

On Android only, webviews do not show PNG images which are linked to the ResourceDirectory root.  This broke a few weeks ago.  I filed a case number which is referenced in another thread.

For example:

<img src=“SPMTM_FRC_WebOverlay_Help_nav.2.png” width=“800” height=“600” alt=“Small Potatoes Magic Toy Maker Main Screen” />

Will not render the image on Android.

Thank you for letting me know.

I’ve tried to work around this by renaming the .png files to .pngx (just in case the issue was related to the warning about certain file types found here: http://docs.coronalabs.com/api/library/system/ResourceDirectory.html) but that does NOT workaround the bug in Corona.

Does using system pathForFile help? I did something similar to this before and had to use that for the images to be picked up

Not an option here because I’m relying on webview to parse the images referenced by the <IMG> tags in the HTML.

I worked around the Corona bug in the following manner:

I put all of the HTML and support files (CSS, PNG, etc.) into a folder and .zip’d it.

I put this Help.zip into the (project) ResourceDirectory root

At app initialization (first run), I copy the .zip file to the DocumentsDirectory, uncompress it, and then delete the .zip from the DocumentsDirectory.

In the lua code, I refer my webview calls to “Help/filename.HTML” in the DocumentsDirectory

This works in Simulator and all devices.

I’ve also had problems on Android with HTML files that reference PNGs, which worked on earlier daily builds. As far as I can tell it’s the same problem as <tschussler> described above.

More precisely, I’ve created a Google Doc file for an app help screen. Then I exported it as HTML, which for Google Docs means placing embedded images in a subdirectory (images/image00.png, images/image01.png, etc.) that are referenced from the .html file.

This worked on daily builds a few months ago. It no longer does. Any thoughts, Rob?

Can you post the bug # here or point me to the other thread?

Thanks

Rob

I found it, it looks like it was just filed today.   Engineering will need time to evaluate it. 

#36534

Rob

Thanks, Rob. FYI the no-image bug still is present in today’s daily build.

Yes, that is what i mean. You would inject the path, enclosed in image tags into your html.

If you are using html files this might be more work than you are willing to do. I was building my html pages dynamically in Lua and writing out the html to a file.

I just spent two evenings trying to figure out why my external .css, .js and .png files that are located in different directories than the html are no longer were working on Android. It turned out to not be my code at all.  I went back to 2393a and my external css and image files are now working again.  

e.g. <link rel=“stylesheet” type=“text/css” href="…/stylesheets/style.css" />

The directory structure is (where web is a directory immediately under the main system.ResourceDirectory directory): 

web/en_us/somedocument.html

web/stylesheets/style.css

This sounds like the same bug as described above.  Arrrgh.  Rob, any updates on this one?

Can you throw together a simple example main.lua that has the issue and post it here.  I’ll test it on my iPhone.  I don’t have an Android device with me to test it there.

Rob

On Android only, webviews do not show PNG images which are linked to the ResourceDirectory root.  This broke a few weeks ago.  I filed a case number which is referenced in another thread.

For example:

<img src=“SPMTM_FRC_WebOverlay_Help_nav.2.png” width=“800” height=“600” alt=“Small Potatoes Magic Toy Maker Main Screen” />

Will not render the image on Android.

Thank you for letting me know.

I’ve tried to work around this by renaming the .png files to .pngx (just in case the issue was related to the warning about certain file types found here: http://docs.coronalabs.com/api/library/system/ResourceDirectory.html) but that does NOT workaround the bug in Corona.

Does using system pathForFile help? I did something similar to this before and had to use that for the images to be picked up

Not an option here because I’m relying on webview to parse the images referenced by the <IMG> tags in the HTML.