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 — image v0.69.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()
Popular in Questions
Other popular topics
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #deployment
- #library
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #channels
- #elixirconf
- #exunit
- #discussion
- #code-sync
- #javascript
- #podcasts
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixir-ls
- #phoenix_html
- #iex
- #blog-post
- #graphql
- #genstage
- #ai
- #websockets
- #supervisor
- #elixirconf-us
- #advent-of-code
- #distillery
- #processes
- #forms
- #api
- #metaprogramming
- #hex
- #security









