Bug 300554 - pdf import is confused about the size of layers
Summary: pdf import is confused about the size of layers
Status: RESOLVED FIXED
Alias: None
Product: krita
Classification: Applications
Component: File formats (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Krita Bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-05-24 11:11 UTC by Halla Rempt
Modified: 2012-05-24 11:29 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
test pdf (204.87 KB, application/pdf)
2012-05-24 11:15 UTC, Halla Rempt
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Halla Rempt 2012-05-24 11:11:59 UTC
Check any pdf, import the first page at a high resolution like 600x600 ppi. Check the layer preview: there is a white staircase underneat the actual layer. The image is sized correctly, the layer not. Resize image to size of layer shows it. If the pdf is landscape, the top-left of the pdf will be repeated on top of the bottom-right corner as well.

Reproducible: Always
Comment 1 Halla Rempt 2012-05-24 11:15:42 UTC
Created attachment 71342 [details]
test pdf
Comment 2 Halla Rempt 2012-05-24 11:28:16 UTC
Yeah, there's a bug in the tiling of the pdf:

qDebug() << wdg->intHorizontal->value() << wdg->intVertical->value() << x << y << currentWidth << currentHeight; in the inner loop gives:

00 600 0 0 1000 1000 
600 600 0 1000 1000 1000 
600 600 0 2000 1000 1000 
600 600 0 3000 1000 3334 
600 600 1000 0 1000 1000 
600 600 1000 1000 1000 1000 
600 600 1000 2000 1000 1000 
600 600 1000 3000 1000 2334 
600 600 2000 0 1000 1000 
600 600 2000 1000 1000 1000 
600 600 2000 2000 1000 1000 
600 600 2000 3000 1000 1334 
600 600 3000 0 1000 1000 
600 600 3000 1000 1000 1000 
600 600 3000 2000 1000 1000 
600 600 3000 3000 1000 334 
600 600 4000 0 1000 1000 
600 600 4000 1000 1000 1000 
600 600 4000 2000 1000 1000 
600 600 4000 3000 1000 -666 
600 600 5000 0 334 1000                                                                                     
600 600 5000 1000 334 1000                                                                                  
600 600 5000 2000 334 1000                                                                                  
600 600 5000 3000 334 -1666
Comment 3 Halla Rempt 2012-05-24 11:29:54 UTC
Git commit 691de699200e3de722ab277d3d139359667d5059 by Boudewijn Rempt.
Committed on 24/05/2012 at 13:28.
Pushed by rempt into branch 'master'.

Fix bug 300554

We used to get 1000x1000 pixel tiles from poppler. However asking
poppler to render those tiles is a) slower b) our calculation was
buggy.

I suspect that poppler renders the whole page anyway, then gives us
the part we asked for.

M  +15   -7    krita/plugins/formats/pdf/kis_pdf_import.cpp

http://commits.kde.org/calligra/691de699200e3de722ab277d3d139359667d5059