how to install 2 lib required for paperclip-smusher? #2

Closed
dieuit07 opened this Issue Feb 27, 2012 · 7 comments

Comments

Projects
None yet
2 participants

Hi , I go to 2 page and download 2 file jpegsrc.v8d.tar.gz , optipng-0.6.5.tar.gz. And what thing must to do then ???
And I wonder if I use this gem in heroku host. Is this support lib for this gem ?
Thanks for your attention

Owner

knightq commented Feb 27, 2012

You simply must insert into your Gemfile the following line:

gem "paperclip-smusher", "~> 0.1.1"

save, and then run (from console) a:

bundle install

All the rest should be done by bundler.

Heroku supports both these two libs (we actually use it on Blomming).

thank you so much. Your gem is very useful :D

dieuit07 closed this Feb 28, 2012

dieuit07 reopened this Feb 28, 2012

Hi knightq , I test upload image to s3 (host heroku) but It seem not smusher my image
my gem in heroku :
....

  • paperclip (2.7.0)
  • paperclip-smusher (0.1.1)
    ....
    In my computer I install gem smusher , and create a folder to test smusher image : home.jpg 22.4 KB (22910 bytes)
    after smusher -> 21.6 KB (22144 bytes).
    But when test upload in s3 is 22.4kb KB.
    Do I miss something??

dieuit07 closed this Feb 28, 2012

dieuit07 reopened this Feb 28, 2012

Owner

knightq commented Feb 28, 2012

The gem works (obviously) on server side: once you've uploaded your full size non.smushed image on your application server (heroku, as you told me), and just before the uploading to S3, it smush the image.

At the end of the whole process, you have the image smushed on your S3 bucket.

You have anyway to pay the payload for the upload from the client to your server, since the cut is done after that.

I agree with you - if I didn't misunderstand you - that it would be far better to perform this kind of compression on the client side, but it would require executing all the compression logic into the client environment - maybe with some javascript or with some other cliet side technology - with all the well-known security walls rised by the web browsers, that usually prevents it to be easly feasable.

Have I answered to you question?

You misunderstand :D
I mean : why the image on s3 (I uploaded for test your gem) , it size not change (it be no smushered)

I install gem "smusher" in my computer, then I run console: smusher path/home.jpg
home.jpg 22.4 KB (22910 bytes) and after smusher by gem "smusher" in my computer -> 21.6 KB (22144 bytes).

Then I test upload home.jpg 22.4 KB (22910 bytes) to s3. And I SAVE it back to check the size , I see it still 22.4 KB
Thank for your attention :D

Owner

knightq commented Feb 28, 2012

Ok,

I suggest you to try with another image.

The lib used to reduce the image size is not exaclty the same used by Yahoo! on its web service.

If you try again with another image (maybe with a larger one) you should see however an image size reduction, isn't it?

Thanks , that works :D

dieuit07 closed this Feb 29, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment