-
Notifications
You must be signed in to change notification settings - Fork 347
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Return result without disk saving? #368
Comments
Through content = MiniMagick::Tool::Convert.new do |convert|
convert << path
convert.resize("500x500")
convert << "-" # stdout
end
base64 = Base64.encode64(content) You can even read the input file from stdin: convert = MiniMagick::Tool::Convert.new
convert << "-"
convert.resize("500x500")
convert << "-" # stdout
processed_content = convert.call(stdin: input_content) |
Thanks for detailed examples! I may could not fully grasp API document before issuing. |
I was able to use this to write as base64 image = MiniMagick::Image.open("https://placehold.it/300x200")
base64 = Base64.encode64(image.to_blob).split("\n").join |
@sairam thank you for that |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I would do additional manipulation to image (like base64 encoding). It is more efficient to return image in reference format that skips saving image to disk.
Is it possible in current version of minimagick?
The text was updated successfully, but these errors were encountered: