[tl] Image Optimizer for XF 2.x

[tl] Image Optimizer for XF 2.x [Paid] 2.0.2

No permission to buy ($29.00)

mazdas247

Member
If I strip exif data, will this remove image orientation too? We'd like to strip exif data to remove geolocation and such, but if that also removes orientation, then that is a problem (some phones take pictures as per the sensor native orientation and then just mark the image to be rotated through an attribute in the JPEG, I assume that is exif).
 

Pol57

Member
Resizing

I've seen this asked several times but not answered clearly.

Can someone explain what do these actaully do? I don't want anything cropped or the aspect ratio changed. The images are already resized by xenforo to the "Maximum attachment image dimensions" I'm looking for these images to be compressed without any croping or streatching.

It's unclear if i need option 1 or 3 (or what the difference between either is?), attachment thumbnails are cropped and centered so the (like: attachment thumnail) is a tad confusing.

1590921188820.png

I've seen it asked a bit but the answers make it even less clear:
1590921738486.png
 
Last edited:

HJW

Active member
@truonglv I think it would be good to have an option to convert all png files to jpegs. This is what many image optimisation tools do and I think it's very beneficial as phones take screen shots as a png and in most cases would be better as a jpg.

What do you think?
 

HJW

Active member
What benefit for that?
Because people are always uploading a screenshots from a phone that is a huge png. Usually it's not text and high colour so shouldn't be a PNG.

This plugin optimises it and does reduce the quality significantly to turn a 800kb png to 300kb but if it was a jpg it could be 80kb without a big drop in quality.

Wouldn't it be a quick thing to just ad an option to convert all png to jpg?
 

trapped_soul

Well-known member
What benefit for that?

What errors?
Code:
    League\Flysystem\FileNotFoundException: [tl] Image Optimizer: File not found at path: attachments/72/72145-c3a79d0a527e2e2da760afe617ecb95f.jpg src/vendor/league/flysystem/src/Filesystem.php:389

    Generated by: Unknown account 11 June 2020 at 11:30

Stack trace

#0 src/vendor/league/flysystem/src/Filesystem.php(194): League\Flysystem\Filesystem->assertPresent('attachments/72/...')
#1 [internal function]: League\Flysystem\Filesystem->readStream('attachments/72/...', Array)
#2 src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php(431): call_user_func_array('parent::readStr...', Array)
#3 src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php(395): League\Flysystem\EventableFilesystem\EventableFilesystem->callFilesystemMethod('readStream', Array)
#4 src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php(154): League\Flysystem\EventableFilesystem\EventableFilesystem->delegateMethodCall('readStream', Array)
#5 src/vendor/league/flysystem/src/MountManager.php(343): League\Flysystem\EventableFilesystem\EventableFilesystem->readStream('attachments/72/...')
#6 src/XF/Util/File.php(175): League\Flysystem\MountManager->readStream('attachments/72/...')
#7 src/addons/Truonglv/ImageOptimizer/ContentData/AttachmentData.php(61): XF\Util\File::copyAbstractedPathToTempFile('data://attachme...')
#8 src/addons/Truonglv/ImageOptimizer/Job/Optimizer.php(112): Truonglv\ImageOptimizer\ContentData\AttachmentData->onSuccess(Object(SV\AttachmentImprovements\XF\Entity\AttachmentData), Array)
#9 src/addons/Truonglv/ImageOptimizer/Job/Optimizer.php(52): Truonglv\ImageOptimizer\Job\Optimizer->processImages(Array, 'attachment_data', Object(XF\Timer), 72145)
#10 src/XF/Job/Manager.php(253): Truonglv\ImageOptimizer\Job\Optimizer->run(G)
#11 src/XF/Job/Manager.php(195): XF\Job\Manager->runJobInternal(Array, G)
#12 src/XF/Job/Manager.php(79): XF\Job\Manager->runJobEntry(Array, G)
#13 job.php(42): XF\Job\Manager->runQueue(false, 8)
#14 {main}

