Opened 6 years ago
Closed 6 years ago
#45598 closed enhancement (fixed)
Prevent unnecessary whitespace around thumbnails when processing cropped PDFs
Reported by: |
|
Owned by: |
|
---|---|---|---|
Milestone: | 5.3 | Priority: | normal |
Severity: | normal | Version: | |
Component: | Media | Keywords: | has-patch commit |
Focuses: | Cc: |
Description (last modified by ) ¶
When generating thumbnails from cropped PDF pages, Imagemagick uses the uncropped area - resulting in unnecessary (and ugly) whitespace - unless the option "use-cropbox" is set.
I attached a patch that solves the issue by setting a parameter in ImageMagick. Note that this doesn't in any way affect uncropped PDFs.
I also attached a demo.pdf for you to reproduce the issue as well as two thumbnails generated before and after the patch.
Pull Requests
- Loading…
Change History (11)
@
6 years ago
Thumbnail generated BEFORE the patch (with whitespace around the cropped image not visible in the PDF itself)
#1
in reply to:
↑ description
@
6 years ago
Replying to michel.weimerskirch:
Not that this doesn't in any way affect uncropped PDFs.
Small typo. This should say "Note that this doesn't in any way affect uncropped PDFs." (unfortunately, Trac doesn't allow editing tickets)
#3
@ Core Committer
6 years ago
- Keywords needs-testing added
- Milestone changed from Awaiting Review to 5.3
- Owner set to joemcgill
- Status changed from new to accepted
Thanks @michelweimerskirch, this looks like a nice improvement. I'm adding this to the 5.3 milestone for testing.
This ticket was mentioned in Slack in #core-media by joemcgill. View the logs.
6 years ago
#5
@ Core Committer
6 years ago
- Keywords commit added; needs-testing removed
Patch applies cleanly and works great without introducing any noticeable performance problems (in fact, if can improve performance because Imagick is generating smaller images).
Also wanted to reiterate that this change will only affect PDFs that have been created with a tool that includes a crop-box. For more info about the CropBox setting, I found this article helpful: https://www.w3pedia.com/uk/the-pdf-page-boxes-cropbox-bleedbox-trimbox.
Patch