GoodForNothing Image Optimizer [Paid] [Deleted]

What are the next features to be added? :)
I am mainly focusing on adding on-site compression for PNG. Along with some few improvements on the process log page and adding support for sonnb's XenGallery. And if I get the time I'll add a CLI app to process the images :)
 
I currently serve all my attachments from Amazon Cloudfront CDN. If the optimized images have the same filename my CDN will still serve the un-optimized versions for a pretty long time. I suppose I could create a new origin and serve my new attachments from that. Has anyone done this?

Apologies if I've missed this above.
 
Last edited:
I'm using [Tinhte] Attach Image Optimization 2.2.11
and have also set my forum's image path to use my cdn in Style Properties > General > Path to Images: _______
 
I just bought this addon for my 5 websites, all of which are photography forums. Very excited to use it.

Is there any advantage to rebuilding old attachments using this addon vs running commands to search for all jpeg files on the server and optimize them in-place using jpegoptim?

My plan was:

1) Install optipng and jpegoptim on server

2) Run the following commands to losslessly optimize PNGs and lossily optimize JPEGs at 90% quality (modified from here: http://seravo.fi/2013/tips-to-optimize-images-for-faster-loading-websites)

Code:
find ./images/ -iname '*.png' -print0 | \
xargs -0 optipng -o7 -preserve

find ./images/ -iname '*.jpg' -print0 | \
xargs -0 jpegoptim --max=90 --preserve --totals

3) Use GoodForNothing Kraken addon to optimize JPEG uploads going forward

Is that a good plan?

Thanks,
Amin
 
Last edited:
Is that a good plan?
It would've if XenForo didn't store the file size for the attachments in the database. So once the images are optimized and the file size is reduced it wont match with the record from the database and the visitors will see a 'image corrupt' message.

So you should use the included rebuilder to rebuild the old attachment. :)
 
It would've if XenForo didn't store the file size for the attachments in the database. So once the images are optimized and the file size is reduced it wont match with the record from the database and the visitors will see a 'image corrupt' message.

So you should use the included rebuilder to rebuild the old attachment. :)

Aha! I wonder if the same is true for Photopost. Maybe I can use the shell commands to reduce image size in Photopost Pro images and then use the included rebuilder for XenForo attachments (including XFMG attachments).
 
I'm getting a lot of these now, but I can process manually through admin

Information
Storage Type: Attachment
Storage Content ID: 63078
Status: Error
Error Message: Unable to process attachment.
Error Information
array(5) {
["error_date"] => int(1425594103)
["error_type"] => string(34) "GFNKraken_StorageHandler_Exception"
["file"] => string(42) "library/GFNKraken/StorageHandler/Trait.php"
["line"] => int(16)
["trace_string"] => string(933) "#0 /home/physicsf/public_html/library/GFNKraken/StorageHandler/Attachment.php(49): GFNKraken_StorageHandler_Abstract->exception(Object(XenForo_Phrase))
#1 /home/physicsf/public_html/library/GFNKraken/Deferred/Compressor.php(68): GFNKraken_StorageHandler_Attachment->process(459774, Array)
#2 /home/physicsf/public_html/library/XenForo/Deferred/Atomic.php(66): GFNKraken_Deferred_Compressor->execute(Array, Array, 7.99991583824, '')
#3 /home/physicsf/public_html/library/XenForo/Model/Deferred.php(294): XenForo_Deferred_Atomic->execute(Array, Array, 7.99999690056, '')
#4 /home/physicsf/public_html/library/XenForo/Model/Deferred.php(428): XenForo_Model_Deferred->runDeferred(Array, 7.99999690056, '', false)
#5 /home/physicsf/public_html/library/XenForo/Model/Deferred.php(373): XenForo_Model_Deferred->_runInternal(Array, NULL, '', false)
#6 /home/physicsf/public_html/deferred.php(23): XenForo_Model_Deferred->run(false)
#7 {main}"
}
 
I'm trying to optimize attachments using jpegoptim and get this error message:

Server Error Log
Error Info
ErrorException: Fatal Error: Call to undefined function exif_read_data() -library/GFNKraken/Helper/Image.php:245
Generated By: Amin Sabet, A moment ago
Stack Trace
#0 [internal function]: XenForo_Application::handleFatalError()
#1 {main}
Request State
array(3) {
["url"] => string(54) "http://www.leicaplace.com/admin.php?tools/run-deferred"
["_GET"] => array(1) {
["tools/run-deferred"] => string(0) ""
}
["_POST"] => array(3) {
["redirect"] => string(35) "http://www.leicaplace.com/admin.php"
["execute"] => string(1) "1"
["_xfToken"] => string(8) "********"
}
}
 
I wonder if the same is true for Photopost.
You'll have to ask that on PP :p

I'm getting a lot of these now, but I can process manually through admin
Okay, now I get it... this is happening because of something like this: The image is queued and a deferred process created but the attachment hasn't been associated with the content type as the user hasn't "saved" the content. And the deferred process is being called by another visitor and thus getting this logged. This is mainly a coding error, I'll have to work around it... :)

True, but avatars are much more time consuming because they can be in so many folders
I am planning to add avatar support on the next version.

I'm trying to optimize attachments using jpegoptim and get this error message:
You'll need the php_exif extension enabled. IIRC this is already bundled with the core PHP.
 
Last edited:
I did the optimize attachments step on 5 sites overnight. 4 of them completed as expected. One of them - the largest one - seems to be stuck at this stage:

stuck.webp

Where the number has stopped progressing beyond 32,022. Should I close the browser window and Rebuild Attachments again?

EDIT: Nevermind, when I went to the admin.php home it was obvious how to resume.
 
Last edited:
Cool... so what's the stats? :D You'll find it in the process log page...

One of them - the largest one - seems to be stuck at this stage:
yeah, it sometimes happen with kraken.io not responding correctly. Might be a cURL issue as I came across something like that when working with my API system...
 
Last edited:
Cool... so what's the stats? :D You'll find it in the process log page...

Where is the process log page?

EDIT: Nevermind, found it

My results on 5 sites, from greatest to least:

Mu-43.com: 14.4GB so far (still running)

PhotographersLounge.org: 3.6GB reduction

TalkEmount.com: 796MB reduction

FujiXspot.com: 351.5MB reduction

LeicaPlace.com: Pending

I did not use Kraken.IO. Only JpegOptim active with max quality set to 90%. Very pleased with the results!
 
Last edited:
Back
Top Bottom