My old buddy, smush.it ! 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 (<1M) 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. Smush.it 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 Smush.it 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.License
This modification is released under a MPL V1.1 license, a copy of it with its provisions is included with the package.Features
- Ability to run Smush.it on all current attachments in a batch mode (based on attachment age/size)
- Admin->Forum->Attachments & Avatars->File Maintenance
- Ability to selectively run Smush.it on asingle or a selection of attachments
- Admin->Forum->Attachments & Avatars->Browse->Smush.it
- Run as a scheduled task to Smush.it attachments added in the last xhrs
- Admin->Maintenance->Scheduled Tasks
- The's Smush.it service will not accept files >1M 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 Smush.it 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)
- Smush.it returned the following error: Failed to create a temp dir: This means what it says, e.g. Smush.it is unavailable at the current time, all you can do is try again later
- I ran Smush.it 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 Sumsh.it all attachments larger than)
Simply install the package to install this addon.Repo / Download
Any chances to support Kraken.io soon?
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
Yes, you'd probably need a key for that.
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: https://wordpress.org/plugins/ewww-image-optimizer/ so we don't need to be depending on 3rd party.
There is also an addon availble to esize the images http://www.elkarte.net/community/index.php?topic=1372.0
, but it's not exactly what i need. :)
I think I found 1 to 1 replacement: http://resmush.it/ they claim 100% compatible with Yahoo Smush It API. Can you take a look @Spuds
I had updated the addon, looks like 6 months ago, to use the service from wpmudev.org 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.
Thanks! I installed Resize attached images addon too.
I wonder why I did not installed this since the first day of my forum. I use the addon Attachment Image Resize (http://addons.elkarte.net/2015/12/Attachment-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
(https://www.elkarte.net/community/imagecache.php?image=http%3A%2F%2Fi.imgur.com%2FCjGzb15.png&hash=3a4e50bb22d1639b3b8be39a660d7db3" rel="cached" data-warn="External image, click here to view original" data-url="http://i.imgur.com/CjGzb15.png)
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.
After a quick test seems to work fine on 1.1 RC2 ;)
Updated package to support ElkArte 1.1
I noticed a few errors in elkarte log:
Exception: Call to undefined function getAttachmentFilename()
I'd say probably due to 1.1.3 ... I'll need to make an update to fix.
ETA. Nope, just looks like an old error Hummmm
This should fix it, https://github.com/Spuds/Elk-Smush.it/commit/5e719c723ec4fb8fa6f42e6f85aad4c17a6e0e45#diff-f921fd1c0a3dc59b032157ef3f5c0947
Thanks for the quick fix, I just installed the 0.0.5 version and seems to work fine ;)