• Resolved jamesbriggs

    (@jamesbriggs)


    Following a chat with one of your team, I am not sure if the optimizer should be converting png files to webp as well as jpeg?

    I take image 1
    image 1 is jpeg

    upload image 1 > view image on website > save image from website to test what file type it downloads as > downloads as webp > no problem

    convert image 1 to png > take same image, but now ..png > upload to website > view image on website > download image > downloads as webp

    Is that intended? Is there some difference with png files?

    The page I need help with: [log in to see the link]

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter jamesbriggs

    (@jamesbriggs)

    I made a mistake. Sorry. Should be:
    **
    I take image 1
    image 1 is jpeg

    upload image 1 > view image on website > save image from website to test what file type it downloads as > downloads as webp > no problem

    convert image 1 to png > take same image, but now ..png > upload to website > view image on website > download image > downloads as png
    **

    So, conversion to webp successful on a jpeg but then when it’s png, it doesn’t convert.

    Thread Starter jamesbriggs

    (@jamesbriggs)

    Just a shot in the dark, but maybe you can help me with this unrelated query. Ignore this part if not…

    I am trying to upload jpeg images to wordpress without them being converted.. Which is why I am experimenting the png in the first place, as wordpress will not reduce the size and quality of it (I have turned off image optimization in sg optimizer).
    Any time I upload a jpg, I can instantly view it side by side with the image before upload, and the quality is higher and file size is higher, so wordpress is compressing it. I don’t know how to change this, and it’s very annoying.

    Any ideas?

    Plugin Author Stoyan Georgiev

    (@stoyangeorgiev)

    Hey there @jamesbriggs,

    Converting png images to webP is not recommended since it may lead to unexpected behavior. Anyway, we have made that possible, but we have created a limit for it. If an image is bigger than 500kb it will not be converted. We have put that limit to make sure that the process is stable and will not interfere with the work of your website.

    As for the second question, WordPress is compressing the images when you upload images, as well as resizing the images in a couple of dimensions to ensure correct image sizes are available for different devices, resolutions, etc.
    If you wish to disable this built-in option, you would have to create a custom function that bypasses that process.

    Kind regards,
    Stoyan

    Thread Starter jamesbriggs

    (@jamesbriggs)

    Hi Stoyan,

    Many thanks for getting back to me.

    I had a feeling PNG to webP would not be ideal/standard practice. Is there any way I can increase the limit to 700 or 800kb just to experiment, or is there a high chance something could go wrong doing that?

    I understand the following is now outside of the scope of your support, but since I’m so stuck and you’ve answered I have to see if you can help me some more on it ?? If not then again, just ignore this section.

    Yes, I understand WordPress is compressing and re sizing the images. It makes a few copies for thumbnails and a couple of other sizes. I have noticed that in the uploads folder, the copies are stored in addition to the original image. I can access the original, high quality image in the folder (I dropship, so I take images that have already been optimized for the web and put them on my site. So it wouldn’t be a problem, skipping out on this optimization altogether).

    I don’t know if a good solution would be to just get WordPress to only grab the original image, not the optimized version. But, because of course it only has the full size original, the thumbnail and other sizes would not be displayed which in some cases obviously I want them to be. So that’s maybe not the best option.
    So, I guess the custom function option is probably the way forward… I don’t suppose you might know what function I could use? I don’t know php very well at all, I’ve tried adding:

    add_filter(‘jpeg_quality’, function($arg){
    return 100;
    });

    to my functions.php file but this has had no effect.

    I didn’t think I’d encounter such a problem. It’s quite annoying really. Anyway, any help you could give me would be amazing.

    Blagodarya mnogo!

    Thread Starter jamesbriggs

    (@jamesbriggs)

    To elaborate..

    add_filter(‘jpeg_quality’, function($arg){
    return 100;
    });

    Is not ‘working’ but is kind of working.. If I set the return value to 10 and upload an image, the quality is visibly worse. However, the file is exactly the same size. If I use the browser to view full size original image from my pc and put the image uploaded when the return value is 100, the quality is worse, as mentioned above.

    So, it’s changing the compression amount as it’s different with 10/100, but 100 still does not keep image quality at original.

    I don’t have any plugins interfering, have tried de activating all plugins and tested on a fresh install, behaviour is all the same.

    Thread Starter jamesbriggs

    (@jamesbriggs)

    Also I’ve tried uploading via ftp

    Plugin Author Stoyan Georgiev

    (@stoyangeorgiev)

    Hey @jamesbriggs,

    I would really not recommend increasing the png size limit, since this may lead to unwanted results and unexpected behaviour of the work of the plugin.

    As far as the code you have posted above, I am afraid that I will not be able to assist you with that since it is not related to the work of our plugin. I would suggest checking the WordPress Documentation for the hook you were using and check how and when it is exactly used. There should be plenty of information and even some code snippets you could try. If that does not work out for you, you could always check with a developer who can assist you with that matter.

    Kind regards,
    Stoyan

    Thread Starter jamesbriggs

    (@jamesbriggs)

    @stoyangeorgiev Many thanks again. Will try the documentation and a developer as a last resort.

    Seems like an annoying thing to need a developer for..

    Just adding… that I stumbled on to this also (as I dig into page speed issues and google identified massive images).

    Would be good to make this PNG issue clearer in the documentation. I am getting hammered on page speed with large PNG images. Now i am doing the effort to replace 160 images across almost as many posts… with JPG versions. well I think I’ve found a plugin to do it for me.

    Then I will regen.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Png images not being converted to webp’ is closed to new replies.