Tim Hunter
3/17/2006 10:31:00 PM
TomRossi7 wrote:
> 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
>
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.