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.

ywenbo
  • 3,051
  • 6
  • 31
  • 46

1 Answers1

1

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

Mladen Jablanović
  • 43,461
  • 10
  • 90
  • 113
  • :-), yes, thank you very much, just now i am walk through one by one and find it's just suitable for what i want to do. Thank you thank you very very much for your answer in time. – ywenbo Dec 10 '10 at 14:04