Request state

array(4) {
  ["url"] => string(8) "/job.php"
  ["referrer"] => string(59) "***conversations/pics.700066/page-3"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}

These my friend, loads daily..
Amy idea?
 

truonglv

Well-known member
Code:
    League\Flysystem\FileNotFoundException: [tl] Image Optimizer: File not found at path: attachments/72/72145-c3a79d0a527e2e2da760afe617ecb95f.jpg src/vendor/league/flysystem/src/Filesystem.php:389

    Generated by: Unknown account 11 June 2020 at 11:30

Stack trace

#0 src/vendor/league/flysystem/src/Filesystem.php(194): League\Flysystem\Filesystem->assertPresent('attachments/72/...')
#1 [internal function]: League\Flysystem\Filesystem->readStream('attachments/72/...', Array)
#2 src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php(431): call_user_func_array('parent::readStr...', Array)
#3 src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php(395): League\Flysystem\EventableFilesystem\EventableFilesystem->callFilesystemMethod('readStream', Array)
#4 src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php(154): League\Flysystem\EventableFilesystem\EventableFilesystem->delegateMethodCall('readStream', Array)
#5 src/vendor/league/flysystem/src/MountManager.php(343): League\Flysystem\EventableFilesystem\EventableFilesystem->readStream('attachments/72/...')
#6 src/XF/Util/File.php(175): League\Flysystem\MountManager->readStream('attachments/72/...')
#7 src/addons/Truonglv/ImageOptimizer/ContentData/AttachmentData.php(61): XF\Util\File::copyAbstractedPathToTempFile('data://attachme...')
#8 src/addons/Truonglv/ImageOptimizer/Job/Optimizer.php(112): Truonglv\ImageOptimizer\ContentData\AttachmentData->onSuccess(Object(SV\AttachmentImprovements\XF\Entity\AttachmentData), Array)
#9 src/addons/Truonglv/ImageOptimizer/Job/Optimizer.php(52): Truonglv\ImageOptimizer\Job\Optimizer->processImages(Array, 'attachment_data', Object(XF\Timer), 72145)
#10 src/XF/Job/Manager.php(253): Truonglv\ImageOptimizer\Job\Optimizer->run(G)
#11 src/XF/Job/Manager.php(195): XF\Job\Manager->runJobInternal(Array, G)
#12 src/XF/Job/Manager.php(79): XF\Job\Manager->runJobEntry(Array, G)
#13 job.php(42): XF\Job\Manager->runQueue(false, 8)
#14 {main}

Request state

array(4) {
  ["url"] => string(8) "/job.php"
  ["referrer"] => string(59) "***conversations/pics.700066/page-3"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}

These my friend, loads daily..
Amy idea?
Look like that attachment missing thumbnail file. Just log info then you can resolve it.
 

duderuud

Well-known member
Look like that attachment missing thumbnail file. Just log info then you can resolve it.
I would like to know that too. Getting a lot of these errors nowadays...

Code:
League\Flysystem\FileNotFoundException: [tl] Image Optimizer: File not found at path: attachments/1530/1530009-8569f131d1c54dcfdd63a25c720a6d8d.jpg
src/vendor/league/flysystem/src/Filesystem.php:389
Generated by: Unknown account Aug 4, 2020 at 11:30 PM

Stack trace
      
