Bug 46599 - pdftoppm: patch to fix aspect ratio when scale is changed.
Summary: pdftoppm: patch to fix aspect ratio when scale is changed.
Status: RESOLVED FIXED
Alias: None
Product: poppler
Classification: Unclassified
Component: utils (show other bugs)
Version: unspecified
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: poppler-bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-02-24 20:41 UTC by Jun Harada
Modified: 2012-12-15 16:04 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
the patch to fix aspect raio when scaling (1.79 KB, application/octet-stream)
2012-02-24 20:41 UTC, Jun Harada
Details

Description Jun Harada 2012-02-24 20:41:02 UTC
Created attachment 57617 [details]
the patch to fix aspect raio when scaling

I made the patch to fix aspect ratio when you try to change scale with "--scale-to-x" and "--scale-to-y" option.

This patch works for poppler-0.18.4.
I hope that this patch can be helpful for someone.
Comment 1 Adrian Johnson 2012-02-25 01:40:49 UTC
I don't think we should be adding a new parameter to tell pdftoppm to use the correct aspect ratio. The current behavior when only one of -scale-to-x or scale-to-y is used is clearly buggy.

I've attached a patch to bug 43393 (where this issue was first reported) to fix this bug.
Comment 2 Jun Harada 2012-02-25 07:03:12 UTC
I think your patch cannot handle the case when both x and y are specified.

Specifying both is a common case when you make a thumb nail.
For example, think about "convert" command in ImageMagick.
You can specify both width and height with "-size" option to make thumbnail.
Comment 3 Albert Astals Cid 2012-02-25 07:14:50 UTC
Your code crashes if fixAspect is set and y_scaleTo is not
Comment 4 Adrian Johnson 2012-02-25 14:38:27 UTC
(In reply to comment #2)
> I think your patch cannot handle the case when both x and y are specified.

That's what the -scale-to option does. It will use the size for both x and y but correct it for the aspect ratio.
Comment 5 Albert Astals Cid 2012-12-15 16:04:35 UTC
I am closing this bug as i understand from Adrian's comment that this is already fixed, if not please reopen and explain why


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.