[TH] Image Optimizer [Deleted]

I posted the below in another part of the forum and was advised to ask here:

I've been getting quite a few of these errors today for no apparent reason.

Has anyone any ideas?



Server error log



  • GuzzleHttp\Exception\ServerException: Server error: POST http://api.resmush.it/ws.php resulted in a 503 Service Temporarily Unavailable response: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmln (truncated...)
  • src\vendor\guzzlehttp\guzzle\src\Exception\RequestException.php:113

  • Generated by: Unknown account
  • Jul 1, 2020 at 1:22 AM


Stack trace​


#0 src\vendor\guzzlehttp\guzzle\src\Middleware.php(66): GuzzleHttp\Exception\RequestException::create(Object(GuzzleHttp\Psr7\Request), Object(GuzzleHttp\Psr7\Response))
#1 src\vendor\guzzlehttp\promises\src\Promise.php(203): GuzzleHttp\Middleware::GuzzleHttp\{closure}(Object(GuzzleHttp\Psr7\Response))
#2 src\vendor\guzzlehttp\promises\src\Promise.php(156): GuzzleHttp\Promise\Promise::callHandler(1, Object(GuzzleHttp\Psr7\Response), Array)
#3 src\vendor\guzzlehttp\promises\src\TaskQueue.php(47): GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}()
#4 src\vendor\guzzlehttp\promises\src\Promise.php(246): GuzzleHttp\Promise\TaskQueue->run(true)
#5 src\vendor\guzzlehttp\promises\src\Promise.php(223): GuzzleHttp\Promise\Promise->invokeWaitFn()
#6 src\vendor\guzzlehttp\promises\src\Promise.php(267): GuzzleHttp\Promise\Promise->waitIfPending()
#7 src\vendor\guzzlehttp\promises\src\Promise.php(225): GuzzleHttp\Promise\Promise->invokeWaitList()
#8 src\vendor\guzzlehttp\promises\src\Promise.php(62): GuzzleHttp\Promise\Promise->waitIfPending()
#9 src\vendor\guzzlehttp\guzzle\src\Client.php(131): GuzzleHttp\Promise\Promise->wait()
#10 src\vendor\guzzlehttp\guzzle\src\Client.php(89): GuzzleHttp\Client->request('post', 'http://api.resm...', Array)
#11 src\addons\ThemeHouse\ImageOptimizer\ImageOptimizer\ReSmush.php(105): GuzzleHttp\Client->__call('post', Array)
#12 src\addons\ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize.php(61): ThemeHouse\ImageOptimizer\ImageOptimizer\ReSmush->optimizeImage(Object(ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize))
#13 src\addons\ThemeHouse\ImageOptimizer\ContentHandler\AbstractHandler.php(211): ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize->run()
#14 src\addons\ThemeHouse\ImageOptimizer\Cron\Optimize.php(31): ThemeHouse\ImageOptimizer\ContentHandler\AbstractHandler->optimize(Object(ThemeHouse\ImageOptimizer\Entity\Status))
#15 [internal function]: ThemeHouse\ImageOptimizer\Cron\Optimize::eek:ptimizeImages(Object(XF\Entity\CronEntry))
#16 src\XF\Job\Cron.php(35): call_user_func(Array, Object(XF\Entity\CronEntry))
#17 src\XF\Job\Manager.php(253): XF\Job\Cron->run(G)
#18 src\XF\Job\Manager.php(195): XF\Job\Manager->runJobInternal(Array, G)
#19 src\XF\Job\Manager.php(79): XF\Job\Manager->runJobEntry(Array, G)
#20 job.php(42): XF\Job\Manager->runQueue(false, 8)
#21 {main}


The issue seemed to go away at one point and then came back again. No changes have been made. Version 1.1.2 and been running stable since installed over a year ago.


@ThemeHouse - can you shed any light on it please?

I've reported it to reSmush
 
I posted the below in another part of the forum and was advised to ask here:




The issue seemed to go away at one point and then came back again. No changes have been made. Version 1.1.2 and been running stable since installed over a year ago.


@ThemeHouse - can you shed any light on it please?

I've reported it to reSmush

I have same issue for some reason. When someone is uploading an image, they got an error and can’t upload the image anymore.
 
I have same issue for some reason. When someone is uploading an image, they got an error and can’t upload the image anymore.

Missed your post, you can temporarily disable the ReSmush provider until they get the issue resolved or you can turn off optimizing the image immediately when it's uploaded in your board options
 
One you rebuild the cache (image optimizes) should the Status Queue update to show the space saved? Where would you find the stats after the rebuild?
 
Looks like I didn't have Jpegoptim, pngquant , or gifsicle installed. Jpegoptim is now installed - are there instructions for installing the other two? I went to these sites but couldn't find the instructions:

https://www.lcdf.org/gifsicle/
It all depends on the operating system and version your web hosting is running. Maybe try searching "How to install pngquant or gifsicle on" within good but include your operating system and version.
 
Last edited:
Looks like I didn't have Jpegoptim, pngquant , or gifsicle installed. Jpegoptim is now installed - are there instructions for installing the other two? I went to these sites but couldn't find the instructions:

https://www.lcdf.org/gifsicle/
You can ask also your provider to install these 3 extension, jpegoptim, pngquant , and gifsicle and then you enable them in the panel of the Image Optimizer add-on where are the services used for compression
 
You can ask also your provider to install these 3 extension, jpegoptim, pngquant , and gifsicle and then you enable them in the panel of the Image Optimizer add-on where are the services used for compression
That's what I've done, and the host asked for links to the installation instructions. That's what led me to asking for that here. I think I found them and forwarded them over to the host.
 
mozjpeg would be nice. it is the default encoder used in http://squoosh.app/ which is a web app developed by chrome developers and they seem to prefer it over Jpegoptim. i am not sure why they are not using guetzli in it though considering it is google's own product! i hope to see webp support (auto convert from jpg/png to webp as an option) eventually once updates to apple os are out (and widely adopted) and xenforo adds support for it for image attachments.
 
Got things installed and ran the script to optimize the images. It ran through all of them. I see 1836 pages of optimized images in the Status queue, which is great. However, if I go to the Attachment Browser and sort by size I see that I still have some very large images - some that were 9.7MB before running the optimizer, and they're still that size. Wondering if those weren't optimized, and if not, why?

Is there something I should do to shrink the dimensions of those and then run the optimizer script again?
 
MY new server doesn't allow exec so i've switched to resmush.it.

I tried a few images and they are were optimized about the same as jpegoptim so you should be seeing some reductions.

did you set the max values to 100? i target 85%
 
In some instances images that have gone through optimization will end up taking more space than before. In that case the add-on will keep the original image. You can try to adjust your settings to see if that produces better results.
 
That's what I've done, and the host asked for links to the installation instructions. That's what led me to asking for that here. I think I found them and forwarded them over to the host.
Really expert and clever this provider.
Why they cannot search on google jpegoptim, pngquant , and gifsicle extension. Is them work and them must know.
If not make you the search and send them the links.
Thing that can be done in 5 minutes.
 
Top Bottom