Commit a9e631ae 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 39baa7d4
Pipeline #88919 passed with stage
in 6 minutes and 38 seconds
......@@ -1072,9 +1072,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
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment