Open zmcNotafraid opened 6 years ago
I read the code that it invoke System.tmp_dir() method.
tmp_dir()
Writable temporary directory.
Returns a writable temporary directory. Searches for directories in the following order:
the directory named by the TMPDIR environment variable
the directory named by the TEMP environment variable
the directory named by the TMP environment variable
C:\TMP on Windows or /tmp on Unix
as a last resort, the current working directory
Returns nil if none of the above are writable.
So I export TMPDIR=/tmp/imagemagick. The temp file will save in this folder.And you need to delete them manually.
Any update on this? I'm seeing temporary files being left behind as well when using transform
with convert
def transform(:thumb, _) do
convert_opts =
"-strip -thumbnail 250x250> -gravity center -background none -extent 250x250 -format png"
{:convert, convert_opts, :png}
end
I have a fork (https://github.com/stavro/arc/compare/master...hollar:hollar) that I'm maintaining that removes temporary files after processing. We were processing a large number of files in a small amount of time which ended up flooding the tmp
directory. I can clean this up and create a PR if @stavro feels that this approach is the way to go. I'm also open to suggestions.
I use local adapter and transform like this
Then I found it will generate a temporary file in temp folder.And I read the code in convert.ex and find this
So I need to delete them manually. Do there have any solution to delete them automatically after upload successfully?