• Resolved cudak888

    (@cudak888)


    Title pretty much says all, but is there a hook that can be placed in functions.php that would prevent Smush from targeting any images with this extension?

    Thanks!

    -Kurt

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @cudak888 ,

    Can you please check this code:

    add_filter('wp_smush_image', 'wpmudev_no_smush_img', 10, 2);
    function wpmudev_no_smush_img($smush, $ID) {
        if(!$ID) return false;
        
        $type = get_post_mime_type($ID);
        switch($type) {
            case 'image/apng':
                return false;
            break;
        }
        
        return true;
    }

    That should exclude apng from smushing.

    Thread Starter cudak888

    (@cudak888)

    Thank you for this. I just tried it.

    The code properly skips the full-size image, but all cropped and resized variants of said image are still smushed upon upload.

    Any potential solution?

    Plugin Support Saurabh – WPMU DEV Support

    (@wpmudev-support7)

    Hello @cudak888,

    I sincerely apologise for the delay in response here. I went ahead and checked the same on my end and also checked with the dev team where it looked good to me. Could you please link me to one image where the issue occurs? Please make sure to not change the name of the image too. Keep the image as it is so to make sure we are able to replicate the same. You could upload the image to the google drive or dropbox or simply link the media file link from your site media library.

    Thank you,
    Prathamesh Palve

    Plugin Support Dimitris – WPMU DEV Support

    (@wpmudev-support6)

    Hello @cudak888

    I’m closing this topic due to recent inactivity.
    Feel free to post back any update and we can re-open it and carry on troubleshooting.
    ??

    Thank you,
    Dimitris

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Animated .APNGs being smushed and turned static’ is closed to new replies.