Bug 300554

Summary: pdf import is confused about the size of layers
Product: [Applications] krita Reporter: Halla Rempt <halla>
Component: File formatsAssignee: Krita Bugs <krita-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: animtim
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: unspecified   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: test pdf

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