Page 1 of 1

question about change in identify format

Posted: 2009-12-01T10:26:50-07:00
by fmw42
It appears that the format for identify has changed.

convert rose: rose: rose: rose: rose: rose: rose: rose7.tif
identify rose7.tif
rose7.tif[0] TIFF 70x46 70x46+0+0 8-bit DirectClass 68.4KiB 0.000u 0:00.000
rose7.tif[1] TIFF 70x46 70x46+0+0 8-bit DirectClass 68.4KiB 0.000u 0:00.000
rose7.tif[2] TIFF 70x46 70x46+0+0 8-bit DirectClass 68.4KiB 0.000u 0:00.000
rose7.tif[3] TIFF 70x46 70x46+0+0 8-bit DirectClass 68.4KiB 0.000u 0:00.000
rose7.tif[4] TIFF 70x46 70x46+0+0 8-bit DirectClass 68.4KiB 0.000u 0:00.000
rose7.tif[5] TIFF 70x46 70x46+0+0 8-bit DirectClass 68.4KiB 0.000u 0:00.000
rose7.tif[6] TIFF 70x46 70x46+0+0 8-bit DirectClass 68.4KiB 0.000u 0:00.000

Are the columns defined somewhere? If not can you tell me what they are, esp. the last two columns. Also why KiB rather than KB? Is not KB (kilobytes) the standard?

I presume 70x46 is the image size and 70x46+0+0 is the virtual canvas.

Thanks

Re: question about change in identify format

Posted: 2009-12-01T11:11:45-07:00
by magick
KiB means 1024 bytes whereas KB means 1000.

Re: question about change in identify format

Posted: 2009-12-01T11:19:38-07:00
by fmw42
1) OK. But seems to me that kB or KB (1000) would be the prefered format for image sizes since they are not restricted to powers of two. See
http://en.wikipedia.org/wiki/Kilobytes excerpt below.



"Some have suggested that the capitalized prefix "K" be used to distinguish this quantity from the SI prefix "k", but this has never been formally mandated. Further, it is not extensible to higher-order prefixes, as SI already uses the prefixes "m" and "M" to mean "milli-" and "mega-" respectively. There are also proposals to capitalize all greater-than-unity prefixes (D, H, K, M, G, ...), which would conflict with this. See SI prefix.

These prefixes are therefore used with either decimal (powers of 1000) or binary (powers of 1024) values, depending on context:

1024 bytes (2^10): This unit is used when expressing quantities which are based on powers of two, such as memory chip capacities. Software like Microsoft Windows[1] also expresses storage quantities in units of 1024 bytes. Although the use of "kilobyte" for this unit is common, this usage has been expressly forbidden by the SI standard[2] and other standards organisations. To indicate a quantity of 1024 bytes, the term "kibibyte" ("KiB") has been recommended instead.[3][4]

1000 bytes (10^3): This definition is recommended for all uses by international standards organizations such as IEC, IEEE, and ISO,[4] with the abbreviation "kB". This unit is common for quantities which are not based on powers of two, such as bitrates. This definition is used for storage quantities in software such as the Linux kernel[5] and Mac OS X 10.6.[6]"


For example on my Mac, a 20KB image is reported as actual 20,031 bytes. So KB means 1000 and not 1024. It would be harder to convert the reported KiB into bytes if one has to multiply by 1024.

This is just my opinion and I can live with it however you decide as long as it is clearly defined.

2) But what are the last two columns?

I can modify the page at http://www.imagemagick.org/script/identify.php if you can tell me what the columns mean.

Re: question about change in identify format

Posted: 2009-12-01T13:16:27-07:00
by magick
Ok, will add a patch such that image sizes are reported as KB / GB but memory limits as KiB / GiB.

Re: question about change in identify format

Posted: 2009-12-01T13:30:43-07:00
by fmw42
OK, but feel free to get other opinions if you want.

But still would like to know what are the last two columns in the identify.

identify rose7.tif
rose7.tif[0] TIFF 70x46 70x46+0+0 8-bit DirectClass 68.4KiB 0.000u 0:00.000
rose7.tif[1] TIFF 70x46 70x46+0+0 8-bit DirectClass 68.4KiB 0.000u 0:00.000
rose7.tif[2] TIFF 70x46 70x46+0+0 8-bit DirectClass 68.4KiB 0.000u 0:00.000
rose7.tif[3] TIFF 70x46 70x46+0+0 8-bit DirectClass 68.4KiB 0.000u 0:00.000
rose7.tif[4] TIFF 70x46 70x46+0+0 8-bit DirectClass 68.4KiB 0.000u 0:00.000
rose7.tif[5] TIFF 70x46 70x46+0+0 8-bit DirectClass 68.4KiB 0.000u 0:00.000
rose7.tif[6] TIFF 70x46 70x46+0+0 8-bit DirectClass 68.4KiB 0.000u 0:00.000

Re: question about change in identify format

Posted: 2009-12-01T14:03:36-07:00
by magick
That is user and elapsed time.

Re: question about change in identify format

Posted: 2009-12-01T14:55:03-07:00
by fmw42
magick wrote:That is user and elapsed time.
OK. But I must not understand the units as it does not seem consistent with the time function

time convert logo: -blur 0x50 logo_tmp.png
real 0m9.973s
user 0m8.935s
sys 0m0.085s

identify logo_tmp.png
logo_tmp.png PNG 640x480 640x480+0+0 8-bit DirectClass 72.9KiB 0.010u 0:00.020

Can you clarify the units in the user and elapsed time in identify for me.

Thanks

Re: question about change in identify format

Posted: 2009-12-01T17:04:06-07:00
by magick
The times reported are how long it took to read the image format, not the total user and elapsed time.

Re: question about change in identify format

Posted: 2009-12-01T18:07:12-07:00
by fmw42
magick wrote:The times reported are how long it took to read the image format, not the total user and elapsed time.
Sorry, I am not making my question clear.

logo_tmp.png PNG 640x480 640x480+0+0 8-bit DirectClass 72.9KiB 0.010u 0:00.020

The last one: 0:00.020 is this hrs:min as fraction so .02 minutes or something else such as seconds in some way

The second to last one: 0.010u is this fractions of minutes so .01 minutes or is the last part seconds in some way

Re: question about change in identify format

Posted: 2009-12-01T18:59:37-07:00
by magick
Here's the code that produces the time:
  • (void) fprintf(file,"%0.3fu %ld:%02ld.%03ld",user_time,(long)
    (elapsed_time/60.0),(long) floor(fmod(elapsed_time,60.0)),
    (long) (1000.0*(elapsed_time-floor(elapsed_time))));