I am developing an app that downloads a png image from internet and displays it. For some reason gbitmap_create_from_png_data() fails to load most images with following error message:
[ERROR] gbitmap_png.c:49: PNG memory allocation failed
[ERROR] gbitmap_png.c:99: Failed to load PNG
I doubt that I am out of memory. I say this because I have tried loading very small images i.e 4Kb in size and they still fail. On the other hand some images, although 16kb in size, load successfully. Other confusing thing is that the same images that fail to load using gbitmap_create_from_png_data()
load successfully using gbitmap_create_with_resource()
if I add them as image resources to my app. So images are correctly formated for Pebble. The downloaded images are exactly the same size as the ones I have locally so I doubt the image data gets corrupted.
Successful image: http://brucedalemansion.com/images/baby_16.png
Un-Successful image: https://i.stack.imgur.com/k63v6.png