How can I change an image type (eg from TIFF to JPG) without calling image.write?
I am using RMagick to resize images. My goal is to make 4 different sizes of each image, and to make them all square. So for a rectangular image, It will become square with the remainder of the space filled in with white space. The final step is to store the source in its native format (generally TIFF), and store the rest in JPG format.
However, I am not using the "write" method, as I am POSTing these bytes directly up to our cloud storage vi a REST API. So I need to change the representation of the image w开发者_如何学Pythonithout calling "write".
Thanks for any help you can offer!
image.to_blob { self.format = "JPEG" }
It looks like:
image.format("JPG")
will do it.
精彩评论