我想使用rmagick将图像写入文件.以下是我的代码
im = "base64encodedstring" image = Magick::Image.from_blob(Base64.decode64(im) image[0].format = "jpeg" name ="something_temp" path = "/somepath/" + name File.open(path, "wb") { |f| f.write(image[0]) }
我也试过用f.write(image)
.但是在文件中写的是#
.这是什么原因?