Image Optimizer for XF 2.0

Image Optimizer for XF 2.0 [Paid] 2.2.1

PayPal: $29.00
Even after:
1) installing addon version 3.0.0 and updating it
2) downloading the latest webp from https://developers.google.com/speed/webp/download and installing it
3) re-running the setup file
3) going through the addon's file path references for pngquant, jpegoptim, gifsicle and cwebp to verify they work and are updated

This add-on STILL deletes my image files, and in a way that prevents me from removing the broken images via the admin attachments interface, unless I manually re-create their missing *.data files.

Here's an example of the file deletion bug from the debug log:
2024-08-02 03:51:02 Process images $contentType=attachment_data $lastRunId=122774 $images=5
2024-08-02 03:51:02 Begin optimize $id=122775
2024-08-02 03:51:04 Truonglv\ImageOptimizer\ContentData\AttachmentData::onSuccess
2024-08-02 03:51:04 file_hash changed ed405e481ec1474d7418ca1ca2a99772 -> b05ecac977420436fc35c11c40f1704f
2024-08-02 03:51:04 Copying /var/www/html/forum/internal_data/temp/tio_TxFiTm1722570662886 to internal-data://attachments/122/122775-074a64ceeca98ce0868bf88454799256.data
2024-08-02 03:51:04 Truonglv\ImageOptimizer\ContentData\AbstractData::removeAbstractFile(internal-data://attachments/122/122775-074a64ceeca98ce0868bf88454799256.data)
2024-08-02 03:51:04 Truonglv\ImageOptimizer\ContentData\AbstractData::removeAbstractFile(data://attachments/122/122775-074a64ceeca98ce0868bf88454799256.jpg)
2024-08-02 03:51:04 Truonglv\ImageOptimizer\ContentData\AttachmentData::onSuccess -> OK
Note that it SAYS it copied to internal-data://attachments/122/.... but it doesn't actually copy the file. It will happily update the database with the new file hash of the file, it will happily delete the old version of the file... but it won't save the new version of the file.
 
Even after:
1) installing addon version 3.0.0 and updating it
2) downloading the latest webp from https://developers.google.com/speed/webp/download and installing it
3) re-running the setup file
3) going through the addon's file path references for pngquant, jpegoptim, gifsicle and cwebp to verify they work and are updated

This add-on STILL deletes my image files, and in a way that prevents me from removing the broken images via the admin attachments interface, unless I manually re-create their missing *.data files.

Here's an example of the file deletion bug from the debug log:

Note that it SAYS it copied to internal-data://attachments/122/.... but it doesn't actually copy the file. It will happily update the database with the new file hash of the file, it will happily delete the old version of the file... but it won't save the new version of the file.
Wanderermaybe the deletion step can have a check to verify the file has been copied first?
 
View previous replies…
XF 2.3.0 has changed the way to get image path so it break the add-on now. I will release new hot fix soon.
TruonglvHow can we recover deleted images ?
i used a backup to revocer them but even if they are accessible using the direct link some of them are not displayed in the browser.
I think it's because the size difference.
is it a way to rerun the optimiser on these specific images or all to update that ?
 
Hello. Truonglv, have you done any tests? What is the difference (in size) between Image Optimizer and the built-in solution in Xenforo 2.3.0? Is it advisable to use an add-on? Thanks!
 
Hello. Truonglv, have you done any tests? What is the difference (in size) between Image Optimizer and the built-in solution in Xenforo 2.3.0? Is it advisable to use an add-on? Thanks!
topasIf you want to compress JPG/PNG images, then you will need to use this add-on. If you want to convert/compress to WebP (which not all browsers can display currently) then you will be better served by the built in process.
Granted, it is only about 4% of the users that can't see them... but it's easier with JPG and everyone can see them.
Also, WebP doesn't support the higher megapixel sizes that PNG and JPG do.
 
I was interested in the size. Perhaps the final difference there is 2 times. And there's no point in enabling WebP, it's probably not as energy efficient as compressed PNG with image-optimizer. Maybe, perhaps. I haven't tested yet.
About WebP, seems all browsers support it https://developers.google.com/speed/webp/faq At least that's what they promise.
topasAll major browsers currently do, but not everyone runs a current browser.
There are still users that their computer is running older versions of Windows.
WebP is not something that I'll be using on my site as it is largely photography based and many people like to download the images to use as backgrounds. It is easier to just keep them in the format they can directly use.
 
Anyone still on XenForo 2.2.16 area and using the latest version of this add-on for XenForo 2.2.x?
I am still running 2.1.7 and notice the latest version shows as "fixed for deleting images".
I know that was a problem with the versions after 2.1.7 and would like to confirm if this is fixed before I upgrade to it as I really can't afford to have the astrophotography images that are uploaded disappearing.
I really want to be able to keep on using this as I realize that WebP is in 2.3, but for my use case that is basically useless.
 
Last edited:
Anyone still on XenForo 2.2.16 area and using the latest version of this add-on for XenForo 2.2.x?
I am still running 2.1.7 and notice the latest version shows as "fixed for deleting images".
I know that was a problem with the versions after 2.1.7 and would like to confirm if this is fixed before I upgrade to it as I really can't afford to have the astrophotography images that are uploaded disappearing.
I really want to be able to keep on using this as I realize that WebP is in 2.3, but for my use case that is basically useless.
TD PerryBTW, I did tests on basic images. In my case WebP is useless. In my case
Original image 100%
WebP - 90%
Truonglv Image Optimizer - 40%

