Scroll to navigation

PDF::Builder::Resource::XObject::Image::TIFF_GT(3pm) User Contributed Perl Documentation PDF::Builder::Resource::XObject::Image::TIFF_GT(3pm)

NAME

PDF::Builder::Resource::XObject::Image::TIFF_GT - TIFF image support (Graphics::TIFF enabled)

METHODS

$res = PDF::Builder::Resource::XObject::Image::TIFF_GT->new($pdf, $file, $name, %opts)
$res = PDF::Builder::Resource::XObject::Image::TIFF_GT->new($pdf, $file, $name)
$res = PDF::Builder::Resource::XObject::Image::TIFF_GT->new($pdf, $file)
Returns a TIFF-image object. $pdf is the PDF object being added to, $file is the input TIFF file, and the optional $name of the new parent image object defaults to IxAAA.

If the Graphics::TIFF package is installed, and its use is not suppressed via the "-nouseGT" flag (see Builder documentation for "image_tiff"), the TIFF_GT library will be used. Otherwise, the TIFF library will be used instead.

Options:

Ignore any alpha layer (transparency) and make the image fully opaque.

TIFF support (when using Graphics::TIFF) is for "PhotometricInterpretation" values of 0 (bilevel/gray, white is 0), 1 (bilevel/gray, black is 0), 2 (RGB), and 3 (Palette color). It currently does not support 4 (transparency mask), 5 (separated CMYK), 6 (YCbCr), 8 (CIELab), or higher. There is limited support for an Alpha (transparency) channel (due to extremely limited test cases). Some tags are not supported, and a PlanarConfiguration of 2 is unknown until we get some test cases.

Some applications seem to take odd liberties with TIFF tags, such as adding a SamplePerPixel without specifying ExtraSamples type. In such cases, we treat one extra sample (not otherwise defined) as an Alpha channel, and hope for the best!

If there are invalid tags or field values within a tag, the Graphics::TIFF library will attempt to pop-up a warning dialog, rather than just ignoring invalid things. If we can find a switch to disable this behavior, we will look into adding it as an option. According to Graphic::TIFF's owner (ticket RT 133955), this is coming directly from libtiff (as write to STDERR), so he can't do anything about it!

$mode = $tif->usesLib()
Returns 1 if Graphics::TIFF installed and used, 0 if not installed, or -1 if installed but not used (-nouseGT option given to "image_tiff").

Caution: this method can only be used after the image object has been created. It can't tell you whether Graphics::TIFF is available in advance of actually using it, in case you want to use some functionality available only in TIFF_GT. See the PDF::Builder LA_GT() call if you need to know in advance.

2021-03-28 perl v5.32.1