-
-
Notifications
You must be signed in to change notification settings - Fork 37
Open
Labels
Description
Sharp has an option to resize with "animated": true or "animated": false in the edits in the base64 edits config. Within the Craft admin, resized .gifs are not animated, but I'd like them to be animated.
If I'm trying to check for file type and setting "animated": true, is the recommended way to do this using a custom image transform class? Like outlined here: https://nystudio107.com/docs/image-optimize/advanced.html#writing-your-own-image-transform-class
If I were inside the SharpImageTransform.php class and modify it like below, I get the animation happening in Craft admin:
if (!empty($edits)) {
$config['edits'] = $edits;
}
$config['edits']['animated'] = true; // new line that could be conditionalIs there another way that I should be going about this?