Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: force conversion #44

Open
webian opened this issue Sep 18, 2020 · 3 comments
Open

Feature request: force conversion #44

webian opened this issue Sep 18, 2020 · 3 comments

Comments

@webian
Copy link
Contributor

webian commented Sep 18, 2020

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.

@DavidBruchmann
Copy link

DavidBruchmann commented Sep 18, 2020

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.

@xperseguers
Copy link
Owner

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.

@xperseguers
Copy link
Owner

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.

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

No branches or pull requests

3 participants