Bug 88049 - invalid size of imported PDF after rotation
Summary: invalid size of imported PDF after rotation
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Draw (show other bugs)
Version:
(earliest affected)
4.3.3.2 release
Hardware: x86-64 (AMD64) All
: medium minor
Assignee: vvort
URL:
Whiteboard: target:5.0.0
Keywords: bibisected, bisected, filter:pdf, regression
: 92589 (view as bug list)
Depends on:
Blocks:
 
Reported: 2015-01-05 11:37 UTC by Adam
Modified: 2016-05-03 21:35 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
screenshots (463.55 KB, application/zip)
2015-01-05 11:37 UTC, Adam
Details
Original PDF (39.13 KB, application/pdf)
2015-01-14 23:00 UTC, Robinson Tryon (qubit)
Details
Rotated PDF (90deg to right) (39.52 KB, application/pdf)
2015-01-14 23:00 UTC, Robinson Tryon (qubit)
Details
Rendering in Okular vs. LibreOffice (pdf) (420.25 KB, application/pdf)
2015-01-14 23:01 UTC, Robinson Tryon (qubit)
Details
Hackfix patch (1.23 KB, patch)
2015-01-15 15:06 UTC, vvort
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Adam 2015-01-05 11:37:45 UTC
Created attachment 111762 [details]
screenshots

LibreOffice Draw incorrectly sizes contents of PDF file obtained by rotation, at least for some kind of contents.
An exemplary file is in the attachment.
It seems to me that simply width and height of the contents are swapped.

origPDF.pdf - original PDF file
opens correcly both in PDF viewer (Okular) and in LO Draw

rotPDF.pdf  - PDF rotated 270 degrees by pdf270 (i.e. pdfjam) under Linux
opens correctly in Okular
in LO Draw:
- size of page is correct
- size of contents (image) is left "vertical"

rot_PDF_comp.pdf - exemplary screenshots/report
Comment 1 Robinson Tryon (qubit) 2015-01-14 22:59:26 UTC
(In reply to Adam from comment #0)
> 
> rot_PDF_comp.pdf - exemplary screenshots/report

When you title screenshots 3a and 3b with "Original file origPDF.pdf in Okular" do you really mean "Original file rotPDF.pdf in Okular" ?

Also, in general, please upload binary files separately, so we can view them more quickly from the browser.
Comment 2 Robinson Tryon (qubit) 2015-01-14 23:00:13 UTC
Created attachment 112256 [details]
Original PDF
Comment 3 Robinson Tryon (qubit) 2015-01-14 23:00:33 UTC
Created attachment 112257 [details]
Rotated PDF (90deg to right)
Comment 4 Robinson Tryon (qubit) 2015-01-14 23:01:26 UTC
Created attachment 112258 [details]
Rendering in Okular vs. LibreOffice (pdf)
Comment 5 Robinson Tryon (qubit) 2015-01-14 23:07:00 UTC
TESTING with LO 4.4.0.2 + Ubuntu 14.04

(In reply to Adam from comment #0)
REPRO Steps:
1) Open origPDF.pdf (attachment 112256 [details]) in Okular and LO Draw
> opens correcly both in PDF viewer (Okular) and in LO Draw

Evince: Ok
Draw: Ok


2) Open rotPDF.pdf  (attachment 112257 [details])
> opens correctly in Okular
> in LO Draw:
> - size of page is correct
> - size of contents (image) is left "vertical"

Evince: Ok
Draw: Not okay -- the image looks squished and tall (as if it were left "vertical")

CONFIRMED: rotated PDF does not render correctly in Draw.

