Skip to main content
Topic: [ADDON] Smush.it (Read 2517 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

[ADDON] Smush.it

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.


Smush.it!


Introduction
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
Important Notes
  • 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)

Installation
Simply install the package to install this addon.

Repo / Download
http://addons.elkarte.net/utility/Smushit.html
Squish squish. squish, squish, squish.
Find a bug,
Make a wish.

Re: [ADDON] Smush.it

Reply #1
Any chances to support Kraken.io soon?

Re: [ADDON] Smush.it

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
Squish squish. squish, squish, squish.
Find a bug,
Make a wish.

Re: [ADDON] Smush.it

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

Re: [ADDON] Smush.it

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: https://wordpress.org/plugins/ewww-image-optimizer/ so we don't need to be depending on 3rd party.

thanks!


Re: [ADDON] Smush.it

Reply #6
Thanks @radu81 , 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

Thanks!

Re: [ADDON] Smush.it

Reply #7
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.
Squish squish. squish, squish, squish.
Find a bug,
Make a wish.

Re: [ADDON] Smush.it

Reply #8
Thanks! I installed Resize attached images addon too.

Re: [ADDON] Smush.it

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

Re: [ADDON] Smush.it

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.
Squish squish. squish, squish, squish.
Find a bug,
Make a wish.

Re: [ADDON] Smush.it

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

Re: [ADDON] Smush.it

Reply #12
Cool  8)
Squish squish. squish, squish, squish.
Find a bug,
Make a wish.

Re: [ADDON] Smush.it

Reply #13
Updated package to support ElkArte 1.1
Squish squish. squish, squish, squish.
Find a bug,
Make a wish.

Re: [ADDON] Smush.it

Reply #14
I noticed a few errors in elkarte log:
Exception: Call to undefined function getAttachmentFilename()
/index.php?action=topic;sa=printpage;topic=6122.0
File: /public/sources/subs/smushit.subs.php
Line: 458
sorry for my bad english