[TH] Image Optimizer [Deleted]

Optimize Pre-existing Images​

To optimize pre-existing images, navigate to ACP → Tools → Data maintenance → Rebuild caches → Optimize images. You can then choose which content type you want to optimize: (All), Attachments, Proxied images, or User avatars. You can also set how many items are optimized per page.

Can I run this on CLI mode? using php cmp.php.
Thanks.
 
Is anyone here also using AndyB Convert Image addon with this TH Addon?
 
Is anyone here also using AndyB Convert Image addon with this TH Addon?
They usually aren't compatible.
 
  • Sad
Reactions: rdn
I'm using 'Convert image all 4.1' with no issues.
I have TH Image Optimzer to process via a cron job, not as and when uploaded
 
  • Like
Reactions: rdn
I'm using 'Convert image all 4.1' with no issues.
That is different addon and works with older embed only.

Curious why you didn't use this also?

Sorry I'm a bit off topic, just want to make sure before purchasing the addon.
 
That is different addon and works with older embed only.

Curious why you didn't use this also?

Sorry I'm a bit off topic, just want to make sure before purchasing the addon.
'Convert Image all' is run manually rather than on the fly as posts are made.
'Convert Image' is run automatically on the fly as posts are made

In a busy forum where we get 700-1000 posts a day, I'd rather run the add-on once a month manually than have it running automatically


However, I'm getting confused now as the TH Optimiser will optimise images either on the fly or via a cron so what happens to images that have been posted then 'converted' later, would the Optimiser pick them up or not?

Also, a question I asked a while back does the TH Optimiser keep copies of the images prior to optimising them as well as the optimised images?
I would suspect not but did notice a sharp drop in available drive space after installing it and running it for the first time.
 
'Convert Image all' is run manually rather than on the fly as posts are made.
'Convert Image' is run automatically on the fly as posts are made

In a busy forum where we get 700-1000 posts a day, I'd rather run the add-on once a month manually than have it running automatically


However, I'm getting confused now as the TH Optimiser will optimise images either on the fly or via a cron so what happens to images that have been posted then 'converted' later, would the Optimiser pick them up or not?

Also, a question I asked a while back does the TH Optimiser keep copies of the images prior to optimising them as well as the optimised images?
I would suspect not but did notice a sharp drop in available drive space after installing it and running it for the first time.

Im using this addon for a while and happy, do make sure you set it properly, otherwise you can mess up with your images, which happened to me.
 
Hi Dalton I let you know that also disabling the avatars images compression, the plugin continue to compress those avatar images, loosing also more quality of the images that became really unviewable.
Then I'm using Jpegoptim e Pngquant but the compression loose more quality and is not good. Is there some other good and free solution?
 
Hi Dalton I let you know that also disabling the avatars images compression, the plugin continue to compress those avatar images, loosing also more quality of the images that became really unviewable.
Then I'm using Jpegoptim e Pngquant but the compression loose more quality and is not good. Is there some other good and free solution?
You should play with percentage and set it right.
 
However, I'm getting confused now as the TH Optimiser will optimise images either on the fly or via a cron so what happens to images that have been posted then 'converted' later, would the Optimiser pick them up or not?
Depends entirely on how Andy has implemented the conversion. If he's used the native XenForo attachment code, then image optimizer will be able to pick it up and optimize it. No guarantee though.
 
@mattrogowski @Lukas W. Getting lot of Server error log:

Code:
ErrorException: [E_NOTICE] stream_copy_to_stream(): write of 8192 bytes failed with errno=14 Bad address src/XF/Util/File.php:167

Generated by: Unknown account Mar 10, 2021 at 11:28 AM

Stack trace

#0 [internal function]: XF::handlePhpError(8, '[E_NOTICE] stre...', '/home/nadda/pub...', 167, Array)
#1 src/XF/Util/File.php(167): stream_copy_to_stream(Resource id #12, Resource id #13)
#2 src/XF/Util/File.php(176): XF\Util\File::copyStreamToTempFile(Resource id #12, true)
#3 src/addons/ThemeHouse/ImageOptimizer/ContentHandler/ImageProxy.php(142): XF\Util\File::copyAbstractedPathToTempFile('internal-data:/...')
#4 src/addons/ThemeHouse/ImageOptimizer/ContentHandler/AbstractHandler.php(85): ThemeHouse\ImageOptimizer\ContentHandler\ImageProxy->standardizeEntityForStatus(Object(ThemeHouse\ImageOptimizer\XF\Entity\ImageProxy))
#5 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer.php(95): ThemeHouse\ImageOptimizer\ContentHandler\AbstractHandler->isEntityOptimized(Object(ThemeHouse\ImageOptimizer\XF\Entity\ImageProxy))
#6 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer.php(53): ThemeHouse\ImageOptimizer\ImageOptimizer->isEntityOptimized('th_imageopt_ima...', Object(ThemeHouse\ImageOptimizer\XF\Entity\ImageProxy))
#7 src/addons/ThemeHouse/ImageOptimizer/XF/Service/ImageProxy.php(22): ThemeHouse\ImageOptimizer\ImageOptimizer::optimize('th_imageopt_ima...', Object(ThemeHouse\ImageOptimizer\XF\Entity\ImageProxy))
#8 src/XF/Service/ImageProxy.php(94): ThemeHouse\ImageOptimizer\XF\Service\ImageProxy->finalizeFromFetchResults(Object(ThemeHouse\ImageOptimizer\XF\Entity\ImageProxy), Array)
#9 src/XF/Service/ImageProxy.php(47): XF\Service\ImageProxy->fetchNewImage('https://nirjonm...')
#10 src/XF/Proxy/Controller.php(120): XF\Service\ImageProxy->getImage('https://nirjonm...')
#11 proxy.php(34): XF\Proxy\Controller->outputImage('https://nirjonm...', 'a4650c0f6f8074f...')
#12 {main}

