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 =-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: PerlMagick: How to Calculate an image size in milimiters?
by Arguile (Hermit) on Jun 03, 2003 at 21:53 UTC | |
by ehdonhon (Curate) on Jun 04, 2003 at 00:55 UTC | |
by Cody Pendant (Prior) on Jun 03, 2003 at 23:51 UTC |
Back to
Seekers of Perl Wisdom