-
Notifications
You must be signed in to change notification settings - Fork 638
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
cleanImage
method bloats up animated GIF
#2845
Comments
Would be good to have a configuration like |
@andris-sevcenko thoughts? |
@brandonkelly If the setting by default sanitizes GIFs and users have to explicitly turn it off (consciously disabling a security feature), I feel like it's a good idea. |
Should it just be GIFs, or maybe a way to disable all image sanitization (at least when uploaded via the Control Panel)? |
Even though GIF gets hit the hardest, probably should stick to one setting for all sanitization - too granular config settings often get confusing. |
The two possible aspects are the image formats and upload sources (Control Panel or site front-end). You could provide two different settings for the two aspects, but I think it would be wise to lift the security feature for Control Panel uploads only. As far as image formats go, instead of a blanket disable, one approach could be to accept a list of formats/types/extensions that will be skipped. |
Agree with all of that @souvikdg. Maybe we could even roll SVGs into this, and deprecate the |
Love this. |
Added `transformGifs` config setting, Fixes #2845
@souvikdg One Config Setting to Rule Them All ended up not being as simple of a solution as we thought it would, so we’re going with a Already implemented in Craft 3, and we will also port it to Craft 2. |
It seems like there’s quite many people wanting to have this config setting for other image formats as well. See #3287 #3060 As a workaround I override the Images service, but would love to see a config option. <?php
namespace modules\craft;
class Images extends \craft\services\Images {
/**
* @inheritdoc
*/
public function cleanImage(string $filePath)
{
// no cleansing
}
} |
Description
We have got a highly optimised animated GIF, but the size is bloating up whenever uploaded through Craft admin panel.
Steps to reproduce
Upload this image file (670kb) through the Craft Asset Panel and the uploaded file will grow to nearly 1mb.
Additional info
The text was updated successfully, but these errors were encountered: