Reputation: 1352
I was trying to use the convert command (OS X El Capitan) to convert a .mod
video to .mp4
and it quickly filled up my disk space and I had to Control + C to halt it.
But after restart, the disk space is still filled and I don't know where the cache, i.e. the half converted video is and I don't know how to delete it. Can anyone help?
Thank you!
Upvotes: 2
Views: 3370
Reputation: 207445
Updated Answer July 2023
You can get the MAGICK_TEMPORARY_PATH with this command:
magic identify -list configure
It is listed near the end.
Original Answer
If you have set either of the two environment variables:
MAGICK_TEMPORARY_PATH
MAGICK_TMPDIR
then ImageMagick will use that directory for its temporary files. So, the first way to check is to run
env | grep -i MAGICK
and see if you have either set.
Failing that, or if you have no environment variables set, the easiest way I know to find where ImageMagick caches on disk is to turn on cache debugging and force ImageMagick to go to disk. So, we can turn on cache debugging with:
convert -debug cache ...
and we can force ImageMagick to go to disk by limiting the RAM it is allowed to use with:
convert -limit memory 100k ...
So, if we put that together:
convert -debug cache -limit memory 100k -size 1000x1000 xc:gray image.jpg
2016-05-19T13:25:46+01:00 0:00.000 0.000u 6.9.4 Cache convert[46510]: cache.c/SetPixelCacheExtent/3500/Cache
extend gray[0] (/var/tmp/magick-46510CYSKWOdhlrym[3], disk, 8MB)
2016-05-19T13:25:46+01:00 0:00.010 0.000u 6.9.4 Cache convert[46510]: cache.c/OpenPixelCache/3776/Cache
open gray[0] (/var/tmp/magick-46510CYSKWOdhlrym[-1], Map, 1000x1000 7.629MiB)
And, if you look carefully, you can see it is using /var/tmp
on my Mac OSX - your system may be different, but this technique should show you what it is using.
Just as a test, I can set an environment variable and check ImageMagick is using it:
# Tell IM where to cache stuff on disk
export MAGICK_TEMPORARY_PATH=/tmp/TEMPPATH
# Force an operation that will require caching
convert -debug cache -limit memory 100k -size 1000x1000 xc:gray image.jpg
2016-05-19T14:09:51+01:00 0:00.000 0.000u 6.9.4 Cache convert[46584]: cache.c/SetPixelCacheExtent/3500/Cache
extend gray[0] (/tmp/TEMPPATH/magick-46584CivsEmIPjwv2[3], disk, 8MB)
2016-05-19T14:09:51+01:00 0:00.010 0.000u 6.9.4 Cache convert[46584]: cache.c/OpenPixelCache/3776/Cache
open gray[0] (/tmp/TEMPPATH/magick-46584CivsEmIPjwv2[-1], Map, 1000x1000 7.629MiB)
Keywords: ImageMagick, environment variables, tmp, TEMPDIR, TEMPPATH, cache, disk, cache
Upvotes: 5