"Beginner" on  wrote...
| Hi,
| 
| I have been using the ping method to return the size of a TIFF file. 
| This size though, seems to be the size of the file on disk. The TIFFs 
| I have been looking at had used LZW compression so the actually size 
| of the raw image is larger than the disk size.
| 
| Is there a way to retrieve the un-compressed file size from a file, 
| hopefully as quickly as the ping method? Or is there a formula for 
| working out the un-compressed size of a file; width x height x no. 
| channel x bits per channel perhaps?
| 
You can always get a good idea of a images uncompressed size by using...

   width * height * bit_depth/8 * number_of_channels

The number of channels in an image is either 3 for RGB or 4 for RGBA

This is the base size so to make it more accurate you will also need to
add the images  profile_size (hightly variable, unless striped) and a
roughly constant header size.

This is only rough but much more accurate than file size.


The -ping test is basically to try and do a minimal read on the image to
get basic information, nothing more.  File size is basic information.

  Anthony Thyssen ( System Programmer )    <[EMAIL PROTECTED]>
 -----------------------------------------------------------------------------
   And then you turn the corner, as the Dungeon Master chuckles...
 -----------------------------------------------------------------------------
     Anthony's Home is his Castle     http://www.cit.gu.edu.au/~anthony/
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to