jtescher / carrierwave-imageoptimizer

This gem allows you to simply optimize CarrierWave images via jpegoptim or optipng.
https://rubygems.org/gems/carrierwave-imageoptimizer
MIT License
212 stars 33 forks source link

Ouput logging #5

Closed tscolari closed 10 years ago

tscolari commented 10 years ago

Hello! Is there a way/option to remove the output information every time an optimization is done?

jtescher commented 10 years ago

Good idea. I'll add this real quick.

rahilsondhi commented 10 years ago

Where is the log? I'm testing stuff in rails console and I don't see any stdout in the console or or development.log. I have not turned quiet mode on.

jtescher commented 10 years ago

Do you have jpegoptim or OptiPNG installed?

rahilsondhi commented 10 years ago

Yes both

➜  ~  brew list
apple-gcc42 cscope      jpegoptim   libyaml     pkg-config
autoconf    freetype    libgpg-error    macvim      qt
automake    graphviz    libksba     openssl     readline
autossh     imagemagick libpng      optipng     wget
chromedriver    jpeg        libtool     phantomjs
jtescher commented 10 years ago

It is possible that there is an issue with newer versions. Do you see output if you clone https://github.com/jtescher/carrierwave-imageoptimizer-example and in the console run

user = User.new
user.avatar = File.open('vendor/assets/images/monkey.jpg')

The output I see is:

/github/carrierwave-imageoptimizer-example/public/uploads/tmp/1404930298-43513-1613/monkey.jpg 690x690 24bit N Exiff JFIF  [OK] 30554 --> 25096 bytes (17.86%), optimized.
/github/carrierwave-imageoptimizer-example/public/uploads/tmp/1404930298-43513-1613/thumb_monkey.jpg 690x690 24bit N JFIF  [OK] 24402 --> 25095 bytes (-2.84%), optimized.
 => #<File:vendor/assets/images/monkey.jpg> 
rahilsondhi commented 10 years ago

Ah yes, things seem to be working now without me doing anything. I'm seeing that output in rails console when I'm testing things out (eg model.remote_avatar_url = 'url' and model.save!).

If I learn anything new I'll report back. Thanks for the quick responses!

rilian commented 10 years ago

thank you!

iamrahulroy commented 9 years ago

Hey guys! Is there a way to customize output log message?

jtescher commented 9 years ago

The only option currently is to silence them with quiet mode: https://github.com/jtescher/carrierwave-imageoptimizer#quiet-mode