Forum: Ruby on Rails Reading image file field data directly into RMagick

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.
10c741d575988433e3fcd04133f3c462?d=identicon&s=25 Sebastian Friedrich (Guest)
on 2006-03-24 00:37
(Received via mailing list)
I'm trying to read image data from an upload file field directly into
an RMagick image object without having to temporally save the image
file first. Assuming my file field param is assigned to @temp_file, i
tried RMagicks from_blob method:

img = Magick::Image::from_blob(@temp_file.read)

But i get an error message saying that the blob is empty. I also
tried feeding it the entire IOString object returned by the file
field, but it can't deal with it either. Anybody knows how this can
be done? Thanks.

sebastian
This topic is locked and can not be replied to.