From 64157f5b6f4649f7ca845cb119535863dd221822 Mon Sep 17 00:00:00 2001 From: Jesse Luehrs Date: Tue, 7 Oct 2014 14:06:09 -0400 Subject: add P1 format --- t/P1.t | 29 +++++++++++++++++++++++++++++ t/data/P1.pbm | 4 ++++ 2 files changed, 33 insertions(+) create mode 100644 t/P1.t create mode 100644 t/data/P1.pbm (limited to 't') diff --git a/t/P1.t b/t/P1.t new file mode 100644 index 0000000..3fbfb04 --- /dev/null +++ b/t/P1.t @@ -0,0 +1,29 @@ +#!/usr/bin/env perl +use strict; +use warnings; +use Test::More; + +use Image::PNM; + +my $image = Image::PNM->new('t/data/P1.pbm'); + +is($image->width, 6); +is($image->height, 8); +is($image->max_pixel_value, 1); +is_deeply($image->raw_pixel(1, 2), [0, 0, 0]); +is_deeply($image->pixel(4, 1), [0, 0, 0]); + +is($image->as_string('P1'), <