Diffferent image depth by "identify -format %z"?

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
butz74

Diffferent image depth by "identify -format %z"?

Post by butz74 »

Dear Board

Problem:
When executing the command "identify -format %z", on two different IM versions, I got two different values for the image depth.

Examples:
@server 1, ImageMagick 6.4.1 05/27/08 Q16
identify -format %z original.eps[0] => 16
identify -format %z converted.eps[0] => 16

@server 2, ImageMagick 6.4.1 08/19/08 Q16
identify -format %z original.eps[0] => 4
identify -format %z converted.eps[0] => (NULL)

Information:
- I know, that the original.eps is a 16bit image.
- The image "converted.eps" was created with the command "convert -depth 16 original.eps converted.eps"

PHP erxample script:
<?php
$result = array();
echo "identify version:\n";
$command = "identify -version";
exec($command, $result);
print_r($result);

$result = array();
echo "original.eps:\n";
$command = "identify -format %z original.eps[0]";
exec($command, $result);
print_r($result);

$result = array();
echo "converted.eps:\n";
$command = "identify -format %z converted.eps[0]";
exec($command, $result);
print_r($result);
?>

Does anybody have any suggestions? Thank you!

Greetings
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Diffferent image depth by "identify -format %z"?

Post by fmw42 »

why are you appending [0] to your filename? do you have multiple frames or pages? if so and you need to find the size of the first frame then try putting the whole filename in quotes, 'image.eps[0]'

There was a recent post in one of the forums about the same thing and it seemed that an upgrade fixed the problem. So there might be versions of IM that do not for some reason like the [0] at the end of the file in this case.

see viewtopic.php?f=1&t=14754
butz74

Re: Diffferent image depth by "identify -format %z"?

Post by butz74 »

I'm appending "[0]" to the filename, because I don't know what type of image I will get (automated processing).
But anyway, putting the whole filename in quotes doesn't change anything ("filename.format[0]" or 'filename.format[0]').

Regarding to the post:
Also leave the notation for the first layer ([0]) doesn't change anything (filename.format[0] -> filename.format).

Is there a difference between IM 6.4.1 05/27/08 Q16 and IM 6.4.1 08/19/08 Q16?? Should I probably update IM? What do you think?

Greetings
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: Diffferent image depth by "identify -format %z"?

Post by fmw42 »

If you read all the posts on that topic you will see that an upgrade apparently resolved the problem.
butz74

Re: Diffferent image depth by "identify -format %z"?

Post by butz74 »

Yes, that I understood ;-). Just was wondering if there is a other solution...
So thank you for your responses, for me the question is answered ;-).

Greetings :-)
Post Reply