Bug 105536 - LibreOffice Fileopen PDF formatting: PDF is flipped (upsidedown/backwards)
Summary: LibreOffice Fileopen PDF formatting: PDF is flipped (upsidedown/backwards)
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
5.2.3.3 release
Hardware: All Linux (All)
: medium normal
Assignee: Mike Kaganski
URL:
Whiteboard: target:5.4.0
Keywords:
Depends on:
Blocks:
 
Reported: 2017-01-25 23:38 UTC by Nick Humrich
Modified: 2017-03-01 10:49 UTC (History)
3 users (show)

See Also:
Crash report or crash signature:


Attachments
original file (58.25 KB, application/pdf)
2017-01-25 23:39 UTC, Nick Humrich
Details
libreoffice screenshot (32.95 KB, image/png)
2017-01-25 23:41 UTC, Nick Humrich
Details
firefox screenshot (250.24 KB, image/png)
2017-01-25 23:41 UTC, Nick Humrich
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nick Humrich 2017-01-25 23:38:10 UTC
Description:
Opening this pdf file in libreoffice makes it appear like the file is upsidedown and backwards. Basically it is orientational-wise inverted. If I open it in firefox/adobe/inkscape it looks correct and right-side up.

Steps to Reproduce:
1. Open file in libre office using command line `libreoffice myfile.pdf` or my opening draw, then going through the open dialog.
2. Feast your eyes upon the incorrectness!

Actual Results:  
The file was upsidedown and backwards

Expected Results:
The file should be readable and right-side up


Reproducible: Always

User Profile Reset: yes

Additional Info:
I tried on a different computer, and even in a docker container. This is on libreoffice 5.2. I tried on 5.1 and got a blank pdf instead of an upside down one. I dont know of a workaround because I am programatically converting pdf's and its impossible to know which ones are (incorrectly) upside down, and which ones are not.


User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:50.0) Gecko/20100101 Firefox/50.0
Comment 1 Nick Humrich 2017-01-25 23:39:19 UTC
Created attachment 130685 [details]
original file

This is the pdf that wont open correctly
Comment 2 Nick Humrich 2017-01-25 23:41:16 UTC
Created attachment 130686 [details]
libreoffice screenshot

This is what it looks like in libreoffice
Comment 3 Nick Humrich 2017-01-25 23:41:50 UTC
Created attachment 130687 [details]
firefox screenshot

This is what it looks like in firefox (correct)
Comment 4 V Stuart Foote 2017-01-26 00:19:12 UTC
Confirmed on windows 8.1 Ent 64-bit en-US with
Version: 5.3.0.2 (x64)
Build ID: 5ad7b2889021c491af62f7930a4b1cb631392f16
CPU Threads: 8; OS Version: Windows 6.29; UI Render: GL; Layout Engine: new; 
Locale: en-US (en_US); Calc: group

The grayscale bitmap image is upsidedown and flipped.

@Miklos, Mike this is a weird one.
Comment 5 Mike Kaganski 2017-01-28 16:22:52 UTC
A patch is submitted for review: https://gerrit.libreoffice.org/33649
Comment 6 Commit Notification 2017-01-28 17:31:46 UTC
Mike Kaganski committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=62c063de37b777ae2b0d06220ffdbdd8e8912d02

tdf#105536: PDF image should be v-flipped unconditionally

It will be available in 5.4.0.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.
Comment 7 Nick Humrich 2017-01-30 16:57:35 UTC
I tested the daily build 'LibreOfficeDev 5.4.0.0.alpha0 c6dd735afb2e1b3837c4f8c5659f52fafab4c56f' and it looks good!
Comment 8 Nick Humrich 2017-01-30 17:07:19 UTC
Should I be able to apply this patch to 5.2.3? I might just build libre myself with this patch if I can until 5.4 comes out.
Comment 9 Mike Kaganski 2017-01-30 17:19:58 UTC
(In reply to Nick Humrich from comment #8)

I am not sure that it will apply cleanly right away; however, the actual patch is one-liner (modulo comment) in sdext/source/pdfimport/tree/pdfiprocessor.cxx, that is easy for you to apply if you build LO. The other two files are unit test that isn't necessary to apply.
Comment 10 QA Administrators 2017-03-01 10:48:55 UTC
Closing as RESOLVED VERIFIED as per comment 7