Gary,
Use to_blob: http://studio.imagemagick.org/RMagick/doc/
image3.html#to_blob
As in:
pic = Magick::Image.from_blob(your_image_data){|img| img.format =
"gif"}.first
# ...do something with the image
your_image_data = pic.to_blob { |img| img.format = img.format =
"gif" }
-- Michael
On Oct 14, 2005, at 11:43 PM, Gary Lin wrote:
> Hi,
>
> I''m using RMagick to reduce the image file size by
>
> image.write("somefile") { self.quality = 50 }
>
> It works fine, however, it needs to create another tmp file.
> Since I''ll store the result in db.
> Is it possible to conver the image object on-the-fly so that
> no tmp file is necessary?
>
> Gary
>
> _______________________________________________
> Rails mailing list
> Rails-1W37MKcQCpIf0INCOvqR/iCwEArCW2h5@public.gmane.org
> http://lists.rubyonrails.org/mailman/listinfo/rails
>