question

Christine Rosalie Fawcett avatar image
Christine Rosalie Fawcett asked

Kindle Fire Webview images do not loead

Our app uses Android WebView to load local html files out of the asset folder . On my new Kindle Fire HDX 7 recently updated to Fire OS 4.1.1 the images loaded by the html's javascript do not display. The logcat shows the errors (which I assume are related to the problem): ADRENO-ES20: : Invalid texture format! Returning error! ADRENO-ES20: : Framebuffer color attachment incomplete. Returning GL_FRAME_BUFFER_INCOMPLETE_ATTACHMENT This works fine on an older Kindle running OS 10.5 and also on standard Android I tried replacing standard Android WebView with AmazonWebView and got the same results We had a somewhat similar problem on standard Android devices running Kitkat (the images loaded sometimes) that was fixed with the line webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null); which evidently turns off hardware acceleration, but that does nothing here. Please advise on a fix or workaround Thanks Christine
fire tablet
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

Christine Rosalie Fawcett avatar image
Christine Rosalie Fawcett answered
Further investigation reveals that it's the Javascript canvas.drawImage this is not working. When the images are drawn directly on loading, for example with , they draw just fine. But our images are drawn with the following code (much simplified) called from an onLoad function: function fitImage () { //scale the canvas to fit the image to the width of the screen ctx.canvas.width = screenWidth; ctx.canvas.height = image.height; xOffset = (screenWidth - image.width) / 2; ctx.drawImage(image, xOffset, 0); } Because the image could be one of several of different sizes referenced from the same html file , and also because we need to do photo swiping, we do need to use canvas.drawImage to draw the images. I read that the code may be trying to draw the images before they are loaded. But I tried the following Stack Overflow cost with code to solve that problem. I took the exact working code from that post, image and all,and replaced one of my html files with that. Again it worked fine on the Samsung 4 but not on the Kindle : http://stackoverflow.com/questions/15048279/drawimage-not-working?rq=1 Any other ideas please?
10 |5000

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.