getkirby-v2 / toolkit

This is the deprecated toolkit for Kirby v2.
http://getkirby.com
81 stars 50 forks source link

Include all options in settingsIdentifier #224

Closed jake closed 4 years ago

jake commented 7 years ago

Changes

Change thumb->settingsIdentifier() to include all options and all option values instead of only a specific whitelist of values.

I had to excluding the destination option as it type can't be converted to a string. Might be a nicer way to check that, but wasn't sure it'd be necessary.

Reasoning

Background: I have a custom thumb driver, which includes some extra advanced options for ImageMagick. E.g. an option to add the "flatten" command, to create a still from a GIF. I also have my config set to include the {hash} in the filename:

c::set('thumbs.filename', '{safeName}-{hash}-{width}x{height}.{extension}');

Given that scenario, if I create a "flattened" and "unflattened" thumbnail at the same size, they'll both get the same filename (including hash). Seems like a logical way to insure the filenames never collide is to include all the options.