[TH] Image Optimizer

[TH] Image Optimizer [Paid] 1.1.1

No permission to buy ($25.00)

Kevin

Well-known member
By default it'll only optimize images uploaded after you installed the add-on. If you want to optimize all previously uploaded images you can go to Tools -> Rebuild caches and run the job from there. I'd recommend taking a backup first since it will touch all images. Nothing bad should happen as there are a lot of safeguards in place, but still a good idea :)
Jake, this may have come up before... can we 'fudge' the attachment ID that the rebuild job starts from? Here's the scenario... under XF 1.5.x a different 'optimizer' product was being used, now with XF 2.x the site is using TH's optimizer Because some images have already been optimized they shouldn't be looked at again.

Thinking out loud, what is the actual logic for the rebuild job, if it doesn't exist in the TH queue table it tries to optimize it? What if we ran a query to populate the TH table from a select of the old product's table?
 

Jake B.

Well-known member
what is the actual logic for the rebuild job, if it doesn't exist in the TH queue table it tries to optimize it?
That's pretty much spot on, it just loops through the available content types and checks if it's already in our status table, if not it attempts to optimize it.

What if we ran a query to populate the TH table from a select of the old product's table?
You could try something like this, but I can't guarantee that it'll work 100%, not something I've tried to do
 

Solidus

Well-known member
Some errors from this.

