Open webian opened 4 years ago
I could imagine several cases where conversion and/or manipulation might be desired. Question is if a single checkbox might be the way to go or if there should be a more general approach implemented where it could be configured which options to use or to offer, perhaps even with a hook that could be used by further extensions.
Well, there's already a checkbox to convert regardless of alpha channel and this could be enabled for a given directory as well. So having a hook/signal to allow to override configuration will probably be quite complex as it means that somehow you need to understand by code that alpha channel is useless or can safely be forgotten in a specific case. Sounds quite complex.
Adding a button to force conversion sounds like the best approach but is imho not the core business of this extension. So did you try to create that button and manually invoke the resizing based on configuration? Something like:
$imageResizer = GeneralUtility::makeInstance(ImageResizer::class);
$configuration = ConfigurationController::readConfiguration();
$imageResizer->initializeRulesets($configuration);
// Actual resizing
$imageResizer->processFile(...)
Possibly we need to add some helper methods to quickly override the configuration in that case or to decouple ->processFile()
a bit more to get finer-grained access to the workflow.
The best approach would possibly be a button in File > List next to each image which shows a dialog where one can manually resize to any dimensions, allowing to "force" in case of PNG transparency, but this is quite some work and will require a PR.
It happens that a PNG is uploaded but not converted because transparency is detected even if visually there's no transparency. In this cases a button to force the conversion to JPG of a single image would be useful.