Inkplate 6 drawImage() format parameter syntax

Customer:

I’m trying to download and display a PNG image on an Inkplate 6 but the URL does not contain the string “.png”. I’m struggling to understand how to add a format parameter to the drawImage function. Looking at image.h I can see three choices BMP, PG and PNG but cannot make it work in the call below.

if (!display.drawImage("https://apps.ecmwf.int/webapps/opencharts-api/backend/get-product-thumbnail/medium-mslp-mean-spread/?width=800&mode=expand&projection=europe", "PNG", 0, 100, false, false))

This gives a compile error “error: invalid conversion from ‘const char*’ to ‘int’”. It looks as though the format option somehow isn’t implemented. Could you provide a simple example that includes the format parameter?

Originally submitted via email support on 28 February 2022. Migrated to the forum for community visibility.

Soldered Support:

Try using the same function but put PNG without quotation marks:

if (!display.drawImage("https://apps.ecmwf.int/webapps/opencharts-api/backend/get-product-thumbnail/medium-mslp-mean-spread/?width=800&mode=expand&projection=europe", PNG, 0, 100, false, false))