Request state

array(4) {
  ["url"] => string(144) "/proxy.php?image=https%3A%2F%2Fmysite.net%2Fimages%2F2021%2F02%2F26%2FTegan_Summers_Lexy_Simms_174.jpg&hash=a4650c0f6f8074ff63561b986ce1dc50"
  ["referrer"] => string(84) "/threads/littlemut-lexy_simms_and_tegan_summers_1.83417/page-8"
  ["_GET"] => array(2) {
    ["image"] => string(73) "/images/2021/02/26/Tegan_Summers_Lexy_Simms_174.jpg"
    ["hash"] => string(32) "a4650c0f6f8074ff63561b986ce1dc50"
  }
  ["_POST"] => array(0) {
  }
}
 
@mattrogowski @Lukas W. Getting lot of Server error log:

Code:
ErrorException: [E_NOTICE] stream_copy_to_stream(): write of 8192 bytes failed with errno=14 Bad address src/XF/Util/File.php:167

Generated by: Unknown account Mar 10, 2021 at 11:28 AM

Stack trace

#0 [internal function]: XF::handlePhpError(8, '[E_NOTICE] stre...', '/home/nadda/pub...', 167, Array)
#1 src/XF/Util/File.php(167): stream_copy_to_stream(Resource id #12, Resource id #13)
#2 src/XF/Util/File.php(176): XF\Util\File::copyStreamToTempFile(Resource id #12, true)
#3 src/addons/ThemeHouse/ImageOptimizer/ContentHandler/ImageProxy.php(142): XF\Util\File::copyAbstractedPathToTempFile('internal-data:/...')
#4 src/addons/ThemeHouse/ImageOptimizer/ContentHandler/AbstractHandler.php(85): ThemeHouse\ImageOptimizer\ContentHandler\ImageProxy->standardizeEntityForStatus(Object(ThemeHouse\ImageOptimizer\XF\Entity\ImageProxy))
#5 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer.php(95): ThemeHouse\ImageOptimizer\ContentHandler\AbstractHandler->isEntityOptimized(Object(ThemeHouse\ImageOptimizer\XF\Entity\ImageProxy))
#6 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer.php(53): ThemeHouse\ImageOptimizer\ImageOptimizer->isEntityOptimized('th_imageopt_ima...', Object(ThemeHouse\ImageOptimizer\XF\Entity\ImageProxy))
#7 src/addons/ThemeHouse/ImageOptimizer/XF/Service/ImageProxy.php(22): ThemeHouse\ImageOptimizer\ImageOptimizer::optimize('th_imageopt_ima...', Object(ThemeHouse\ImageOptimizer\XF\Entity\ImageProxy))
#8 src/XF/Service/ImageProxy.php(94): ThemeHouse\ImageOptimizer\XF\Service\ImageProxy->finalizeFromFetchResults(Object(ThemeHouse\ImageOptimizer\XF\Entity\ImageProxy), Array)
#9 src/XF/Service/ImageProxy.php(47): XF\Service\ImageProxy->fetchNewImage('https://nirjonm...')
#10 src/XF/Proxy/Controller.php(120): XF\Service\ImageProxy->getImage('https://nirjonm...')
#11 proxy.php(34): XF\Proxy\Controller->outputImage('https://nirjonm...', 'a4650c0f6f8074f...')
#12 {main}

Request state

array(4) {
  ["url"] => string(144) "/proxy.php?image=https%3A%2F%2Fmysite.net%2Fimages%2F2021%2F02%2F26%2FTegan_Summers_Lexy_Simms_174.jpg&hash=a4650c0f6f8074ff63561b986ce1dc50"
  ["referrer"] => string(84) "/threads/littlemut-lexy_simms_and_tegan_summers_1.83417/page-8"
  ["_GET"] => array(2) {
    ["image"] => string(73) "/images/2021/02/26/Tegan_Summers_Lexy_Simms_174.jpg"
    ["hash"] => string(32) "a4650c0f6f8074ff63561b986ce1dc50"
  }
  ["_POST"] => array(0) {
  }
}
This seems to be a PHP issue rather than the addon itself, after searching it sounds like the upload_max_filesize PHP setting may need to be increased. Sources here and here.

Also found a PHP bug report from a while back but says it's fixed on Windows, if you're running a Windows server.
 
Top Bottom