Page 1 of 2

New Module: Image Compressor

Posted: Sat Feb 12, 2011 5:20 pm
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!

Re: New Module: Image Compressor

Posted: Sat Feb 12, 2011 5:21 pm
by M@rtijn
Sounds good, will check this out!

Re: New Module: Image Compressor

Posted: Sat Feb 12, 2011 5:25 pm
by Foaly*
Don't hesitate to post bugs and feature requests :)

Re: New Module: Image Compressor

Posted: Mon Feb 14, 2011 3:05 pm
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

Re: New Module: Image Compressor

Posted: Tue Feb 15, 2011 4:09 pm
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*

Re: New Module: Image Compressor

Posted: Tue Feb 15, 2011 6:26 pm
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.

Re: New Module: Image Compressor

Posted: Tue Feb 15, 2011 6:44 pm
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?

Re: New Module: Image Compressor

Posted: Tue Feb 15, 2011 6:55 pm
by swgreed
1:0 for you ;)

Re: New Module: Image Compressor

Posted: Sun Feb 20, 2011 3:23 pm
by Foaly*
Prototype version of my javascript doesn't work in Firefox, curious. I don't manage to do away with the issue.

Re: New Module: Image Compressor

Posted: Fri May 06, 2011 11:12 pm
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

Re: New Module: Image Compressor

Posted: Sat May 07, 2011 8:59 am
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.

Re: New Module: Image Compressor

Posted: Tue May 10, 2011 1:06 pm
by RichardS
Thanks Foaly

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

thanks for the reply

Richard

Re: New Module: Image Compressor

Posted: Thu May 26, 2011 7:46 pm
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?

Re: New Module: Image Compressor

Posted: Tue Aug 16, 2011 5:18 am
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

Re: New Module: Image Compressor

Posted: Thu Aug 18, 2011 10:43 am
by Foaly*
hey cleatus,

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

cheers,
Foaly*