• Resolved Amit Sonkhiya

    (@amitaits)


    Hi,

    After activating the plugin, I notice that there is an additional image size present in the upload directory with the size 10×10. Further, the corresponding webp file is also created.

    Is the plugin doing so?

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author rosell.dk

    (@roselldk)

    No, WebP Express does not register any new image sizes.

    Thread Starter Amit Sonkhiya

    (@amitaits)

    Hi,

    I’m sure that the plugin does not register any new image size through add_image_size() function. However, there is something weird is going on for thumbnail generation.

    Whenever I activate the plugin, I get an additional 10×10 thumbnail in the upload folder and the corresponding webp. It happens a few time later after the image upload.

    But deactivating the plugin stops the 10×10 thumbnail creation. Any idea or help?

    Thanks

    Plugin Author rosell.dk

    (@roselldk)

    Hm. I do not experience this problem myself and I am surprised to hear your report.

    What happens if you toggle the “Convert on upload” option in WebP Express settings?
    This setting would be the one to suspect, because I do hook up on “wp_handle_upload” and “image_make_intermediate_size” when that setting is enabled.

    However, my implementations of these hooks are very simple and I cannot see how these should result in described behavior.

    Small enough to post here, btw:

    
        /**
         *  hook: handle_upload
         *  $filename is ie "/var/www/webp-express-tests/we0/wordpress/uploads-moved/image4-10-150x150.jpg"
         */
        public static function handleUpload($filearray, $overrides = false, $ignore = false)
        {
            if (isset($filearray['file'])) {
                try {
                    $filename = SanityCheck::absPathExistsAndIsFileInDocRoot($filearray['file']);
                    self::convertIf($filename);
                } catch (SanityException $e) {
                    // fail silently. (maybe we should write to debug log instead?)
                }
            }
            return $filearray;
        }
    
        /**
         *  hook: image_make_intermediate_size
         *  $filename is ie "/var/www/webp-express-tests/we0/wordpress/uploads-moved/image4-10-150x150.jpg"
         */
        public static function handleMakeIntermediateSize($filename)
        {
            if (!is_null($filename)) {
                try {
                    $filenameToConvert = SanityCheck::absPathExistsAndIsFileInDocRoot($filename);
                    self::convertIf($filenameToConvert);
                } catch (SanityException $e) {
                    // fail silently. (maybe we should write to debug log instead?)
                }
            }
            return $filename;
        }
    
    Thread Starter Amit Sonkhiya

    (@amitaits)

    Hi,

    The issue was with the theme. Although, it was not using the WordPress add_image_size() function or relevant hooks. So, I had the issue.

    Thanks

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Does the plugin create an additional image size of 10×10’ is closed to new replies.