Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add LZW-compressed TIFF test

  • Loading branch information...
commit 03a5e32a34a94f248b596a4e9c826eb5ddfcaf86 1 parent 31cca2b
@ssimms ssimms authored
Showing with 14 additions and 1 deletion.
  1. BIN  t/resources/1x1-lzw.tif
  2. +14 −1 t/tiff.t
View
BIN  t/resources/1x1-lzw.tif
Binary file not shown
View
15 t/tiff.t
@@ -1,4 +1,4 @@
-use Test::More tests => 2;
+use Test::More tests => 4;
use warnings;
use strict;
@@ -16,3 +16,16 @@ my $gfx = $pdf->page->gfx();
$gfx->image($tiff, 72, 144, 216, 288);
like($pdf->stringify(), qr/q 216 0 0 288 72 144 cm \S+ Do Q/,
q{Add TIFF to PDF});
+
+$pdf = PDF::API2->new();
+$pdf->{forcecompress} = 0;
+
+my $lzw_tiff = $pdf->image_tiff('t/resources/1x1-lzw.tif');
+isa_ok($lzw_tiff, 'PDF::API2::Resource::XObject::Image::TIFF',
+ q{$pdf->image_tiff(), LZW compression});
+
+$gfx = $pdf->page->gfx();
+$gfx->image($lzw_tiff, 72, 360, 216, 432);
+
+like($pdf->stringify(), qr/q 216 0 0 432 72 360 cm \S+ Do Q/,
+ q{Add TIFF to PDF});
Please sign in to comment.
Something went wrong with that request. Please try again.