Hi @astwert
Basically the problem is happening due to WebP format. The image is larger in some of these cases than the original format image.
Please try to check again using this helper plugin in order to stop converting images to WebP if they will be larger than original format.
Let me know how it goes.
Best regards
Ioanna
Dear Ioanna.
Thank you very much for fast reply (and sorry for my late)
I tried your code out:
add_action( 'after_setup_theme', function() {
add_filter( 'imagify_keep_large_webp', '__return_false' );
});
But the situation is the same still:
Uploaded JPG in 1500 x 1000 px = filesize 92 KB
Converted Version in 1366 x 911 px = 175 px
(See screenshot: https://gyazo.com/c67cd304c4753579f09144514bcc8b5d )
I love your plugin and hope we find a solution.
Thank you so much for your support.
All the best
André
Hi @astwert
Thank you for your kind words, we are glad you like it!
Can you try also with this code, if you add it in functions.php?
add_action( ‘imagify_loaded’, ‘imagify_keep_large_webp’ );
function imagify_keep_large_webp() {
add_filter( ‘imagify_keep_large_webp’, ‘__return_false’ );
}
Although this should work as well:
add_filter( ‘imagify_keep_large_webp’, ‘__return_false’ );
However, installing our helper plugin is still the recommended way.
Let me know how it goes.
Best regards
Ioanna
Dear Ioanna.
Thank you again for fastest reply 🙂
Unfortunately the snippet thrown following hint:
constant ‘imagify_loaded’ - assumed '‘imagify_loaded’' (this will throw an Error in a future version of PHP)
Warning: Use of undefined constant ‘imagify_keep_large_webp’ - assumed '‘imagify_keep_large_webp’' (this will throw an Error in a future version of PHP
I’m afraid it’s not a good solution for future.
It’s a pitty.
Best regards
André
Hi @astwert
There is a small difference in the code you copied it from text,'became ‘ – it’s a small but important difference codewise. Please try again.
add_action( 'imagify_loaded', 'imagify_keep_large_webp' );
function imagify_keep_large_webp() {
add_filter( 'imagify_keep_large_webp', '__return_false' );
}
Thank you!
Best regards
Dear Ioanna.
Thanks again, but unfortunatly there is no improvement. :[
Do you have another idea?
All the best
André
Hi @astwert
You can try two things but it would be better to test them first.
add_action( 'init', 'imagify_keep_large_webp' );
function imagify_keep_large_webp() {
add_filter( 'imagify_keep_large_webp', '__return_false' );
}
or simply
add_filter( 'imagify_keep_large_webp', '__return_false' );
Let us know how it goes.
Best regards
Ioanna
Hi @astwert,
We are following up to see if the recommended solution worked for you.
If all is well, there’s no need to reply, and I will just mark our conversation as resolved.
However, if you have any further questions, feel free to let me know, we’ll gladly continue to assist you.
Thanks!
Marko