zweitag / middleman-images

Resize and optimize images for Middleman
MIT License
17 stars 3 forks source link

feature: support more imagemagick options #63

Closed alexanderadam closed 3 years ago

alexanderadam commented 4 years ago

Hi folks,

first of all: thank you for this extension. It's great!

I just needed a few other options, thus I added support for them. It works for me but I don't have a good for extending the naming concept (see the lines with destination). I mean we probably shouldn't add all set parameters to the file name, right? Or should we? For now I just added crop to the parameter. How about a random string? Or a hash of the stringified options? Or do you have any other idea?

Thank you in advance!

pmk1c commented 4 years ago

I won't get into reviewing this properly over the next week. Maybe @TimMoser92 will. This is definitely a good addition. I'd prefer adding a hash string of all options to the image file name. But maybe extracting the resize / crop values and adding them too, is also a good idea, since these will be the most commonly used options.

Thanks for the PR! I'll add the Hacktoberfest label, since I think this is a PR that should be merged!

alexanderadam commented 4 years ago

I'd prefer adding a hash string of all options to the image file name. But maybe extracting the resize / crop values and adding them too, is also a good idea, since these will be the most commonly used options.

I added a commit that only hashes options if they're longer than a hash. This way few actions (i.e. crop & resize) are visible, but once you add many options, they will be 'compressed' into a hash.