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

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
kgorin
Posts: 3
Joined: 2015-02-20T10:57:57-07:00
Authentication code: 6789

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

Post 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
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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
kgorin
Posts: 3
Joined: 2015-02-20T10:57:57-07:00
Authentication code: 6789

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

Post by kgorin »

I get why it can't identify the file, but deleting the file is definitely not expected behaviour, isn't it?
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

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

Post 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?
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

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

Post 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.
kgorin
Posts: 3
Joined: 2015-02-20T10:57:57-07:00
Authentication code: 6789

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

Post 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!
Post Reply