Forum: Ruby RMagick Image Optimize

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
TomRossi7 (Guest)
on 2006-03-17 16:49
(Received via mailing list)
I'm new to RMagick and am looking for how you can set the optimization
on a jpeg image.  Can someone point me in the right direction?

Thanks!
Tom
(Guest)
on 2006-03-17 18:00
(Received via mailing list)
If by "optimization" you mean compression, see here:
http://www.simplesystems.org/RMagick/doc/comtasks....

If you mean color reduction, see here:
http://www.simplesystems.org/RMagick/doc/image3.ht...
TomRossi7 (Guest)
on 2006-03-17 23:05
(Received via mailing list)
Thanks!  The compession is definitely what I am looking for.  I'm
trying to use it dynamically when the image is rendered to a Rails web
page.  Currently, I am using the follwoing to render the image:

send_data myimage.to_blob, :disposition => 'inline', :type =>
'image/jpg'

I tried using myimage.quality = 50, but it looks like that can only be
done on a write.  Is there a way for me to set the quality when
rendering the image?  Sorry if this is newbie stuff!

--Tom
Timothy H. (Guest)
on 2006-03-18 00:34
(Received via mailing list)
TomRossi7 wrote:
>
> --Tom
>
quality works as an option to the to_blob method, too. To change the
compression level you have to specify quality as a optional argument to
the to_blob or write method. I don't know how you'd do that in a Rails
context. Perhaps a Rails expert will know.
This topic is locked and can not be replied to.