Commit 3bcab044 authored by Oliver Sander's avatar Oliver Sander

Arthur: Unflip images vertically

On Linux, images that get handed to the ArthurOutputDev are flipped
vertically for some reason, and that is currently corrected for.  It got
reported in poppler/poppler#850
that on Windows, the images have the correct orientation when they
arrive in ArthurOutputDev.  I have no idea where this difference
comes from.  Anyhow, this patch introduces platform-specific code
to make the final rendered images come out right both on Linux
and Windows.
parent 9429aac4
Pipeline #171975 passed with stage
in 4 minutes and 1 second
......@@ -1101,9 +1101,13 @@ void ArthurOutputDev::drawImage(GfxState *state, Object *ref, Stream *str,
stride = image.bytesPerLine()/4;
for (y = 0; y < height; y++) {
pix = imgStr->getLine();
#ifdef _WIN32
line = data+y*stride;
// Invert the vertical coordinate: y is increasing from top to bottom
// on the page, but y is increasing bottom to top in the picture.
line = data+(height-1-y)*stride;
colorMap->getRGBLine(pix, line, width);
if (maskColors) {
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment