Loading Image File at Runtime

Edit: Oops, missed this part in the docs:
https://sdk.play.date/1.10.0/Inside%20Playdate.html#C-graphics.image
Looks like I'll nix image support for now. Curious if any type of runtime image conversion would be possible in future.

Leaving initial post up for anyone else wondering similar things in future:

Hi all,

I'm working on an e-reader that can parse .epub files. epubs are just zip archives. I'd like users to be able to use .epubs natively, so I'm unzipping the archive at runtime, then parsing and displaying the xhtml within.

When I unzip the archive, I also have access to the image files within, but I am unable to load these with gfx.image.new() due to an error wrong file type: no header.

Is this because these images have not been converted at compile time to a playdate-friendly format? Is there a work-around here?

Thanks!

some people have done image loading libraries but they are slower than 1-bit files, because colour files are bigger on disk and disk access is not fast. plus they will take a lot of RAM.

I am not sure it's a good idea loading images meant for much larger and more capable devices.

2 Likes

Thanks, Matt!

Agreed re: not being a good idea to load the images, was mostly just playing around with it as a learning exercise.