Fixed Optimizing profile banners and avatars to WebP through CLI does not seem to do anything

Chromaniac

Well-known member
Affected version
2.3 Beta 2
This is on XenForo 2.3 Beta 2. I ran the commands. It appears to process them just file. File timestamps on FTP appears to be updated. But after conversion is complete, they remain as JPEGs. Downloaded a bunch of them and opened in an image editor to confirm. I understand that file extension is not updated for avatars. Another user confirmed here.

Optimizing attachments to WebP does work so it does not seem like a server configuration issue.
 
2.3 does have different commands for all three!

Attachment optimization
Avatar optimization
Profile banner optimization

Available both from CLI and Rebuild Caches. The commands show success as the images appear to be processed. But they remain jpegs after conversion is complete.
 
I can't reproduce this. Do you have the image optimization option enabled? If not, the control panel optimization tools and CLI command will not actually perform the optimization.
 
So I updated to beta 3 (without doing a fresh replication of 2.2 database) and ran the commands once again. Files have updated timestamp on ftp but opening them on irfanview confirmed that they remained png/jpgs. It doesn't really matter much as freshly uploaded Avatar and Profile Images do convert to Webp. Plus they don't really take too much space so no major loss of storage space. Would report back when I do a fresh migration on beta 4 which I probably would just install on primary installation 🤪
 
Since I setup a brand new Beta 4 install to test out image dimension stuff. I decided to give this another test. And I see the same behavior.

Avatar optimization & Profile banner optimization do not convert the avatars and profile banners to webp. Attachment optimization does convert as expected. I uploaded my avatar, profile image and an attachment (all jpegs) before turning on WebP setting. And then ran all three functions from the backend. avatar and profile image files remain jpegs (downloaded from ftp and opened in irfanview to verify). attachment converted to webp.
 
This is really strange, I don't see a reason why this could fail silently while updating the files and I can't reproduce this locally (on multiple instances).
 
yeah i am pretty confused about this as well. i guess something strange is going on with my server. i am also facing weird push notification issues.
 
I have used the option to optimize attachments and avatars to convert them to webp, but it does not work with the avatars, they still maintain the jpg extension.

If I download the file, it is still a jpg.

Captura.webp

1714195370514.webp

1714195393258.webp
 
While confusing in practice, the extension has no bearing on the actual media type. You can download the file and open it in a program like IrfanView to be sure.
 
I've merged this into another report of a user experiencing the same issue. Unfortunately we have not been able to reproduce it so far. Are you using the GD or Imagick image driver? If you're using GD, does does WebP support show as enabled at admin.php?tools/phpinfo?

1714197516189.webp

I don't think the file/timestamps would be overwritten if not, but I'm not seeing how this might happen so any further information you have may be useful.
 
Yes, I'm using Imagick and php 8.3.6

1714198051561.webp
1714198308136.webp
1714197791175.webp


If I download the same jpg image and upload it for another user, it still shows the jpg in the browser but when I open it with IrfanView it already detects the wrong extension :unsure:

1714197987578.webp
 
Last edited:
So, I switched to GD and ran the commands again. And this time profile images were mostly changed. Got a few errors like:

Code:
libpng warning: iCCP: known incorrect sRGB profile
libpng warning: iCCP: cHRM chunk does not match sRGB

GIFs were ignored I guess. Some JPEGs also appeared to be ignored. But it did process most of the user profile pictures! I guess there is no harm staying on GD. Same behavior with profile banners.
 
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.3.0 Beta 6).

Change log:
Fix image optimization with the Imagick image driver
There may be a delay before changes are rolled out to the XenForo Community.
 
Back
Top Bottom