Skip to content

Include all ImageSizer options in image variation filename suffix #144

@Toutouwai

Description

@Toutouwai

Short description of the enhancement

ImageSizer options are:

$config->imageSizerOptions = array(
	'upscaling' => true, // upscale if necessary to reach target size?
	'cropping' => true, // crop if necessary to reach target size?
	'autoRotation' => true, // automatically correct orientation?
	'sharpening' => 'soft', // sharpening: none | soft | medium | strong
	'quality' => 90, // quality: 1-100 where higher is better but bigger
	'hidpiQuality' => 60, // Same as above quality setting, but specific to hidpi images
	'defaultGamma' => 2.0, // defaultGamma: 0.5 to 4.0 or -1 to disable gamma correction (default=2.0)
	);

All of these affect the variation, yet only some of the options are included in the variation filename suffix, meaning the wrong variation can be served if there is an existing variation of the same filename.

For example, this results in the same varation being served twice, when it should be two different variations:

<img src="<?= $image->width(300, ['quality' => 90])->url ?>" alt="">
<img src="<?= $image->width(300, ['quality' => 10])->url ?>" alt="">

This request is that every change to an ImageSizer option produces a unique variation filename.

Related forum topic (old): https://processwire.com/talk/topic/10706-include-image-config-settings-in-image-variation-filenames/

Current vs. suggested behavior

Currently only some ImageSizer options affect the variation filename suffix. Suggestion is that all ImageSizer options affect the variation filename suffix.

Why would the enhancement be useful to users?

Ensures the wrong variation is never served when an ImageSizer option is changed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions