I am reading three images using the RMagick gem and then adding them to an ImageList
imagelist = ImageList.new
imagelist << Image.read(path1)[0]
imagelist << Image.read(path2)[0]
imagelist << Image.read(path3)[0]
Then I combined these three images with the append
method
combined_image = imagelist.append(false)
Then I try to write this image to Amazon S3:
AWS::S3::S3Object.store(filename, combined_image, bucket)
However, I get this error which prevents me from successfully writing the image to S3:
undefined method `size' for #<Magick::Image:0x00000101994498>
I played around with RMagic in the console, and I found that when you append
images in an ImageList
, it returns an Image
that seems to omit its size in bytes.
How can I modify this image so that I can write it to S3?