Yes, all images are different, all have different qualities and requirements for img. But personally for me there are no alternatives to Image Optimizer. WebP is useless.
 
What is the best upgrade path. I am on XF 2.2.16. Should I update the addon to the 3.0.1 then upgrade to XF 2.3.x or update XF first then the addons?
 
What is the best upgrade path. I am on XF 2.2.16. Should I update the addon to the 3.0.1 then upgrade to XF 2.3.x or update XF first then the addons?
dcglabsGenerally the recommended process is to disable your add-ons that you know that do not work currently with 2.3.x line, do the XF upgrade, upgrade the add-ons then re-enable the ones you had disabled.
 
And here I have upgraded to 2.3.4 of XF. And then updated to the latest version of this add-on.
I go to test it by uploading a few 2-5MB images to my site in XFMG. Not a one of them gets optimized. I am guessing this does not process image uploads in other add-ons... or if it does, it simply isn't on mine.
Now I've had to go ahead and use the WebP in XF instead since this is not the first time this add-on has had a similar issue. And I really can't afford to take the chance on it deleting my images when it tries/doesn't process them like it has done in the past. The lack of communications from the developer is rather worrisome. There is another add-on of theirs that I am probably going to look at replacing also.
 
And here I have upgraded to 2.3.4 of XF. And then updated to the latest version of this add-on.
I go to test it by uploading a few 2-5MB images to my site in XFMG. Not a one of them gets optimized. I am guessing this does not process image uploads in other add-ons... or if it does, it simply isn't on mine.
Now I've had to go ahead and use the WebP in XF instead since this is not the first time this add-on has had a similar issue. And I really can't afford to take the chance on it deleting my images when it tries/doesn't process them like it has done in the past. The lack of communications from the developer is rather worrisome. There is another add-on of theirs that I am probably going to look at replacing also.
TD PerryIt optimize all images using attachment system. Do you have permissions to skip optimize?
 
It optimize all images using attachment system. Do you have permissions to skip optimize?
TruonglvIt was working prior to the upgrade on all of the images I uploaded. Was there a new permission added in the newer version? If so, that might have been it. But before it worked fine.

Screen Shot 2024-12-18 at 8.11.43 PM.png

All those attachments that show as "Today" were between 3-5MB in size like the last two shown that did work. All uploaded by me.
I had it set for anything less than 100KB would not get processed.

I know this happened once before with the "old" version. Problem is now I've engaged the WebP in XF and have ran the image optimization option.
 
Truonglv Nice add-on.
i got the problem of image deleted when optimized then i updated the add-on.

Now it's good but, i tried to recover old images but using backup. Image are now accessible in direct link as attachment. but some are not display ed in the post, instead it's appear broked.
i think it's because of the differente size before/after optimize.
How can i recover that ?
is it possible to run the optimze on specific attachments ?
 
Truonglv Nice add-on.
i got the problem of image deleted when optimized then i updated the add-on.

Now it's good but, i tried to recover old images but using backup. Image are now accessible in direct link as attachment. but some are not display ed in the post, instead it's appear broked.
i think it's because of the differente size before/after optimize.
How can i recover that ?
is it possible to run the optimze on specific attachments ?
aanaThank you for give more details. In this case you need custom scripts to rebuild attachment size from database with disk
 
Thank you for give more details. In this case you need custom scripts to rebuild attachment size from database with disk
TruonglvFor people with this problem, the naive way:

Get the data_id for specific attachment id list
SQL:
SELECT data_id FROM xf_attachment WHERE attachment_id IN (ID, ID, ID, ... );

Get the size of all concerned files, directly on the server
Bash:
ls -la internal_data/attachments/FIRST_2-3_digit_of_data_id/data_id-*.data | awk '{print $5}'

Update the DB with correct size
SQL:
UPDATE `xf_attachment_data` SET `file_size` = 'SIZE' WHERE `xf_attachment_data`.`data_id` = DATA_ID;
 
Truonglv Nice add-on.
i got the problem of image deleted when optimized then i updated the add-on.

Now it's good but, i tried to recover old images but using backup. Image are now accessible in direct link as attachment. but some are not display ed in the post, instead it's appear broked.
i think it's because of the differente size before/after optimize.
How can i recover that ?
is it possible to run the optimze on specific attachments ?
aanaHi! It's very depressing. I really don't want to upload hundreds of GB of images from a backup. I haven't updated yet. And now I'm afraid.
Can you please add details how it had happened? Have you .webp (and webp optimisation enabled)? Or it was original usual formats?
 
View previous replies…
At least the reason is clear and what not to do. Thank you a lot for answers and experience!
topasJust a note... you should always disable ALL add-ons prior to an XF upgrade (not to mention making a full backup). Then after the upgrade do any necessary upgrades to your add-ons while they are disabled. After they are upgraded they will re-enable themselves.
I quit using this add-on after I upgraded to XF 2.3.4 as I no longer getting any large images processed in the add-on log like I had prior to the upgrade, and that behavior was similar to when the add-on was deleting images during it's processing/optomizing.
Was leery of more images being deleted and it was simply easier (but not better) to use the built in WebP optimization in XF and adjust the compression/optimizataion via the config.php settings.
I would have really preferred to continue using this add-on but with the fact that the developer is rarely around to respond to questions it worried me.
Another issue that I discovered is that apparently it only works on the forum images. If you have images uploaded via any other add-on (either 1st party like XFRM or 3rd party) this add-on does not even touch them. And since I have a heavy reliance on XFMG on my site, I lose about 1/2 of the storage due to it not optimizing those images.
 
Last edited:
Back
Top