C<centimeter>, C<none> (the C<i_aspect_only> tag is also set reading
these files) or C<unknown>.
+=item tiff_bitspersample
+
+Bits per sample from the image. This value is not used when writing
+an image, it is only set on a read image.
+
+=item tiff_photometric
+
+Value of the PhotometricInterpretation tag from the image. This value
+is not used when writing an image, it is only set on a read image.
+
=item tiff_documentname
=item tiff_imagedescription
#!perl -w
use strict;
use lib 't';
-use Test::More tests => 77;
+use Test::More tests => 81;
use Imager qw(:all);
$^W=1; # warnings during command-line tests
$|=1; # give us some progress in the test harness
$im = Imager->new(xsize=>2, ysize=>2);
ok(!$im->write(file=>"testout/notiff.tif"), "should fail to write tiff");
is($im->errstr, 'format not supported', "check no tiff message");
- skip("no tiff support", 73);
+ skip("no tiff support", 77);
}
Imager::i_tags_add($img, "i_xres", 0, "300", 0);
ok(abs($tags{i_yres} - 250) < 0.5, "i_yres in range");
is($tags{tiff_resolutionunit}, 3, "tiff_resolutionunit");
is($tags{tiff_software}, 't106tiff.t', "tiff_software");
+ is($tags{tiff_photometric}, 2, "tiff_photometric"); # PHOTOMETRIC_RGB is 2
+ is($tags{tiff_bitspersample}, 8, "tiff_bitspersample");
$IO = Imager::io_new_bufchain();
ok(!$tags{i_aspect_only}, "i_aspect_only");
# resunit_inches
is($tags{tiff_resolutionunit}, 2, "tiff_resolutionunit");
+ is($tags{tiff_bitspersample}, 1, "tiff_bitspersample");
+ is($tags{tiff_photometric}, 1, "tiff_photometric");
ok($oofim->write(file=>'testout/t106_oo_fax.tiff', class=>'fax'),
"write OO, faxable");
if (!im)
return NULL;
+
+ /* general metadata */
+ i_tags_addn(&im->tags, "tiff_bitspersample", 0, bits_per_sample);
+ i_tags_addn(&im->tags, "tiff_photometric", 0, photometric);
/* resolution tags */
TIFFGetFieldDefaulted(tif, TIFFTAG_RESOLUTIONUNIT, &resunit);