disintegration / imaging

Imaging is a simple image processing package for Go
MIT License
5.22k stars 433 forks source link

How to get binary data instead of writing to filesystem #138

Closed squarebrakets closed 3 years ago

squarebrakets commented 3 years ago

Hello, I would like to store very small resized images to a DB as binary data. What can I do?

disintegration commented 3 years ago

Hello,

You can use the Encode function (imaging.Encode or jpeg.Encode or png.Encode etc) to write the resized image to a bytes.Buffer and store buffer.Bytes() to the database.

squarebrakets commented 3 years ago

Thank you