disintegration / imaging

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

Open Base64 #85

Closed LoganArnett closed 5 years ago

LoganArnett commented 5 years ago

Am I able to use the Open method on a base64 string directly instead of a file? I am trying to use this in an AWS Lambda and trying to see if I can avoid even creating temporary files

disintegration commented 5 years ago

If you have a base64-encoded image data as a string, you can use Decode instead. e.g.:

img, err := imaging.Decode(base64.NewDecoder(base64.StdEncoding, strings.NewReader(data)))
LoganArnett commented 5 years ago

Wow, yep, totally overlooked that, thanks @disintegration my bad

Awesome go package by the way 👍