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;
}