Re: [hackers] [sent][patch] load slide image on-demand

From: Markus Teich <markus.teich_AT_stusta.mhn.de>
Date: Sat, 4 Jun 2016 17:28:31 +0200

Hiltjo Posthuma wrote:
> previously an image file would be opened but only ffread when advancing to
> the slide, but when the slide was not used it gave an error:
>
> /usr/local/bin/2ff: failed to convert image/png

Heyho Hiltjo,

thanks for the patch. Unfortunately it does not work if the first slide contains
an image (ffopen is only called in advance). I think it would be good to merge
ffopen and ffread instead into a single function ffload. This makes the `LOADED`
state clearer and also enforces that the fd is closed in the same function where
it is opened. This ffload function should then be called in advance() replacing
the ffread() calls if the image is not loaded yet and once in load() for the
first slide if it is an image.

If you want to take this new approach, go for it, otherwise I'll look into it
myself.

I pushed your fix for now with an additional ffopen() call in load() so it works
for first slide pictures as well.

--Markus
Received on Sat Jun 04 2016 - 17:28:31 CEST

This archive was generated by hypermail 2.3.0 : Sat Jun 04 2016 - 17:36:17 CEST