Skip to main content
[ADDON] Started by Spuds · · Read 11262 times 0 Members and 1 Guest are viewing this topic. previous topic - next topic


My old buddy, !  Lossless compression of image files to save disk space and bandwidth.  There are a few things to be aware such as file size limits the site will accept (<2M) and sometimes its general availability (its sometimes down)  Overall however, this can compress attachments 5-20%.  Since the addon needs to be able to move, copy, update attachment files, you may run in to permission issues on your site depending on how you have it set up and what user/group your PHP service is running under ...  thats up to you to fix permission issues.!

This adds the ability to run WPMU DEV WordPress Smush API service on your attachments. uses optimization techniques specific to each image format to remove unnecessary bytes from image files. It is a "lossless" tool, which means it optimizes the images without changing their look or visual quality. Typical savings are in the 5-20% file size reduction.  After runs it will report how many bytes have been saved as well as the percent reduction for each file.  Smaller files save bandwidth, disk space and make your forum faster.

This modification is released under a MPL V1.1 license, a copy of it with its provisions is included with the package.

  • Ability to run on all current attachments in a batch mode (based on attachment age/size)
    • Admin->Forum->Attachments & Avatars->File Maintenance
  • Ability to selectively run on asingle or a selection of attachments
    • Admin->Forum->Attachments & Avatars->Browse->
  • Run as a scheduled task to attachments added in the last xhrs
    • Admin->Maintenance->Scheduled Tasks
Important Notes
  • The service will not accept files >2M in size, as such no size reduction on those files is possible with this addon
  • Unable to copy the attachment file for processing: This means that the smushit directory is not writable, check its permissions and change as needed (no more than 755 if you are running suPHP/suExec (higher permissions will cause a server 500 error) otherwise 766 / 777 may be required depending on how your host is set up)
  • Unable to copy the file back to the attachment directory: This generally indicates that the original attachment file was saved with permissions (or owner/group) that will not allow the forum to replace it.  This can occur if the attachments were FTP-ed to the site or your site changed how PHP is run.  You will need to change the file permissions as needed (664 or 666)
  • returned the following error: Failed to create a temp dir: This means what it says, e.g. is unavailable at the current time, all you can do is try again later
  • I ran and now the file does not show up in the browse list! This means the file was reduced in size below your lower size setting (admin -> configuration -> modification settings -> misc -> Attempt to all attachments larger than)

Simply install the package to install this addon.

Repo / Download
Last Edit: November 06, 2022, 01:31:00 pm by Spuds


Reply #1

Any chances to support soon?


Reply #2

I'll begin working on that now  :D

ETA: bummer, I don't see any free API, they have a web page interface with the same 1M limit as smushit but all the API and keys are charge for
Last Edit: July 17, 2014, 07:53:46 pm by Spuds


Reply #3

Yes, you'd probably need a key for that.


Reply #4

hi, smush it already killed by yahoo. any alternative to optimize images uploaded on Elkarte automatically? maybe another online services that can be integrated to ElkArte.

or standalone plugin like EWWW Image Optimizer for WordPress: so we don't need to be depending on 3rd party.

192.MY.ID: Forum ISP Indonesia.


Reply #6

Thanks @radu81 , but it's not exactly what i need. :)

I think I found 1 to 1 replacement: they claim 100% compatible  with Yahoo Smush It API. Can you take a look @Spuds



Reply #7

I had updated the addon, looks like 6 months ago, to use the service from instead of the defunct yahoo service.  The new service has been much much more reliable as well. 

Looks like I never updated the description of the addon to note the change (that it does not use yahoo)

Anyway if you have an old version, uninstall it and delete it.  Then get the latest from the addon site and install that.  It should work just fine.


Reply #8

Thanks! I installed Resize attached images addon too.
192.MY.ID: Forum ISP Indonesia.


Reply #9

I wonder why I did not installed this since the first day of my forum. I use the addon Attachment Image Resize and both addons are working fine together. It took some hours to resize all my attachments, (about 6000 images), Chrome crashed different times so I started the process more than once. I resized some attachments manually, but in the end I can say I gained about 10% of my attachments size.

Thanks Spuds for this great addon

p.s. you may want to correct this, I think is related to Miserable User addon
sorry for my bad english


Reply #10

Thanks ... good old cut and paste !

Glad that it was able to compress things a bit for you :D I also get about 10% or so on most image files, and its a lossless compression which is nice.


Reply #11

After a quick test seems to work fine on 1.1 RC2 ;)
sorry for my bad english


Reply #12

Cool  8)


Reply #13

Updated package to support ElkArte 1.1


Reply #14

I noticed a few errors in elkarte log:
Exception: Call to undefined function getAttachmentFilename()
File: /public/sources/subs/smushit.subs.php
Line: 458
sorry for my bad english