[poppler] [patch] a sketch of yflip for PNGWriter for pdftohtml
Ihar `Philips` Filipau
thephilips at gmail.com
Sun Mar 11 12:12:20 PDT 2012
Update version of the patch, without modifications to PNGWriter, is
attached to the bug
https://bugs.freedesktop.org/show_bug.cgi?id=32340
It works similar to Splash: all rows are buffered in the memory, and
then if needed - flipped.
I have also implemented the x flip, though I have never seen PDFs
needing it. But it was a nice exercise.
Additionally, since I can flip only PNGs, if I see a JPEG which needs
flipping (and PNG support is on) I convert the JPEGs to PNGs and flip
them too.
The patch in bug applies on top of my patch from
https://bugs.freedesktop.org/show_bug.cgi?id=47186
On 3/11/12, Ihar `Philips` Filipau <thephilips at gmail.com> wrote:
> Hi All!
>
> I had some spare time and source code at hand and tried to solve
> another of my problems with the pdftohtml: vertically flipped images.
> (Also a long standing bug:
> https://bugs.freedesktop.org/show_bug.cgi?id=32340 )
>
> An hour (w)hacking at the code produced that piece of frankenstein
> code you might see below.
>
> Short summary: implement very crude yflip in PNGWriter by buffering
> rows and transpose/write them before closing the PNG image; disable
> JPEGs and write always PNGs. (The piece of code detecting flip was
> lifted from pdf2xml project.)
>
>
> Is there any official ideas on how to implement the image flip in the
> pdftohtml?
>
> Are other flip possible too? rotations? To date I have seen only PDFs
> with upside down images.
>
> Have Fun.
>
More information about the poppler
mailing list