Code:
InvalidArgumentException: Accessed unknown getter 'filename' on XF:User[3621] src/XF/Mvc/Entity/Entity.php:194
Generated by: BeardsOfWarjStylesXL Mar 1, 2019 at 7:32 PM
Stack trace
#0 src/XF/Mvc/Entity/Entity.php(101): XF\Mvc\Entity\Entity->get('filename')
#1 src/addons/ThemeHouse/ImageOptimizer/ContentHandler/Avatar.php(18): XF\Mvc\Entity\Entity->__get('filename')
#2 src/addons/ThemeHouse/ImageOptimizer/Entity/Status.php(36): ThemeHouse\ImageOptimizer\ContentHandler\Avatar->getFileExtensionForStatus(Object(ThemeHouse\ImageOptimizer\Entity\Status))
#3 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer/ReSmush.php(58): ThemeHouse\ImageOptimizer\Entity\Status->getFileExtension()
#4 src/addons/ThemeHouse/ImageOptimizer/Service/ImageOptimizer/Optimize.php(47): ThemeHouse\ImageOptimizer\ImageOptimizer\ReSmush->optimizeImage(Object(ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize))
#5 src/addons/ThemeHouse/ImageOptimizer/ContentHandler/AbstractHandler.php(57): ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize->run()
#6 src/addons/ThemeHouse/ImageOptimizer/ContentHandler/AbstractHandler.php(160): ThemeHouse\ImageOptimizer\ContentHandler\AbstractHandler->optimize(Object(ThemeHouse\ImageOptimizer\Entity\Status))
#7 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer.php(105): ThemeHouse\ImageOptimizer\ContentHandler\AbstractHandler->createStatusAndOptimize(Object(SV\ReportImprovements\XF\Entity\User))
#8 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer.php(36): ThemeHouse\ImageOptimizer\ImageOptimizer->optimizeEntity('th_imageoptimiz...', Object(SV\ReportImprovements\XF\Entity\User))
#9 src/addons/ThemeHouse/ImageOptimizer/XF/Service/User/Avatar.php(21): ThemeHouse\ImageOptimizer\ImageOptimizer::optimize('th_imageoptimiz...', Object(SV\ReportImprovements\XF\Entity\User))
#10 src/XF/Pub/Controller/Account.php(466): ThemeHouse\ImageOptimizer\XF\Service\User\Avatar->updateAvatar()
#11 src/XF/Mvc/Dispatcher.php(321): XF\Pub\Controller\Account->actionAvatar(Object(XF\Mvc\ParameterBag))
#12 src/XF/Mvc/Dispatcher.php(244): XF\Mvc\Dispatcher->dispatchClass('XF:Account', 'Avatar', Object(XF\Mvc\RouteMatch), Object(SV\UserEssentials\XF\Pub\Controller\Account), NULL)
#13 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\UserEssentials\XF\Pub\Controller\Account), NULL)
#14 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#15 src/XF/App.php(2177): XF\Mvc\Dispatcher->run()
#16 src/XF.php(390): XF\App->run()
#17 index.php(20): XF::runApp('XF\\Pub\\App')
#18 {main}
Code:
ErrorException: [Image Optimizer] Error received from reSmush for status ID 1524: Unauthorized extension. Allowed are : JPG, PNG, GIF, BMP, TIFF src/XF/Error.php:75
Generated by: BeardsOfWarjStylesXL Mar 1, 2019 at 7:32 PM
Stack trace
#0 src/XF.php(187): XF\Error->logError('[Image Optimize...', false)
#1 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer/ReSmush.php(92): XF::logError('[Image Optimize...')
#2 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer/ReSmush.php(77): ThemeHouse\ImageOptimizer\ImageOptimizer\ReSmush->reSmushFailedResponse(Object(ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize), '[Image Optimize...', true)
#3 src/addons/ThemeHouse/ImageOptimizer/Service/ImageOptimizer/Optimize.php(47): ThemeHouse\ImageOptimizer\ImageOptimizer\ReSmush->optimizeImage(Object(ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize))
#4 src/addons/ThemeHouse/ImageOptimizer/ContentHandler/AbstractHandler.php(57): ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize->run()
#5 src/addons/ThemeHouse/ImageOptimizer/ContentHandler/AbstractHandler.php(160): ThemeHouse\ImageOptimizer\ContentHandler\AbstractHandler->optimize(Object(ThemeHouse\ImageOptimizer\Entity\Status))
#6 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer.php(105): ThemeHouse\ImageOptimizer\ContentHandler\AbstractHandler->createStatusAndOptimize(Object(SV\ReportImprovements\XF\Entity\User))
#7 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer.php(36): ThemeHouse\ImageOptimizer\ImageOptimizer->optimizeEntity('th_imageoptimiz...', Object(SV\ReportImprovements\XF\Entity\User))
#8 src/addons/ThemeHouse/ImageOptimizer/XF/Service/User/Avatar.php(21): ThemeHouse\ImageOptimizer\ImageOptimizer::optimize('th_imageoptimiz...', Object(SV\ReportImprovements\XF\Entity\User))
#9 src/XF/Pub/Controller/Account.php(466): ThemeHouse\ImageOptimizer\XF\Service\User\Avatar->updateAvatar()
#10 src/XF/Mvc/Dispatcher.php(321): XF\Pub\Controller\Account->actionAvatar(Object(XF\Mvc\ParameterBag))
#11 src/XF/Mvc/Dispatcher.php(244): XF\Mvc\Dispatcher->dispatchClass('XF:Account', 'Avatar', Object(XF\Mvc\RouteMatch), Object(SV\UserEssentials\XF\Pub\Controller\Account), NULL)
#12 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\UserEssentials\XF\Pub\Controller\Account), NULL)
#13 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#14 src/XF/App.php(2177): XF\Mvc\Dispatcher->run()
#15 src/XF.php(390): XF\App->run()
#16 index.php(20): XF::runApp('XF\\Pub\\App')
#17 {main}
Code:
ErrorException: [E_NOTICE] Undefined index: extension src/addons/ThemeHouse/ImageOptimizer/ContentHandler/Avatar.php:20
Generated by: Owen Hart Mar 1, 2019 at 6:50 PM
Stack trace
#0 src/addons/ThemeHouse/ImageOptimizer/ContentHandler/Avatar.php(20): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/var/www/vhosts...', 20, Array)
#1 src/addons/ThemeHouse/ImageOptimizer/Entity/Status.php(36): ThemeHouse\ImageOptimizer\ContentHandler\Avatar->getFileExtensionForStatus(Object(ThemeHouse\ImageOptimizer\Entity\Status))
#2 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer/ReSmush.php(58): ThemeHouse\ImageOptimizer\Entity\Status->getFileExtension()
#3 src/addons/ThemeHouse/ImageOptimizer/Service/ImageOptimizer/Optimize.php(47): ThemeHouse\ImageOptimizer\ImageOptimizer\ReSmush->optimizeImage(Object(ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize))
#4 src/addons/ThemeHouse/ImageOptimizer/ContentHandler/AbstractHandler.php(57): ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize->run()
#5 src/addons/ThemeHouse/ImageOptimizer/ContentHandler/AbstractHandler.php(160): ThemeHouse\ImageOptimizer\ContentHandler\AbstractHandler->optimize(Object(ThemeHouse\ImageOptimizer\Entity\Status))
#6 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer.php(105): ThemeHouse\ImageOptimizer\ContentHandler\AbstractHandler->createStatusAndOptimize(Object(SV\ReportImprovements\XF\Entity\User))
#7 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer.php(36): ThemeHouse\ImageOptimizer\ImageOptimizer->optimizeEntity('th_imageoptimiz...', Object(SV\ReportImprovements\XF\Entity\User))
#8 src/addons/ThemeHouse/ImageOptimizer/XF/Service/User/Avatar.php(21): ThemeHouse\ImageOptimizer\ImageOptimizer::optimize('th_imageoptimiz...', Object(SV\ReportImprovements\XF\Entity\User))
#9 src/XF/Pub/Controller/Account.php(466): ThemeHouse\ImageOptimizer\XF\Service\User\Avatar->updateAvatar()
#10 src/XF/Mvc/Dispatcher.php(321): XF\Pub\Controller\Account->actionAvatar(Object(XF\Mvc\ParameterBag))
#11 src/XF/Mvc/Dispatcher.php(244): XF\Mvc\Dispatcher->dispatchClass('XF:Account', 'Avatar', Object(XF\Mvc\RouteMatch), Object(SV\UserEssentials\XF\Pub\Controller\Account), NULL)
#12 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\UserEssentials\XF\Pub\Controller\Account), NULL)
#13 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#14 src/XF/App.php(2177): XF\Mvc\Dispatcher->run()
#15 src/XF.php(390): XF\App->run()
#16 index.php(20): XF::runApp('XF\\Pub\\App')
#17 {main}
 

