wowlixir
Hello,
I’m using Waffle (a fork of Arc) for image uploads in my Phoenix project. When an image is successfully uploaded, I would like to generate a bunch of smaller images from it, which will then be used in a tiled image pyramid viewer. Of course if the user deletes the image the tiles should be automatically deleted as well.
How can I accomplish this?
If I understand it correctly, Arc’s default “transformations” flow assumes each input file may map to at most one output file for each version, even if I want to run arbitrary commands. I already have the command to generate the images, I just need to understand how to integrate this with Arc.
Thanks in advance!
Trending in Questions
I’m working on a project that simulates the bumbl example in the programming phoenix book. It acts almost like an email client. We have a...
New
Hello!
Could someone please give me a help/sample code, how to delete a file from s3 using waffle/waffle_ecto from Phoenix app.
I creat...
New
I’m seeing that a list inside a Kino.DataTable will be interpreted as a charlist, even if the Kino.configure() is set to charlists: :as_l...
New
So my question is quite simple and i have found no conclusive answer on forum, google or AI.
Should we use :erlang.float for Integer to ...
New
Hi, I’ve just set up an application with ash_authentication. There is only magic link strategy for now, so there is no confirmation add o...
New
If a change or preparation module uses Ash.Changeset.get_argument/2 or Ash.Query.get_argument/2 (or any of the other get_argument functio...
New
apply_graft/2 doesn’t rewrite an add_many sub-workflow’s deps on an add step. Grafted jobs cancel with “upstream job was deleted”
Version...
New
Other Trending Topics
I am happy to introduce the very α version of the new programming language compiled to BEAM.
Welcome Cure.
It has literally three kille...
New
Hobbes is a low-level distributed database for the Elixir programming language.
Hobbes provides a simple, safe, and scalable storage lay...
New
Hi there! We created Gust: A task orchestrator inspired by Airflow.
For those who have never heard about Aiflow, it’s a Python-based wor...
New
Beam Bots (or just BB for short) is a framework for building fault-tolerant robotics applications in Elixir using familiar OTP patterns. ...
New
Xamal is a deployment tool for Elixir apps that deploys native releases to bare metal servers over SSH. It’s a port of GitHub - basecamp/...
New
Hello everyone. After busy few months I am happy to announce v0.1.0 of Emerge & Solve.
They are GUI (Emerge) and State management (S...
New
Categories:
Sub Categories:
Forums
Popular Tags
- #ecto
- #liveview
- #troubleshooting
- #learning-elixir
- #library
- #deployment
- #erlang
- #testing
- #genserver
- #mix
- #absinthe
- #remote-other
- #otp
- #plug
- #how-to-question
- #macros
- #postgres
- #elixirconf
- #channels
- #exunit
- #discussion
- #code-sync
- #podcasts
- #javascript
- #onsite
- #dialyzer
- #docker
- #authentication
- #umbrella
- #full-time-contract
- #podcasts-by-brainlid
- #ecto-query
- #elixirconf-us
- #blog-post
- #ai
- #elixir-ls
- #phoenix_html
- #iex
- #graphql
- #genstage
- #websockets
- #supervisor
- #advent-of-code
- #distillery
- #processes
- #api
- #forms
- #hex
- #security
- #metaprogramming










Showing Posts 1 to 8- Show Best Posts
- Show All (oldest first)
- Show All (newest first)
kokolegorille
Hello and welcome,
It is possible to specify multiple versions in the uploader, something like…
For delete, I did not solve it yet in the best way… In case of cascade delete for example…
But I have a cleaning task running periodically, deleting what needs to be.
Kurisu
I think you’re talking about images files associated with database records, right? Indeed I can’t see really a better solution.
But just in case the OP author is not aware of it, I would like to add this:
A Waffle uploader module has a delete function that should delete all the versions of an image (:mini, :large, :original…) all together when called.
kokolegorille
Yes, I was talking about associated files
The problem is not to hook file deletion, but to know when the resource is deleted.
I have been thinking of postgres triggers, but it is postgres specific, and a super simple cron task…
wowlixir
Hey @kokolegorille, thanks for your reply!
Sorry, I’m not sure I was clear enough. I know I can define these versions, but each version is assumed to only produce one file, right?
I’m implementing an image viewer that allows users to pan and zoom very large images. For this I need to generate an arbitrary number of files based on the dimensions of the input image. More specifically, from a single image I must produce many “slices” (cropped and resized squares) that correspond to x, y and z coordinates (z for zoom). This is common practice for “image pyramids”, “slippy maps”, etc. (if you want to look up those terms). So I don’t know how many images will be produced, and I don’t want to refer to each of them by name, but by “coordinate”. For instance,
/uploads/myimg/0/2/3.jpgwould bex=0,y=2, z=3. So I imagine it being a single version (e.g.:slices) with 3 parameters (x,yandz).I hope I’ve explained it well enough!
kokolegorille
I have also used transformation tools with System.cmd…
Just I did not use waffle transform, but a custom job. I used ffmpeg, to capture screen from video, but it was too heavy for waffle (taking too long). I did a custom background job in that case.
If You have a file location, You can apply anything on it… with imagemagick convert, or ffmpeg, or any other tools.
wowlixir
Would you mind explaining how you did this background job?
And do you think it would be possible to run the command and make
transformreturn the path to a folder that contains all generated images for the input file, rather than return the path to a single file? Then I’d be able to do something like:<img src="<%= Pyramid.url({"myimg.png", img}, :slices) %>/0/0/0.jpg">kokolegorille
There are some ways to do it.
Oban by @sorentwo.
or a simple task… like in this post by @alvises
BTW, You may find more articles on using mogrify, or doing raw file upload in the previous linked site.
After this, You can create your own helper to display the associated files. For example it could be
wowlixir
I’m still very much a newbie so I’m still pretty lost, but I’ll try to understand things a little better before asking more questions. Thank you very much!