Bug 46599

Summary: pdftoppm: patch to fix aspect ratio when scale is changed.
Product: poppler Reporter: Jun Harada <harajune>
Component: utilsAssignee: poppler-bugs <poppler-bugs>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: harajune
Version: unspecified   
Hardware: x86-64 (AMD64)   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Attachments: the patch to fix aspect raio when scaling

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.