Webp is larger than the original
-
Hi, please help me.
I have upload folder on subdomain and use filters to indicate this:
add_filter(‘webpc_uploads_root’, function($path){
$upload_dir = wp_upload_dir();
return $upload_dir[‘basedir’];
});
add_filter(‘webpc_uploads_path’, function($path){return ”;});
add_filter(‘webpc_uploads_webp’, function($path){return ‘webp’;});So, webp files are saved to a folder $upload_dir[‘basedir’], not in $upload_dir[‘basedir’]/webp, although the folder /webp also exists. Such a structure suits me, files are added and deleted normally.
But your function “checkFileSize($data)” does not work, and I think it does not work because of my folder structure. Webp files larger than the original continue to be written to disk.
I will be very grateful for your kind help and advice.
The page I need help with: [log in to see the link]
- The topic ‘Webp is larger than the original’ is closed to new replies.