http://qs1969.pair.com?node_id=262796

monsieur_champs has asked for the wisdom of the Perl Monks concerning the following question:

Brothers

I'm building a system to crop, resample and scale TIFF images from a Fax server, so it fit into a set of A4 (210x297mm) pages.

However I'm facing a strange problem: I don't know for sure how to calculate the size of a Image in millimeters. My calculations simply don't correspond to what I'm expecting, except when the resolution is 72dpi.

I'm using the PerlMagick ImageMagick Interface to this task.

To calculate the image size, I'm using this:

# A4 page height in inches (approximately) use constant PAGE_HEIGHT => 11; # A4 page width in inches (approximately) use constant PAGE_WIDTH => 8; my $image= new Image::Magick(); $image->Read( 'filename.tif' ); $vertical_size = $image->Get( 'y-resolution' ) * PAGE_HEIGHT; $horizontal_size = $image->Get( 'x-resolution' ) * PAGE_WIDTH;

Can anybody help me with this task?

May the gods bless you.

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Luis Campos de Carvalho
Just Another Perl Monk
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=