Page 1 of 1

'identify -format %m' deletes file after delegate failure

Posted: 2015-02-20T11:16:03-07:00
by kgorin
Hello,

'identify -format %m' deletes file if it's empty and have .mp4 extension

➜ ~ identify -format %m, /Users/kgorin/identify_test.mp4
identify: delegate failed `"ffmpeg" -v -1 -i "%i" -vframes %S -vcodec pam -an -f rawvideo -y "%u.pam" 2> "%Z"' @ error/delegate.c/InvokeDelegate/1314.
identify: unable to open image `/var/tmp/magick-7964QEfqjIQPe8um.pam': No such file or directory @ error/blob.c/OpenBlob/2701.

And after that file gets deleted from a disk. Is that a bug?

OS X 10.10, installed with homebrew
➜ ~ identify
Version: ImageMagick 6.9.0-3 Q16 x86_64 2015-01-09 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2015 ImageMagick Studio LLC
Features: DPC Modules
Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png xml zlib

Re: 'identify -format %m' deletes file after delegate failure

Posted: 2015-02-20T11:20:55-07:00
by fmw42
You need to install the ffmpeg delegate library for IM to detect the magic value for an mpeg video or to process (read/write) one.

Your list of delegates does not include that.
Delegates (built-in): bzlib freetype jng jpeg ltdl lzma png xml zlib
You also do not have delegates for tiff or ghostscript (ps and pdf formats)

I am on a Mac and do the following using MacPorts. See viewtopic.php?f=1&t=21502&p=88202&hilit ... rts#p88202

My delegates are the following, though you don't need them all.

Code: Select all

Delegates (built-in): bzlib cairo fftw fontconfig freetype gslib jbig jng jp2 jpeg lcms lqr ltdl lzma openexr png ps rsvg tiff webp x xml zlib

Re: 'identify -format %m' deletes file after delegate failure

Posted: 2015-02-24T02:45:54-07:00
by kgorin
I get why it can't identify the file, but deleting the file is definitely not expected behaviour, isn't it?

Re: 'identify -format %m' deletes file after delegate failure

Posted: 2015-02-24T11:02:23-07:00
by fmw42
No, I would not expect that it would delete your file.
identify -format %m, /Users/kgorin/identify_test.mp4
This is not correct syntax. There should be no comma. Try

Code: Select all

identify -format "%m" "/Users/kgorin/identify_test.mp4"
Does that work without deleting the file?

Re: 'identify -format %m' deletes file after delegate failure

Posted: 2015-02-24T11:12:02-07:00
by magick
We can reproduce the problem you posted and have a patch in ImageMagick 6.9.0-8 Beta available by sometime tomorrow. Thanks.

Re: 'identify -format %m' deletes file after delegate failure

Posted: 2015-02-24T14:25:18-07:00
by kgorin
fmw42 wrote:No, I would not expect that it would delete your file.
identify -format %m, /Users/kgorin/identify_test.mp4
This is not correct syntax. There should be no comma. Try
That's a typo, works the same.
magick wrote:We can reproduce the problem you posted and have a patch in ImageMagick 6.9.0-8 Beta available by sometime tomorrow. Thanks.
Thanks!