Bug 123840 - [mac] PDFDocumentImage is too big if PDF has a crop box smaller than the media box
Summary: [mac] PDFDocumentImage is too big if PDF has a crop box smaller than the medi...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Tim Horton
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-11-05 16:54 PST by Tim Horton
Modified: 2013-11-05 23:17 PST (History)
1 user (show)

See Also:


Attachments
patch (15.56 KB, patch)
2013-11-05 16:59 PST, Tim Horton
ap: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Horton 2013-11-05 16:54:26 PST
PDFDocumentImage uses the media box unconditionally when determining the size of the image, which is wrong. It does the right thing (use crop box and fall back to media box if it's not there) in other places, though... so, make this consistent.

Also, if the crop box origin is not 0,0, we double-translate by it, because PDFKit applies translation for us.

<rdar://problem/15308765>
Comment 1 Tim Horton 2013-11-05 16:59:36 PST
Created attachment 216099 [details]
patch
Comment 2 Tim Horton 2013-11-05 17:11:31 PST
http://trac.webkit.org/changeset/158701