Kevin

Well-known member
Thoughts on tracking down what images are causing this error?
The only allowed attachment types are png, jpg, jpeg, jpe & gif so I'm not sure where it would even be finding an .ico file. Would an entry of what it tried to optimized when that error got thrown be in one of the TH tables?
It'd be in xf_th_imageoptimizer_status with a status_id of 190, should give you content_type and content_id
Found it, it's tied in to XF 2.1 explicitly.... in short, somebody entered a URL that was then 'unfurled' in the post by XF 2.1, the images are attempting to be proxied which includes the unfurled link's favicon.ico file. TH Optimizer is then attempting to optimize the proxied images including the favicon.ico file.

I like the fact that TH Optimizer tried giving me a 'heads up' that it encountered an image with no defined provider but, at the same time, maybe if it wasn't showing up in the ACP in the "Server Error" alerts it'd be a better Admin experience. :)
Can we please get an option to either blacklist mime types that should be ignored or blacklist of file extensions that should be ignored? Trying to optimize .ico files from unfurled URLs killing my error log.

197615
 

est3ban129

Active member
I have this problem:

Code:
InvalidArgumentException: Accessed unknown getter 'filename' on XF:User[2532] src/XF/Mvc/Entity/Entity.php:194
Generado por: Cuenta desconocida 13 Mar 2019 a las 15:10
Seguimiento
#0 src/XF/Mvc/Entity/Entity.php(101): XF\Mvc\Entity\Entity->get('filename')
#1 src/addons/ThemeHouse/ImageOptimizer/ContentHandler/Avatar.php(18): XF\Mvc\Entity\Entity->__get('filename')
#2 src/addons/ThemeHouse/ImageOptimizer/Entity/Status.php(36): ThemeHouse\ImageOptimizer\ContentHandler\Avatar->getFileExtensionForStatus(Object(ThemeHouse\ImageOptimizer\Entity\Status))
#3 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer/ReSmush.php(58): ThemeHouse\ImageOptimizer\Entity\Status->getFileExtension()
#4 src/addons/ThemeHouse/ImageOptimizer/Service/ImageOptimizer/Optimize.php(47): ThemeHouse\ImageOptimizer\ImageOptimizer\ReSmush->optimizeImage(Object(ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize))
#5 src/addons/ThemeHouse/ImageOptimizer/ContentHandler/AbstractHandler.php(57): ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize->run()
#6 src/addons/ThemeHouse/ImageOptimizer/Cron/Optimize.php(18): ThemeHouse\ImageOptimizer\ContentHandler\AbstractHandler->optimize(Object(ThemeHouse\ImageOptimizer\Entity\Status))
#7 [internal function]: ThemeHouse\ImageOptimizer\Cron\Optimize::optimizeImages(Object(XF\Entity\CronEntry))
#8 src/XF/Job/Cron.php(35): call_user_func(Array, Object(XF\Entity\CronEntry))
#9 src/XF/Job/Manager.php(253): XF\Job\Cron->run(G)
#10 src/XF/Job/Manager.php(195): XF\Job\Manager->runJobInternal(Array, G)
#11 src/XF/Job/Manager.php(79): XF\Job\Manager->runJobEntry(Array, G)
#12 job.php(42): XF\Job\Manager->runQueue(false, 8)
#13 {main}

