-
-
Notifications
You must be signed in to change notification settings - Fork 716
Description
Describe the bug
When using vipsthumbnail
to resize a pdf with the DPI option and preventing upscaling using >
as following:
vipsthumbnail input.pdf[dpi=150] --size 2400x\> -o converted.png[strip]
The upscaling uses the width and height of the PDF without consideration of the DPI (so using the default dpi of 72). This results in images with much lower quality and the wrong dimensions.
To Reproduce
- Run following command with and without
dpi=150
. Results in same dimensions of (595 × 842).
vipsthumbnail input.pdf[dpi=150] --size 2400x\> -o converted.png[strip]
- Run the command with and without
--dpi=150
. The dimensions are (1240 x 1754) with dpi option and (595 × 842) without dpi option
vips pdfload input.pdf --dpi=150 converted.png
Expected behavior
Respect the DPI given by the load options when preventing upscaling
Actual behavior
Uses the default PDF DPI of 72 to prevent upscaling.
Screenshots
Example with DPI=150 using vipsthumbnail and >
to prevent upscaling. Image dimensions (595 × 842)
Example without DPI=150 using vipsthumbnail and >
to prevent upscaling. Image dimensions (595 × 842)
Sample when using pdfload to convert to png with DPI = 150, Results in dimensions of (1240 x 1754)
Sample when using pdfload to convert to png with default DPI = 72, Results in dimensions of (595 × 842)
Environment
- OS: MacOS 10.15.5
- Vips: 8.10.1