#0 src/vendor/league/flysystem/src/Filesystem.php(194): League\Flysystem\Filesystem->assertPresent()
#1 [internal function]: League\Flysystem\Filesystem->readStream()
#2 src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php(431): call_user_func_array()
#3 src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php(395): League\Flysystem\EventableFilesystem\EventableFilesystem->callFilesystemMethod()
#4 src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php(154): League\Flysystem\EventableFilesystem\EventableFilesystem->delegateMethodCall()
#5 src/vendor/league/flysystem/src/MountManager.php(343): League\Flysystem\EventableFilesystem\EventableFilesystem->readStream()
#6 src/XF/Util/File.php(175): League\Flysystem\MountManager->readStream()
#7 src/addons/Truonglv/ImageOptimizer/ContentData/AttachmentData.php(61): XF\Util\File::copyAbstractedPathToTempFile()
#8 src/addons/Truonglv/ImageOptimizer/Job/Optimizer.php(112): Truonglv\ImageOptimizer\ContentData\AttachmentData->onSuccess()
#9 src/addons/Truonglv/ImageOptimizer/Job/Optimizer.php(52): Truonglv\ImageOptimizer\Job\Optimizer->processImages()
#10 src/XF/Job/Manager.php(253): Truonglv\ImageOptimizer\Job\Optimizer->run()
#11 src/XF/Job/Manager.php(195): XF\Job\Manager->runJobInternal()
#12 src/XF/Job/Manager.php(79): XF\Job\Manager->runJobEntry()
#13 job.php(42): XF\Job\Manager->runQueue()
#14 {main}

Request state
      
array(4) {
["url"] => string(8) "/job.php"
["referrer"] => string(27) "https://www.domain.tld/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
 

truonglv

Well-known member
I would like to know that too. Getting a lot of these errors nowadays...

Code:
League\Flysystem\FileNotFoundException: [tl] Image Optimizer: File not found at path: attachments/1530/1530009-8569f131d1c54dcfdd63a25c720a6d8d.jpg
src/vendor/league/flysystem/src/Filesystem.php:389
Generated by: Unknown account Aug 4, 2020 at 11:30 PM

Stack trace
     
#0 src/vendor/league/flysystem/src/Filesystem.php(194): League\Flysystem\Filesystem->assertPresent()
#1 [internal function]: League\Flysystem\Filesystem->readStream()
#2 src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php(431): call_user_func_array()
#3 src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php(395): League\Flysystem\EventableFilesystem\EventableFilesystem->callFilesystemMethod()
#4 src/vendor/league/flysystem-eventable-filesystem/src/EventableFilesystem.php(154): League\Flysystem\EventableFilesystem\EventableFilesystem->delegateMethodCall()
#5 src/vendor/league/flysystem/src/MountManager.php(343): League\Flysystem\EventableFilesystem\EventableFilesystem->readStream()
#6 src/XF/Util/File.php(175): League\Flysystem\MountManager->readStream()
#7 src/addons/Truonglv/ImageOptimizer/ContentData/AttachmentData.php(61): XF\Util\File::copyAbstractedPathToTempFile()
#8 src/addons/Truonglv/ImageOptimizer/Job/Optimizer.php(112): Truonglv\ImageOptimizer\ContentData\AttachmentData->onSuccess()
#9 src/addons/Truonglv/ImageOptimizer/Job/Optimizer.php(52): Truonglv\ImageOptimizer\Job\Optimizer->processImages()
#10 src/XF/Job/Manager.php(253): Truonglv\ImageOptimizer\Job\Optimizer->run()
#11 src/XF/Job/Manager.php(195): XF\Job\Manager->runJobInternal()
#12 src/XF/Job/Manager.php(79): XF\Job\Manager->runJobEntry()
#13 job.php(42): XF\Job\Manager->runQueue()
#14 {main}

Request state
     
array(4) {
["url"] => string(8) "/job.php"
["referrer"] => string(27) "https://www.domain.tld/"
["_GET"] => array(0) {
}
["_POST"] => array(0) {
}
}
Getting a stream of daily errors now too and don't know why..
XF save attachment file to 2 paths.
  • A thumbnail path
  • A source path
If you missing one of them then add-on will give above errors. If you missing thumbnails you can rebuild attachments to re-creating that.
 

nrep

Well-known member
I'm getting an error saying "[tl] Image Optimizer: Failed to optimize image." since upgrading to 2.2, is this because I'm still on v1.1.5?
 
Top