Estado de la solicitud
array(4) {
  ["url"] => string(13) "/foro/job.php"
  ["referrer"] => string(44) "https://cloudbit.es/foro/index.php?feedback/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
And this:

Code:
ErrorException: [E_NOTICE] Undefined index: extension src/addons/ThemeHouse/ImageOptimizer/ContentHandler/Avatar.php:20
Generado por: Cuenta desconocida 13 Mar 2019 a las 15:10
Seguimiento
#0 src/addons/ThemeHouse/ImageOptimizer/ContentHandler/Avatar.php(20): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/var/www/vhosts...', 20, Array)
#1 src/addons/ThemeHouse/ImageOptimizer/Entity/Status.php(36): ThemeHouse\ImageOptimizer\ContentHandler\Avatar->getFileExtensionForStatus(Object(ThemeHouse\ImageOptimizer\Entity\Status))
#2 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer/ReSmush.php(58): ThemeHouse\ImageOptimizer\Entity\Status->getFileExtension()
#3 src/addons/ThemeHouse/ImageOptimizer/Service/ImageOptimizer/Optimize.php(47): ThemeHouse\ImageOptimizer\ImageOptimizer\ReSmush->optimizeImage(Object(ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize))
#4 src/addons/ThemeHouse/ImageOptimizer/ContentHandler/AbstractHandler.php(57): ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize->run()
#5 src/addons/ThemeHouse/ImageOptimizer/Cron/Optimize.php(18): ThemeHouse\ImageOptimizer\ContentHandler\AbstractHandler->optimize(Object(ThemeHouse\ImageOptimizer\Entity\Status))
#6 [internal function]: ThemeHouse\ImageOptimizer\Cron\Optimize::optimizeImages(Object(XF\Entity\CronEntry))
#7 src/XF/Job/Cron.php(35): call_user_func(Array, Object(XF\Entity\CronEntry))
#8 src/XF/Job/Manager.php(253): XF\Job\Cron->run(G)
#9 src/XF/Job/Manager.php(195): XF\Job\Manager->runJobInternal(Array, G)
#10 src/XF/Job/Manager.php(79): XF\Job\Manager->runJobEntry(Array, G)
#11 job.php(42): XF\Job\Manager->runQueue(false, 8)
#12 {main}


Estado de la solicitud
array(4) {
  ["url"] => string(13) "/foro/job.php"
  ["referrer"] => string(44) "https://cloudbit.es/foro/index.php?feedback/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
Code:
ErrorException: [Image Optimizer] Error received from reSmush for status ID 2253: Unauthorized extension. Allowed are : JPG, PNG, GIF, BMP, TIFF src/XF/Error.php:75
Generado por: Cuenta desconocida 13 Mar 2019 a las 14:10
Seguimiento
#0 src/XF.php(187): XF\Error->logError('[Image Optimize...', false)
#1 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer/ReSmush.php(92): XF::logError('[Image Optimize...')
#2 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer/ReSmush.php(77): ThemeHouse\ImageOptimizer\ImageOptimizer\ReSmush->reSmushFailedResponse(Object(ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize), '[Image Optimize...', true)
#3 src/addons/ThemeHouse/ImageOptimizer/Service/ImageOptimizer/Optimize.php(47): ThemeHouse\ImageOptimizer\ImageOptimizer\ReSmush->optimizeImage(Object(ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize))
#4 src/addons/ThemeHouse/ImageOptimizer/ContentHandler/AbstractHandler.php(57): ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize->run()
#5 src/addons/ThemeHouse/ImageOptimizer/Cron/Optimize.php(18): ThemeHouse\ImageOptimizer\ContentHandler\AbstractHandler->optimize(Object(ThemeHouse\ImageOptimizer\Entity\Status))
#6 [internal function]: ThemeHouse\ImageOptimizer\Cron\Optimize::optimizeImages(Object(XF\Entity\CronEntry))
#7 src/XF/Job/Cron.php(35): call_user_func(Array, Object(XF\Entity\CronEntry))
#8 src/XF/Job/Manager.php(253): XF\Job\Cron->run(G)
#9 src/XF/Job/Manager.php(195): XF\Job\Manager->runJobInternal(Array, G)
#10 src/XF/Job/Manager.php(79): XF\Job\Manager->runJobEntry(Array, G)
#11 job.php(42): XF\Job\Manager->runQueue(false, 8)
#12 {main}
Estado de la solicitud
array(4) {
  ["url"] => string(13) "/foro/job.php"
  ["referrer"] => string(34) "https://cloudbit.es/foro/index.php"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
 

Jake B.

Well-known member
I have this problem:

Code:
InvalidArgumentException: Accessed unknown getter 'filename' on XF:User[2532] src/XF/Mvc/Entity/Entity.php:194
Generado por: Cuenta desconocida 13 Mar 2019 a las 15:10
Seguimiento
#0 src/XF/Mvc/Entity/Entity.php(101): XF\Mvc\Entity\Entity->get('filename')
#1 src/addons/ThemeHouse/ImageOptimizer/ContentHandler/Avatar.php(18): XF\Mvc\Entity\Entity->__get('filename')
#2 src/addons/ThemeHouse/ImageOptimizer/Entity/Status.php(36): ThemeHouse\ImageOptimizer\ContentHandler\Avatar->getFileExtensionForStatus(Object(ThemeHouse\ImageOptimizer\Entity\Status))
#3 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer/ReSmush.php(58): ThemeHouse\ImageOptimizer\Entity\Status->getFileExtension()
#4 src/addons/ThemeHouse/ImageOptimizer/Service/ImageOptimizer/Optimize.php(47): ThemeHouse\ImageOptimizer\ImageOptimizer\ReSmush->optimizeImage(Object(ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize))
#5 src/addons/ThemeHouse/ImageOptimizer/ContentHandler/AbstractHandler.php(57): ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize->run()
#6 src/addons/ThemeHouse/ImageOptimizer/Cron/Optimize.php(18): ThemeHouse\ImageOptimizer\ContentHandler\AbstractHandler->optimize(Object(ThemeHouse\ImageOptimizer\Entity\Status))
#7 [internal function]: ThemeHouse\ImageOptimizer\Cron\Optimize::optimizeImages(Object(XF\Entity\CronEntry))
#8 src/XF/Job/Cron.php(35): call_user_func(Array, Object(XF\Entity\CronEntry))
#9 src/XF/Job/Manager.php(253): XF\Job\Cron->run(G)
#10 src/XF/Job/Manager.php(195): XF\Job\Manager->runJobInternal(Array, G)
#11 src/XF/Job/Manager.php(79): XF\Job\Manager->runJobEntry(Array, G)
#12 job.php(42): XF\Job\Manager->runQueue(false, 8)
#13 {main}

Estado de la solicitud
array(4) {
  ["url"] => string(13) "/foro/job.php"
  ["referrer"] => string(44) "https://cloudbit.es/foro/index.php?feedback/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
And this:

Code:
ErrorException: [E_NOTICE] Undefined index: extension src/addons/ThemeHouse/ImageOptimizer/ContentHandler/Avatar.php:20
Generado por: Cuenta desconocida 13 Mar 2019 a las 15:10
Seguimiento
#0 src/addons/ThemeHouse/ImageOptimizer/ContentHandler/Avatar.php(20): XF::handlePhpError(8, '[E_NOTICE] Unde...', '/var/www/vhosts...', 20, Array)
#1 src/addons/ThemeHouse/ImageOptimizer/Entity/Status.php(36): ThemeHouse\ImageOptimizer\ContentHandler\Avatar->getFileExtensionForStatus(Object(ThemeHouse\ImageOptimizer\Entity\Status))
#2 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer/ReSmush.php(58): ThemeHouse\ImageOptimizer\Entity\Status->getFileExtension()
#3 src/addons/ThemeHouse/ImageOptimizer/Service/ImageOptimizer/Optimize.php(47): ThemeHouse\ImageOptimizer\ImageOptimizer\ReSmush->optimizeImage(Object(ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize))
#4 src/addons/ThemeHouse/ImageOptimizer/ContentHandler/AbstractHandler.php(57): ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize->run()
#5 src/addons/ThemeHouse/ImageOptimizer/Cron/Optimize.php(18): ThemeHouse\ImageOptimizer\ContentHandler\AbstractHandler->optimize(Object(ThemeHouse\ImageOptimizer\Entity\Status))
#6 [internal function]: ThemeHouse\ImageOptimizer\Cron\Optimize::optimizeImages(Object(XF\Entity\CronEntry))
#7 src/XF/Job/Cron.php(35): call_user_func(Array, Object(XF\Entity\CronEntry))
#8 src/XF/Job/Manager.php(253): XF\Job\Cron->run(G)
#9 src/XF/Job/Manager.php(195): XF\Job\Manager->runJobInternal(Array, G)
#10 src/XF/Job/Manager.php(79): XF\Job\Manager->runJobEntry(Array, G)
#11 job.php(42): XF\Job\Manager->runQueue(false, 8)
#12 {main}


Estado de la solicitud
array(4) {
  ["url"] => string(13) "/foro/job.php"
  ["referrer"] => string(44) "https://cloudbit.es/foro/index.php?feedback/"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
Code:
ErrorException: [Image Optimizer] Error received from reSmush for status ID 2253: Unauthorized extension. Allowed are : JPG, PNG, GIF, BMP, TIFF src/XF/Error.php:75
Generado por: Cuenta desconocida 13 Mar 2019 a las 14:10
Seguimiento
#0 src/XF.php(187): XF\Error->logError('[Image Optimize...', false)
#1 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer/ReSmush.php(92): XF::logError('[Image Optimize...')
#2 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer/ReSmush.php(77): ThemeHouse\ImageOptimizer\ImageOptimizer\ReSmush->reSmushFailedResponse(Object(ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize), '[Image Optimize...', true)
#3 src/addons/ThemeHouse/ImageOptimizer/Service/ImageOptimizer/Optimize.php(47): ThemeHouse\ImageOptimizer\ImageOptimizer\ReSmush->optimizeImage(Object(ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize))
#4 src/addons/ThemeHouse/ImageOptimizer/ContentHandler/AbstractHandler.php(57): ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize->run()
#5 src/addons/ThemeHouse/ImageOptimizer/Cron/Optimize.php(18): ThemeHouse\ImageOptimizer\ContentHandler\AbstractHandler->optimize(Object(ThemeHouse\ImageOptimizer\Entity\Status))
#6 [internal function]: ThemeHouse\ImageOptimizer\Cron\Optimize::optimizeImages(Object(XF\Entity\CronEntry))
#7 src/XF/Job/Cron.php(35): call_user_func(Array, Object(XF\Entity\CronEntry))
#8 src/XF/Job/Manager.php(253): XF\Job\Cron->run(G)
#9 src/XF/Job/Manager.php(195): XF\Job\Manager->runJobInternal(Array, G)
#10 src/XF/Job/Manager.php(79): XF\Job\Manager->runJobEntry(Array, G)
#11 job.php(42): XF\Job\Manager->runQueue(false, 8)
#12 {main}
Estado de la solicitud
array(4) {
  ["url"] => string(13) "/foro/job.php"
  ["referrer"] => string(34) "https://cloudbit.es/foro/index.php"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}
Are you running the latest version? I believe both of these were patched already
 

dethfire

Well-known member
Anything interesting here?

Code:
ErrorException: [Image Optimizer] Error received from Kraken for status ID 327: cURL Error: getaddrinfo() thread failed to start
src/XF/Error.php:75
Generated by: xxx
Mar 29, 2019 at 9:01 AM
Stack trace

#0 src/XF.php(187): XF\Error->logError('[Image Optimize...', false)

#1 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer/Kraken.php(99): XF::logError('[Image Optimize...')

#2 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer/Kraken.php(82): ThemeHouse\ImageOptimizer\ImageOptimizer\Kraken->krakenFailedResponse(Object(ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize), '[Image Optimize...', true)

#3 src/addons/ThemeHouse/ImageOptimizer/Service/ImageOptimizer/Optimize.php(47): ThemeHouse\ImageOptimizer\ImageOptimizer\Kraken->optimizeImage(Object(ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize))

#4 src/addons/ThemeHouse/ImageOptimizer/ContentHandler/AbstractHandler.php(57): ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize->run()

#5 src/addons/ThemeHouse/ImageOptimizer/ContentHandler/AbstractHandler.php(160): ThemeHouse\ImageOptimizer\ContentHandler\AbstractHandler->optimize(Object(ThemeHouse\ImageOptimizer\Entity\Status))

#6 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer.php(105): ThemeHouse\ImageOptimizer\ContentHandler\AbstractHandler->createStatusAndOptimize(Object(ThemeHouse\ImageOptimizer\XF\Entity\AttachmentData))

#7 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer.php(36): ThemeHouse\ImageOptimizer\ImageOptimizer->optimizeEntity('attachment', Object(ThemeHouse\ImageOptimizer\XF\Entity\AttachmentData))

#8 src/addons/ThemeHouse/ImageOptimizer/XF/Service/Attachment/Preparer.php(15): ThemeHouse\ImageOptimizer\ImageOptimizer::eek:ptimize('attachment', Object(ThemeHouse\ImageOptimizer\XF\Entity\AttachmentData))

#9 src/XF/Service/Attachment/Preparer.php(23): ThemeHouse\ImageOptimizer\XF\Service\Attachment\Preparer->insertDataFromFile(Object(XF\FileWrapper), 635255, Array)

#10 src/addons/Andy/ConvertImage/Listener.php(391): XF\Service\Attachment\Preparer->insertAttachment(Object(XF\Attachment\Post), Object(XF\FileWrapper), Object(SV\ReportImprovements\XF\Entity\User), 'c14554c49ed605d...')

#11 [internal function]: Andy\ConvertImage\Listener::threadEntityPostSave(Object(SV\ReportImprovements\XF\Entity\Post))

#12 src/XF/Extension.php(50): call_user_func_array(Array, Array)

#13 src/XF.php(721): XF\Extension->fire('entity_post_sav...', Array, 'XF\\Entity\\Post')

#14 src/XF/Mvc/Entity/Entity.php(1214): XF::fire('entity_post_sav...', Array, 'XF\\Entity\\Post')

#15 src/XF/Mvc/Entity/Entity.php(1202): XF\Mvc\Entity\Entity->save(true, false)

#16 src/XF/Service/Thread/Creator.php(285): XF\Mvc\Entity\Entity->save(true, false)

#17 src/addons/SV/ReportCentreEssentials/XF/Service/Thread/Creator.php(19): XF\Service\Thread\Creator->_save()

#18 src/XF/Service/ValidateAndSavableTrait.php(40): SV\ReportCentreEssentials\XF\Service\Thread\Creator->_save()

#19 src/XF/Pub/Controller/Forum.php(750): XF\Service\Thread\Creator->save()

#20 src/addons/SV/ElasticSearchEssentials/XF/Pub/Controller/Forum.php(54): XF\Pub\Controller\Forum->actionPostThread(Object(XF\Mvc\ParameterBag))

#21 src/XF/Mvc/Dispatcher.php(321): SV\ElasticSearchEssentials\XF\Pub\Controller\Forum->actionPostThread(Object(XF\Mvc\ParameterBag))

#22 src/XF/Mvc/Dispatcher.php(244): XF\Mvc\Dispatcher->dispatchClass('XF:Forum', 'PostThread', Object(XF\Mvc\RouteMatch), Object(SV\ElasticSearchEssentials\XF\Pub\Controller\Forum), NULL)

#23 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\ElasticSearchEssentials\XF\Pub\Controller\Forum), NULL)

#24 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))

#25 src/XF/App.php(2177): XF\Mvc\Dispatcher->run()

#26 src/XF.php(390): XF\App->run()

#27 index.php(20): XF::runApp('XF\\Pub\\App')

#28 {main}

Request state

array(4) {

  ["url"] => string(53) "/forums/introductory-physics-homework.153/post-thread"

  ["referrer"] => string(82) "xxx/forums/introductory-physics-homework.153/post-thread"

  ["_GET"] => array(0) {

  }

  ["_POST"] => array(14) {

    ["title"] => string(49) "Find the position of a proton in a E and B field."

    ["custom_fields"] => array(2) {

      ["problemstatement"] => string(14) "(See Attempt)."

      ["equations"] => string(14) "(See Attempt)."

    }

    ["message_html"] => string(1179) "xxx<img src="[MEDIA=imgur]OQ5oJRa[/MEDIA]" style="width: auto;" class="fr-fic fr-dii">xxx<img src="[MEDIA=imgur]dJx7Hx3[/MEDIA]" style="width: auto;" class="fr-fic fr-dii">xxx"

    ["attachment_hash"] => string(32) "51378c31399a4ef79988181791bedc6f"

    ["attachment_hash_combined"] => string(83) "{"type":"post","context":{"node_id":153},"hash":"51378c31399a4ef79988181791bedc6f"}"

    ["tokens_select"] => string(8) "position"

    ["tags"] => string(49) "magnetic field, proton, velocity, helix, position"

    ["watch_thread"] => string(1) "1"

    ["watch_thread_email"] => string(1) "1"

    ["_xfSet"] => array(1) {

      ["watch_thread"] => string(1) "1"

    }

    ["_xfToken"] => string(8) "****"

    ["_xfRequestUri"] => string(53) "/forums/introductory-physics-homework.153/post-thread"

    ["_xfWithData"] => string(1) "1"

    ["_xfResponseType"] => string(4) "json"

  }

}
 

Iggy

Active member
hello,
i was wondering....about the jpegoptim settings, what exactly does it mean the "maximum quality" ....isnt it supposed to be pretty exact? seems like if you run the commands from cli they use the exact # you apply so wasnt sure how this works....

like with the pngquant too it has the minimum and maximum settings....i just cant imagine how it could be random flux result?
 

Jake B.

Well-known member
Anything interesting here?

Code:
ErrorException: [Image Optimizer] Error received from Kraken for status ID 327: cURL Error: getaddrinfo() thread failed to start
src/XF/Error.php:75
Generated by: xxx
Mar 29, 2019 at 9:01 AM
Stack trace

#0 src/XF.php(187): XF\Error->logError('[Image Optimize...', false)

#1 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer/Kraken.php(99): XF::logError('[Image Optimize...')

#2 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer/Kraken.php(82): ThemeHouse\ImageOptimizer\ImageOptimizer\Kraken->krakenFailedResponse(Object(ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize), '[Image Optimize...', true)

#3 src/addons/ThemeHouse/ImageOptimizer/Service/ImageOptimizer/Optimize.php(47): ThemeHouse\ImageOptimizer\ImageOptimizer\Kraken->optimizeImage(Object(ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize))

#4 src/addons/ThemeHouse/ImageOptimizer/ContentHandler/AbstractHandler.php(57): ThemeHouse\ImageOptimizer\Service\ImageOptimizer\Optimize->run()

#5 src/addons/ThemeHouse/ImageOptimizer/ContentHandler/AbstractHandler.php(160): ThemeHouse\ImageOptimizer\ContentHandler\AbstractHandler->optimize(Object(ThemeHouse\ImageOptimizer\Entity\Status))

#6 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer.php(105): ThemeHouse\ImageOptimizer\ContentHandler\AbstractHandler->createStatusAndOptimize(Object(ThemeHouse\ImageOptimizer\XF\Entity\AttachmentData))

#7 src/addons/ThemeHouse/ImageOptimizer/ImageOptimizer.php(36): ThemeHouse\ImageOptimizer\ImageOptimizer->optimizeEntity('attachment', Object(ThemeHouse\ImageOptimizer\XF\Entity\AttachmentData))

#8 src/addons/ThemeHouse/ImageOptimizer/XF/Service/Attachment/Preparer.php(15): ThemeHouse\ImageOptimizer\ImageOptimizer::eek:ptimize('attachment', Object(ThemeHouse\ImageOptimizer\XF\Entity\AttachmentData))

#9 src/XF/Service/Attachment/Preparer.php(23): ThemeHouse\ImageOptimizer\XF\Service\Attachment\Preparer->insertDataFromFile(Object(XF\FileWrapper), 635255, Array)

#10 src/addons/Andy/ConvertImage/Listener.php(391): XF\Service\Attachment\Preparer->insertAttachment(Object(XF\Attachment\Post), Object(XF\FileWrapper), Object(SV\ReportImprovements\XF\Entity\User), 'c14554c49ed605d...')

#11 [internal function]: Andy\ConvertImage\Listener::threadEntityPostSave(Object(SV\ReportImprovements\XF\Entity\Post))

#12 src/XF/Extension.php(50): call_user_func_array(Array, Array)

#13 src/XF.php(721): XF\Extension->fire('entity_post_sav...', Array, 'XF\\Entity\\Post')

#14 src/XF/Mvc/Entity/Entity.php(1214): XF::fire('entity_post_sav...', Array, 'XF\\Entity\\Post')

#15 src/XF/Mvc/Entity/Entity.php(1202): XF\Mvc\Entity\Entity->save(true, false)

#16 src/XF/Service/Thread/Creator.php(285): XF\Mvc\Entity\Entity->save(true, false)

#17 src/addons/SV/ReportCentreEssentials/XF/Service/Thread/Creator.php(19): XF\Service\Thread\Creator->_save()

#18 src/XF/Service/ValidateAndSavableTrait.php(40): SV\ReportCentreEssentials\XF\Service\Thread\Creator->_save()

#19 src/XF/Pub/Controller/Forum.php(750): XF\Service\Thread\Creator->save()

#20 src/addons/SV/ElasticSearchEssentials/XF/Pub/Controller/Forum.php(54): XF\Pub\Controller\Forum->actionPostThread(Object(XF\Mvc\ParameterBag))

#21 src/XF/Mvc/Dispatcher.php(321): SV\ElasticSearchEssentials\XF\Pub\Controller\Forum->actionPostThread(Object(XF\Mvc\ParameterBag))

#22 src/XF/Mvc/Dispatcher.php(244): XF\Mvc\Dispatcher->dispatchClass('XF:Forum', 'PostThread', Object(XF\Mvc\RouteMatch), Object(SV\ElasticSearchEssentials\XF\Pub\Controller\Forum), NULL)

#23 src/XF/Mvc/Dispatcher.php(100): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(SV\ElasticSearchEssentials\XF\Pub\Controller\Forum), NULL)

#24 src/XF/Mvc/Dispatcher.php(50): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))

#25 src/XF/App.php(2177): XF\Mvc\Dispatcher->run()

#26 src/XF.php(390): XF\App->run()

#27 index.php(20): XF::runApp('XF\\Pub\\App')

#28 {main}

Request state

array(4) {

  ["url"] => string(53) "/forums/introductory-physics-homework.153/post-thread"

  ["referrer"] => string(82) "xxx/forums/introductory-physics-homework.153/post-thread"

  ["_GET"] => array(0) {

  }

  ["_POST"] => array(14) {

    ["title"] => string(49) "Find the position of a proton in a E and B field."

    ["custom_fields"] => array(2) {

      ["problemstatement"] => string(14) "(See Attempt)."

      ["equations"] => string(14) "(See Attempt)."

    }

    ["message_html"] => string(1179) "xxx<img src="[MEDIA=imgur]OQ5oJRa[/MEDIA]" style="width: auto;" class="fr-fic fr-dii">xxx<img src="[MEDIA=imgur]dJx7Hx3[/MEDIA]" style="width: auto;" class="fr-fic fr-dii">xxx"

    ["attachment_hash"] => string(32) "51378c31399a4ef79988181791bedc6f"

    ["attachment_hash_combined"] => string(83) "{"type":"post","context":{"node_id":153},"hash":"51378c31399a4ef79988181791bedc6f"}"

    ["tokens_select"] => string(8) "position"

    ["tags"] => string(49) "magnetic field, proton, velocity, helix, position"

    ["watch_thread"] => string(1) "1"

    ["watch_thread_email"] => string(1) "1"

    ["_xfSet"] => array(1) {

      ["watch_thread"] => string(1) "1"

    }

    ["_xfToken"] => string(8) "****"

    ["_xfRequestUri"] => string(53) "/forums/introductory-physics-homework.153/post-thread"

    ["_xfWithData"] => string(1) "1"

    ["_xfResponseType"] => string(4) "json"

  }

}
That just looks like a connection error between your server and Kraken

hello,
i was wondering....about the jpegoptim settings, what exactly does it mean the "maximum quality" ....isnt it supposed to be pretty exact? seems like if you run the commands from cli they use the exact # you apply so wasnt sure how this works....

like with the pngquant too it has the minimum and maximum settings....i just cant imagine how it could be random flux result?
You can find information about jpegoptim's options here and pngquant's options here
 

JoyFreak

Formerly Zuse
Hey guys, I have this add-on installed for the very first time today.
I have chosen to install and enable the two free providers:
pngquant and jpegoptim

I run the cron entry but I do not see anything in the "Status queue"? Does that mean the installation did not work?
 

Jake B.

Well-known member

doublespaces

Well-known member
Is there any plan to support WebP, Jpeg2000 or Jpeg XR? Google page insights is using these next gen formats in their scoring model and detecting the browser and displaying the correct image would get me using this add-on again.
 

Dalton Prock

Well-known member
Is there any plan to support WebP, Jpeg2000 or Jpeg XR? Google page insights is using these next gen formats in their scoring model and detecting the browser and displaying the correct image would get me using this add-on again.
No plans to offer this within Image Optimizer as to achieve the above we'd have to create a separate add-on to offer support for WebP and such.
 
Top