ElkArte Community

Extending Elk => Addons => Topic started by: Spuds on June 08, 2014, 04:39:31 pm

Title: [ADDON] Smush.it
Post by: Spuds on June 08, 2014, 04:39:31 pm
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 (<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.


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
Important Notes

Installation
Simply install the package to install this addon.

Repo / Download
https://addons.elkarte.net/utility/Smushit.html
Title: Re: [ADDON] Smush.it
Post by: forumsearch0r2 on July 17, 2014, 09:49:05 am
Any chances to support Kraken.io soon?
Title: Re: [ADDON] Smush.it
Post by: Spuds on July 17, 2014, 10:33:23 am
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
Title: Re: [ADDON] Smush.it
Post by: forumsearch0r2 on September 09, 2014, 04:57:58 pm
Yes, you'd probably need a key for that.
Title: Re: [ADDON] Smush.it
Post by: kucing on November 11, 2015, 08:45:08 pm
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!
Title: Re: [ADDON] Smush.it
Post by: radu81 on November 12, 2015, 02:16:02 am
There is also an addon availble to esize the images http://www.elkarte.net/community/index.php?topic=1372.0
Title: Re: [ADDON] Smush.it
Post by: kucing on November 12, 2015, 07:10:58 am
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!
Title: Re: [ADDON] Smush.it
Post by: Spuds on November 12, 2015, 08:52:10 am
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.
Title: Re: [ADDON] Smush.it
Post by: kucing on November 14, 2015, 08:39:36 am
Thanks! I installed Resize attached images addon too.
Title: Re: [ADDON] Smush.it
Post by: radu81 on January 27, 2016, 04:37:53 pm
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
(http://i.imgur.com/CjGzb15.png)
Title: Re: [ADDON] Smush.it
Post by: Spuds on January 27, 2016, 06:32:30 pm
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.
Title: Re: [ADDON] Smush.it
Post by: radu81 on September 16, 2017, 07:16:02 pm
After a quick test seems to work fine on 1.1 RC2 ;)
Title: Re: [ADDON] Smush.it
Post by: Spuds on September 16, 2017, 10:11:06 pm
Cool  8)
Title: Re: [ADDON] Smush.it
Post by: Spuds on November 26, 2017, 05:29:19 pm
Updated package to support ElkArte 1.1
Title: Re: [ADDON] Smush.it
Post by: radu81 on May 21, 2018, 03:44:49 am
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
Title: Re: [ADDON] Smush.it
Post by: Spuds on May 21, 2018, 08:35:56 am
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
Title: Re: [ADDON] Smush.it
Post by: radu81 on May 21, 2018, 09:43:45 am
Thanks for the quick fix, I just installed the 0.0.5 version and seems to work fine ;)
Title: Re: [ADDON] Smush.it
Post by: vbgamer45 on February 08, 2021, 12:28:58 pm
There are a couple create_function calls in the addon which will trigger error logs in PHP 7.4+
Title: Re: [ADDON] Smush.it
Post by: Spuds on February 08, 2021, 01:54:47 pm
Quote from: vbgamer45 – There are a couple create_function calls in the addon which will trigger error logs in PHP 7.4+
Thanks (I think lol)  I need to go through my addons as I'm sure there are changes needed in several of them :'(
Title: Re: [ADDON] Smush.it
Post by: vbgamer45 on February 08, 2021, 02:45:59 pm
Yeah., i know I had to do that the other day. Thought about doing a pull request with git I am just low when it comes to git when submitting to other peoples projects.
Title: Re: [ADDON] Smush.it
Post by: Spuds on November 06, 2022, 01:29:51 pm
Well it only took a year, but I finally updated this so it works on PHP 7.4+  I think it was just those pesky create function calls.  So here is release version 0.6

To get the addon you can do one of two things: