PDF::Bu...:TIFF_GT(3)

✨ PDF::Builder::Resource::XObject::Image::TIFF_GT ✨

TIFF image support (Graphics::TIFF enabled) πŸŽ€

okay so bestie, this is the TIFF_GT page from the PDF::Builder Perl docs (user-contributed, obviously, we're all just vibing in here) πŸ¦‹

Inherits from <code>PDF::Builder::Resource::XObject::Image</code> β€” so it's got the family genes, periodt. πŸ’…


🌸 METHODS 🌸

πŸ’– new πŸ’–

$res = PDF::Builder::Resource::XObject::Image::TIFF_GT->new($pdf, $file, %opts)

Returns a TIFF-image object, bestie. ✨ Here's the breakdown:

  • $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 <code>IxAAA</code>

If the Graphics::TIFF package is installed, and its use is not suppressed via the <code>"nouseGT"</code> flag (peep the Builder documentation for <code>"image_tiff"</code>), the TIFF_GT library will be used. Otherwise? The TIFF library gets used instead. no cap. 🫢

Options:

  • <code>'notrans' => 1</code> β€” Ignore any alpha layer (transparency) and make the image fully opaque. bye bye transparency πŸ‘‹
  • <code>'name' => 'string'</code> β€” This is the name you can give for the TIFF image object. The default is <code>Ixnnnn</code>.

TIFF support (when using Graphics::TIFF) is for <code>"PhotometricInterpretation"</code> values of:

  • 0 (bilevel/gray, white is 0)
  • 1 (bilevel/gray, black is 0)
  • 2 (RGB)
  • 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 <code>PlanarConfiguration</code> of <code>2</code> is unknown until we get some test cases. it's giving "we'll figure it out when someone sends us a file" 🧚


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

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 <code>Graphic::TIFF</code>'s owner (ticket <code>RT 133955</code>), this is coming directly from <code>libtiff</code> (as write to <code>STDERR</code>), so he can't do anything about it! πŸ’€

ngl bestie, that warning dialog situation is not it, but it's out of our hands fr fr.

Finally, while Graphics::TIFF does not directly support passing in a filehandle (usually a <code>GLOB</code>), PDF::Builder will attempt to detect this issue and write the content (from the filehandle) to a temporary file, and pass that in as a normal file. Some operating systems appear to have trouble erasing this temporary file, so be aware that such files may build up over time! ⚠️ like, watch your disk space, girl.


πŸ’œ usesLib πŸ’œ

$mode = $tif->usesLib()

Returns:

  • 1 if Graphics::TIFF installed and used
  • 0 if not installed
  • -1 if installed but not used (<code>nouseGT</code> option given to <code>"image_tiff"</code>)
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 <code>LA_GT()</code> call if you need to know in advance. πŸ‘‘

okay that's the whole page bestie, you ate it, go make some gorgeous TIFFs πŸ’–βœ¨πŸŽ€πŸ¦‹πŸŒΈπŸ’…πŸ«Ά

this iconic little manual page is <code>perl v5.42.0</code>, dated <code>2026-01-17</code>, and it lives in the <code>PDF::Bu...:TIFF_GT(3)</code> section of the User Contributed Perl Documentation. mwah πŸ’‹

πŸ“¦ where this page comes from