Identify -format %D returns 'undefined' (as opposed to Undefined)
Identify -format %D returns 'undefined' (as opposed to Undefined)
Hey guys.
I have a few animated GIFs I'm running 'identify -format %D' on, and they are returning 'undefined' (while others are returning Undefined, Background, None, etc.).
Is there a difference between 'undefined' and 'Undefined'?
Should I treat them the same as Undefined?
What would cause it to return 'undefined'?
Thanks a lot!
I have a few animated GIFs I'm running 'identify -format %D' on, and they are returning 'undefined' (while others are returning Undefined, Background, None, etc.).
Is there a difference between 'undefined' and 'Undefined'?
Should I treat them the same as Undefined?
What would cause it to return 'undefined'?
Thanks a lot!
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Identify -format %D returns 'undefined' (as opposed to Undefined)
I cannot answer that, but perhaps it would help if you provide your version of IM and platform and an example GIF that returns undefined and one that returns Undefined.
Re: Identify -format %D returns 'undefined' (as opposed to Undefined)
hey fmw42!
I've encountered this on IM 6 and now on a recent 6.8.6-8 build on a linux machine.
Here is an example of a broken GIF: http://media.giphy.com/media/fz0KNGp3zw0ko/giphy.gif
Command and output: 'identify -format %D giphy.gif[0]' returns 'undefined'
Here is an example of a GIF that returns Undefined: http://i.giphy.com/TlK63EQNdeuEqCrjPyw.gif
Command and output: 'identify -format %D TlK63EQNdeuEqCrjPyw.gif[0]' returns 'Undefined'
Thanks!
I've encountered this on IM 6 and now on a recent 6.8.6-8 build on a linux machine.
Here is an example of a broken GIF: http://media.giphy.com/media/fz0KNGp3zw0ko/giphy.gif
Command and output: 'identify -format %D giphy.gif[0]' returns 'undefined'
Here is an example of a GIF that returns Undefined: http://i.giphy.com/TlK63EQNdeuEqCrjPyw.gif
Command and output: 'identify -format %D TlK63EQNdeuEqCrjPyw.gif[0]' returns 'Undefined'
Thanks!
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Identify -format %D returns 'undefined' (as opposed to Undefined)
I get your same results. I don't know why the spelling should be different, but I suspect they both mean the same thing.
One of the IM developers can now take a look at this and get back about it.
One of the IM developers can now take a look at this and get back about it.
Re: Identify -format %D returns 'undefined' (as opposed to Undefined)
They don't mean the same thing. The first image has a Dispose value that is 5. Valid values are 0-3 (http://www.w3.org/Graphics/GIF/spec-gif89a.txt). This is an unknown value and our code that translates this value returns "undefined" instead of "Undefined". The next version of ImageMagick will return "Unrecognized" when a value is found that we don't know.
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Identify -format %D returns 'undefined' (as opposed to Undefined)
What is the explanation for the other image?dlemstra wrote:They don't mean the same thing. The first image has a Dispose value that is 5. Valid values are 0-3 (http://www.w3.org/Graphics/GIF/spec-gif89a.txt). This is an unknown value and our code that translates this value returns "undefined" instead of "Undefined". The next version of ImageMagick will return "Unrecognized" when a value is found that we don't know.
Can you clarify how IM defines Undefined vs undefined?
Re: Identify -format %D returns 'undefined' (as opposed to Undefined)
Undefined is an actual value, 0 means Undefined. An unknown/unrecognized/invalid value is currently shown as "undefined"
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: Identify -format %D returns 'undefined' (as opposed to Undefined)
Thanks for the clarificationdlemstra wrote:Undefined is an actual value, 0 means Undefined. An unknown/unrecognized/invalid value is currently shown as "undefined"
Re: Identify -format %D returns 'undefined' (as opposed to Undefined)
> An unknown/unrecognized/invalid value is currently shown as "undefined"
ImageMagick 6.9.0-1 Beta returns "Unrecognized" (as of tomorrow).
ImageMagick 6.9.0-1 Beta returns "Unrecognized" (as of tomorrow).
Re: Identify -format %D returns 'undefined' (as opposed to Undefined)
Thanks guys! This is a bit awkward, as if there is a value (even 0) returning Undefined makes me think it's null or just totally missing.
So what will be shown for a missing disposal type? Also Unrecognized?
Either ways, it is cool that I now have an explanation of what was going on. I was confused about Undefined and undefined. Thanks!
So what will be shown for a missing disposal type? Also Unrecognized?
Either ways, it is cool that I now have an explanation of what was going on. I was confused about Undefined and undefined. Thanks!
Re: Identify -format %D returns 'undefined' (as opposed to Undefined)
If it is a missing disposal type the value will most likely be zero. And zero translates to "Undefined".
Re: Identify -format %D returns 'undefined' (as opposed to Undefined)
Cool, thanks.
Any idea on what software is using these unrecognized values (5 for this)?
Any idea on what software is using these unrecognized values (5 for this)?
Re: Identify -format %D returns 'undefined' (as opposed to Undefined)
The comment of your invalid file says PhotoScape, maybe that program created it?
Re: Identify -format %D returns 'undefined' (as opposed to Undefined)
Ah, yeah, might be. I'll try creating a GIF using it and see if it produces the faulty values.dlemstra wrote:The comment of your invalid file says PhotoScape, maybe that program created it?