Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

apply convert_options before transformation #1085

Closed
jotto opened this issue Nov 13, 2012 · 4 comments
Closed

apply convert_options before transformation #1085

jotto opened this issue Nov 13, 2012 · 4 comments

Comments

@jotto
Copy link

jotto commented Nov 13, 2012

When calling the convert command from the Thumbnail processor's make method, does it make more sense to place the convert_options before the transformation command?

call the resize at the end

convert ':SOURCE_PATH' -strip -fuzz 1% -bordercolor white -border 1x1 -trim -repage -1-1 -resize "100x100" ':DEST_PATH'

instead of calling resize at the beginning

convert ':SOURCE_PATH' -resize "100x100" -strip -fuzz 1% -bordercolor white -border 1x1 -trim -repage -1-1 ':DEST_PATH'

because some of the convert_options may change the image size, therefore leaving you with a different size than you specified in the geometry.

@jyurek
Copy link

jyurek commented Nov 16, 2012

I think this is a condition where we'd need options in 3 places: Before the source file, between source file and transformation, and after transformation. But if you need that level of control over this, it might be better to write a Processor instead. But I think the current implementation is acceptable for most applications. I'd be willing to entertain pull requests to this effect, though.

@jyurek jyurek closed this as completed Nov 16, 2012
@rterbush
Copy link

FWIW, I'm digging through the git trying to figure out how to do exactly this. A -trim flag after a -resize does nothing. Needs to be trimmed before resized.

@jotto
Copy link
Author

jotto commented Mar 27, 2013

@rterbush here's my quick monkey patching hack, inside application.rb for paperclip 3.3.1 https://gist.github.com/jotto/5256221

@rterbush
Copy link

Thanks @jotto that looks like it will do the trick.

Randy

On Wed, Mar 27, 2013 at 11:23 AM, Jonathan Otto notifications@github.comwrote:

@rterbush https://github.com/rterbush here's my quick monkey patching
hack, inside application.rb for paperclip 3.3.1
https://gist.github.com/jotto/5256221


Reply to this email directly or view it on GitHubhttps://github.com//issues/1085#issuecomment-15537981
.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants