New Module: Image Compressor

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Foaly*
Translator
Translator
Posts: 150
Joined: Sun Mar 29, 2009 3:32 pm
Location: London

New Module: Image Compressor

Post by Foaly* »

Hey,

I've developed a new module called Image Compressor. It helps you to compress all images uploaded to CMSms via Image manager without loss of quality to improve website performance. It uses the API Service of Yahoo's Smush.it. No registration needed!
Last edited by Foaly* on Sat Feb 12, 2011 5:21 pm, edited 1 time in total.
User avatar
M@rtijn
Power Poster
Power Poster
Posts: 706
Joined: Sat Nov 14, 2009 4:54 pm
Location: the Netherlands

Re: New Module: Image Compressor

Post by M@rtijn »

Sounds good, will check this out!
Make your community a better place!
Foaly*
Translator
Translator
Posts: 150
Joined: Sun Mar 29, 2009 3:32 pm
Location: London

Re: New Module: Image Compressor

Post by Foaly* »

Don't hesitate to post bugs and feature requests :)
swgreed

Re: New Module: Image Compressor

Post by swgreed »

Great module, thanks for sharing.

However, I guess the API-URL should change from

Code: Select all

define('SMUSHIT_API_URL', 'http://www.smushit.com/ysmush.it/ws.php?img=%s');
to

Code: Select all

define('SMUSHIT_API_URL', 'http://ws1.adq.ac4.yahoo.com/ysmush.it/ws.php?img=%s');
With the latter the module works like a charm, where as it just gives an "invalid URL" error on the first API_URL.

There is also one error in the module:
it can't handle images with blanks in the name.

Best Regards
Foaly*
Translator
Translator
Posts: 150
Joined: Sun Mar 29, 2009 3:32 pm
Location: London

Re: New Module: Image Compressor

Post by Foaly* »

Hey swgreed,

I changed the API URL, altough the first one works fine for me, because the latter also works fine.

Unfortunately both URLs can't handle spaces or umlauts even if they're encoded (spaces as %20 or +). So I added a warning instead.

Fixes are in git.

Thanks, Foaly*
swgreed

Re: New Module: Image Compressor

Post by swgreed »

Hi Foaly,

works great! ;D

However I gotone last feature request:
make the image names clickable or do an image preview. That would enhance the comfort deciding to optimize the image or not.
Foaly*
Translator
Translator
Posts: 150
Joined: Sun Mar 29, 2009 3:32 pm
Location: London

Re: New Module: Image Compressor

Post by Foaly* »

Hey swgreed,

already thought of adding it before the next commit.
swgreed wrote:That would enhance the comfort deciding to optimize the image or not.
Why wouldn't you optimize an image when it's lossless?
swgreed

Re: New Module: Image Compressor

Post by swgreed »

1:0 for you ;)
Foaly*
Translator
Translator
Posts: 150
Joined: Sun Mar 29, 2009 3:32 pm
Location: London

Re: New Module: Image Compressor

Post by Foaly* »

Prototype version of my javascript doesn't work in Firefox, curious. I don't manage to do away with the issue.
RichardS
New Member
New Member
Posts: 2
Joined: Fri May 06, 2011 11:07 pm

Re: New Module: Image Compressor

Post by RichardS »

Can anybody please help me with a problem

I have just installed CMSMS on my PC using winamp, which worked fine.

When trying to run image compressor and clicking on the check all link, I get the following error

Code: Select all

Notice: Undefined property: stdClass::$dest_size in C:\wamp\www\cmsms\modules\ImageCompressor\ImageCompressor.module.php on line 108

Notice: Undefined property: stdClass::$percent in C:\wamp\www\cmsms\modules\ImageCompressor\ImageCompressor.module.php on line 108
Does anybody have any ideas, google gives me nothing.

Thanks in advance

Richard
Foaly*
Translator
Translator
Posts: 150
Joined: Sun Mar 29, 2009 3:32 pm
Location: London

Re: New Module: Image Compressor

Post by Foaly* »

hi richard,

if you run it from your local computer, it can't work. imagecompressor uses yahoos service smushit to compress images.

i'll have to implement a better error handling.
RichardS
New Member
New Member
Posts: 2
Joined: Fri May 06, 2011 11:07 pm

Re: New Module: Image Compressor

Post by RichardS »

Thanks Foaly

Will just have to use it on the live server once everything is online

thanks for the reply

Richard
Foaly*
Translator
Translator
Posts: 150
Joined: Sun Mar 29, 2009 3:32 pm
Location: London

Re: New Module: Image Compressor

Post by Foaly* »

Sorry for my late reply.

I've just installed the module in to 1.9.4.2. Works fine. If there are no images I get a "No images found". Maybe I can have a look on your installation if the problem persists?
cleatus
Forum Members
Forum Members
Posts: 27
Joined: Mon Jul 18, 2011 4:36 pm

Re: New Module: Image Compressor

Post by cleatus »

i'm getting "ajax error" in admin panel when trying to compress. it can check savings correctly but cannot compress. not seeing any errors in logs. what should permissions be for image file? any thing else i should verify?
thanks
Foaly*
Translator
Translator
Posts: 150
Joined: Sun Mar 29, 2009 3:32 pm
Location: London

Re: New Module: Image Compressor

Post by Foaly* »

hey cleatus,

are you using an old browser? file perms are checked by the module...

cheers,
Foaly*
Locked

Return to “Modules/Add-Ons”