Status -> NEW
Whiteboard -> filter:pdf
Comment 6 Adam 2015-01-15 00:09:06 UTC
(In reply to Robinson Tryon (qubit) from comment #1)
> (In reply to Adam from comment #0)
> > 
> > rot_PDF_comp.pdf - exemplary screenshots/report
> 
> When you title screenshots 3a and 3b with "Original file origPDF.pdf in
> Okular" do you really mean "Original file rotPDF.pdf in Okular" ?

I've done a bug in bug report
3a and 3b should be entitled "Rotated file ..."

> Also, in general, please upload binary files separately, so we can view them
> more quickly from the browser.

OK, the bug report form had only one upload "slot", as I see the trick is to add attachments later.
Comment 7 Buovjaga 2015-01-15 08:32:21 UTC
rotPDF.pdf not squished in LibO 3.5 -> regression.

Squished in 4.5 alpha.

Win 7 64-bit Version: 4.5.0.0.alpha0+
Build ID: b3b4bbaf6cbd2226b659fea7d6ae473ccf84e9dd
TinderBox: Win-x86@39, Branch:master, Time: 2015-01-12_06:13:44

Ubuntu 14.10 64-bit Version: 4.5.0.0.alpha0+
Build ID: 7201fa0dddd7dd0352f69fd2b2b64efcb361ccad
TinderBox: Linux-rpm_deb-x86_64@46-TDF-dbg, Branch:master, Time: 2015-01-11_23:28:55

LibreOffice 3.5.0rc3 
Build ID: 7e68ba2-a744ebf-1f241b7-c506db1-7d53735
Comment 8 Rostislav 'R.Yu.' Okulov 2015-01-15 11:31:43 UTC
# bad: [423a84c4f7068853974887d98442bc2a2d0cc91b] source-hash-c15927f20d4727c3b8de68497b6949e72f9e6e9e
# good: [65fd30f5cb4cdd37995a33420ed8273c0a29bf00] source-hash-d6cde02dbce8c28c6af836e2dc1120f8a6ef9932
git bisect start 'latest' 'oldest'
# good: [e02439a3d6297a1f5334fa558ddec5ef4212c574] source-hash-6b8393474974d2af7a2cb3c47b3d5c081b550bdb
git bisect good e02439a3d6297a1f5334fa558ddec5ef4212c574
# good: [4850941efe43ae800be5c76e1102ab80ac2c085d] source-hash-980a6e552502f02f12c15bfb1c9f8e6269499f4b
git bisect good 4850941efe43ae800be5c76e1102ab80ac2c085d
# good: [a900e72b6357882284c5955bdf939bf14269f5fb] source-hash-dd1050b182260a26a1d0ba6d0ef3a6fecc3f4e07
git bisect good a900e72b6357882284c5955bdf939bf14269f5fb
# skip: [e80660c5a1d812cd04586dae1f22767fc3778c4a] source-hash-07c60c8ee2d1465544a6a39e57bc06b3690b8dfb
git bisect skip e80660c5a1d812cd04586dae1f22767fc3778c4a
# good: [df9bcaed2faa2a8d11b19f877cdff3a12a887278] source-hash-6ba9692d8bbe3e3c245aca9a7c928e81178d05f1
git bisect good df9bcaed2faa2a8d11b19f877cdff3a12a887278
# good: [741197a13a361480f59eeb3bd1401f984f49f1c0] source-hash-9a61470eb1fa161cba70f2e9c4ea8817dc7f617e
git bisect good 741197a13a361480f59eeb3bd1401f984f49f1c0
# good: [882db5e268e28962bdf805c820a5e031b0df9936] source-hash-383dccc094f8c8c07b4298ce0b7406d18cd61cee
git bisect good 882db5e268e28962bdf805c820a5e031b0df9936
# bad: [69e91b0c890097cfb1781733f260644bb1ec9ee8] source-hash-66fce1f61e7e088bd92e19ecb0dd94553de6f824
git bisect bad 69e91b0c890097cfb1781733f260644bb1ec9ee8
# good: [a75e194c7cd73082efab3023747075606dd47593] source-hash-da33122c84c18ea78932c6ee607824c0f3d4de99
git bisect good a75e194c7cd73082efab3023747075606dd47593
# good: [b674d095455f424cb31626ed712624097879d740] source-hash-6f019bea96e93c127ccd695d381647b48d06d710
git bisect good b674d095455f424cb31626ed712624097879d740
# bad: [bd76e9778274caffd1b195ac1d186e99782fb83b] source-hash-858232e3c78d5d8f013324887e29a74ea2f21bab
git bisect bad bd76e9778274caffd1b195ac1d186e99782fb83b
# first bad commit: [bd76e9778274caffd1b195ac1d186e99782fb83b] source-hash-858232e3c78d5d8f013324887e29a74ea2f21bab

bd76e9778274caffd1b195ac1d186e99782fb83b is the first bad commit
commit bd76e9778274caffd1b195ac1d186e99782fb83b
Author: Bjoern Michaelsen <bjoern.michaelsen@canonical.com>
Date:   Tue May 20 16:22:15 2014 +0000

    source-hash-858232e3c78d5d8f013324887e29a74ea2f21bab
    
    commit 858232e3c78d5d8f013324887e29a74ea2f21bab
    Author:     Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
    AuthorDate: Sun May 4 21:53:20 2014 +0200
    Commit:     Tomaž Vajngerl <tomaz.vajngerl@collabora.com>
    CommitDate: Thu May 15 19:51:04 2014 +0200
    
        sc - statistics dialog: add more space between IDs
    
        Change-Id: Ie503c2758e809712c99df6e53a02ac6e719dd036

:100644 100644 2f6d175facfd62eb5b3a85765418dd7894661c2a eb306aa5ceb038af2732ce2115e803d18c3ba7c0 M      ccache.log
:100644 100644 4021502cd54bdc99729f11af96c29665ca14e18c 5305d66ac7dbaa9e39719889ae93036c30c6f81f M      commitmsg
:100644 100644 5e690a6cf5c063c101c9cc5ca3c941b8d5c29661 eea0ab02fad56fbc063bb81f696ed29cb9633163 M      make.log
:040000 040000 5580b02a426cce2cbbf819cbc4d82b2e572199b0 59957f0418b806f5ff80752ced974450a63e2036 M      opt
Comment 9 Matthew Francis 2015-01-15 14:13:31 UTC
The rendering changed at the below commit.

Adding Cc: to vvort@yandex.ru; Could you possibly take a look at this? Thanks


a050856a670db629336681cdf4e5f36c4efefa57 is the first bad commit
commit a050856a670db629336681cdf4e5f36c4efefa57
Author: Vort <vvort@yandex.ru>
Date:   Sun May 11 10:38:04 2014 +0300

    fdo#78549 PDF Import: fix incorrect transformation matrix writing
    
    Change-Id: I60d77e01ea7774c234d1ad1b81b90a7db3461e22
    Reviewed-on: https://gerrit.libreoffice.org/9310
    Reviewed-by: Caolán McNamara <caolanm@redhat.com>
    Tested-by: Caolán McNamara <caolanm@redhat.com>
Comment 10 vvort 2015-01-15 15:06:15 UTC
Created attachment 112299 [details]
Hackfix patch

Hello.
My previous fix triggered the problem in function PDFIProcessor::setupImage().
This function is a mess. It's needs to be fully reviewed/rewritten.
For a while - here is the hackfix.
Comment 11 vvort 2015-01-15 16:05:54 UTC
Here is the current state of image transformations support: Bug 88465 .
Comment 12 vvort 2015-01-16 14:09:28 UTC
More correct fix is available - attached at Bug 88465.
Comment 14 Andras Timar 2015-07-07 15:57:52 UTC
*** Bug 92589 has been marked as a duplicate of this bug. ***
Comment 15 Robinson Tryon (qubit) 2015-12-17 05:57:54 UTC
Migrating Whiteboard tags to Keywords: (filter:pdf, bibisected)
[NinjaEdit]
Comment 16 Michael Stahl (allotropia) 2016-05-03 21:35:59 UTC
removing backportrequest for EOL branches