Summary: | pdftoppm scale-to-x with correct aspect-ratio | ||
---|---|---|---|
Product: | poppler | Reporter: | Krystian Sikora <krystian.sikora> |
Component: | utils | Assignee: | poppler-bugs <poppler-bugs> |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | enhancement | ||
Priority: | medium | ||
Version: | unspecified | ||
Hardware: | All | ||
OS: | All | ||
Whiteboard: | |||
i915 platform: | i915 features: | ||
Attachments: |
fix aspect ratio
allow -1 to mean aspect ratio is preserved document that -scale-to preserves aspect ratio |
Description
Krystian Sikora
2011-11-30 14:23:11 UTC
Created attachment 57626 [details] [review] fix aspect ratio When only one of -scale-to-x or -scale-to-y is used the other should be set based on the aspect ratio. The attached patch fixes this. To be honest i'm not convinced by that patch. The manual option clearly says -scale-to-x number Scales each page horizontally to fit in scale-to-x pixels. Does not mention it will change the y pixels when i did not ask for it. The -scale-to option also does not do what the man page says. -scale-to number Scales each page to fit in scale-to*scale-to pixel box. It says it will scale to the same number of pixel in each direction. What the code does is use the scale-to size for the longest side and sets the other side based on the aspect ratio. Albert: this option is really useless in most cases as it will stretch or narrow the image and destroy it's aspect ratio. In my opinion it will fit more use cases following aspect ratio. I think that we could also change the parameter description in man page to state that it will follow aspect ratio. Also new option could be introduced, for example --keep-aspect-ratio that when used would have the effect of Adrian's patch. Note: The fact that in your opinion an option is useless means nothing, you are not the only one using pdftoppm. I'm sure that thre is someone using it somewhere and when you change the behaviour it's me as the maintainer that is going to be blamed, not you ;-) @Adrian : Let's fix it then ;-) My suggestion: * Update pdftoppm manage to mention that scale-to-x keeps aspect ratio by default * Make it so that if you pass -1 as one of the scaleXorScaleY parameters means it will maintain the aspect ratio if the other one is specified and put it on the manpage. What you guys think? I like your suggestion as it adds required functionality without breaking backwards compatibility. Created attachment 57706 [details] [review] allow -1 to mean aspect ratio is preserved Created attachment 57707 [details] [review] document that -scale-to preserves aspect ratio If these two patches are accepted I will update pdftocairo to work the same way. Looks good to me, please commit :-) pushed |
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.