Zsolt
Transforming images using streams
Is there a library for transforming images using streams? Specifically I would like to resize and save images as webp. I’m using the image (Image Install & Configure — image v0.42.0) lib, that does have some streaming, but the methods I want to access won’t accept them. Am I missing something with this lib, or is there an alternative I could use?
Most Liked
Zsolt
After reviewing my work I would like to retract this statement:
I found this example in the docs
"some/image.jpg"
|> Image.open!()
|> Image.resize!(200)
|> Image.stream!(suffix: ".jpg", buffer_size: 5_242_880)
|> ExAws.S3.upload("images", "some_object_name.jpg")
|> ExAws.request()
and with some refactoring it got me where I wanted to be.
In short, I was doing something wrong with the file path, and because of that it wasn’t reachable, so I misinterpreted the errors.
Thanks anyway for the quick responses @LostKobrakai and @kip.
kip
Glad you’re up and running. And it prompted me to fix that example which should be (and is now on hexdocs.pm):
"some/image.jpg"
|> Image.thumbnail!(200)
|> Image.stream!(suffix: ".jpg", buffer_size: 5_242_880)
|> ExAws.S3.upload("images", "some_object_name.jpg")
|> ExAws.request()







