0

I use Ruby Gem curb to fetch image by the method of body_str of Curl::Easy instance, then want to use RMagick to process the image, however Magick::Image.read needs a file name to read, but what i get is the content string of the image. Yes, i know i can firstly convert the image content string into a file, then pass the file name to Magick::Image.read method. But that will add one more IO operation.

So i want to know whether it's possible to convert an image content string into stream directly, so that i can use RMagick to read it directly.

Thank you in advance.

4

1 回答 1

1

Check other class methods of Image class, particularly from_blob. Sounds like what you need.

于 2010-12-10T13:54:55.877 回答