projects
/
Printer-Zebra.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(from parent 1:
96a1ba7
)
fix comment skipping in pbm
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Mon, 6 Feb 2012 18:21:47 +0000
(19:21 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Mon, 6 Feb 2012 18:21:47 +0000
(19:21 +0100)
pbm2ZPL.pl
patch
|
blob
|
history
diff --git
a/pbm2ZPL.pl
b/pbm2ZPL.pl
index
5c095af
..
967969b
100755
(executable)
--- a/
pbm2ZPL.pl
+++ b/
pbm2ZPL.pl
@@
-13,8
+13,9
@@
my $pnm_file = shift @ARGV || die "usage: $0 print.pnm";
open(my $fh, '<', $pnm_file);
my $p4 = <$fh>; chomp $p4;
die "no P4 header in [$p4] from $pnm_file" unless $p4 eq 'P4';
-my $size = <$fh>; chomp $size;
-my $size = <$fh>; chomp $size if $size =~ m/^#/;
+my $size = <$fh>;
+while ( $size =~ m/^#/ ) { $size = <$fh> }; # skip comments
+chomp $size;
my ( $w, $h ) = split(/ /,$size,$2);
warn "WARNING: width of $pnm_file not 832 but $w !\n" if $w != 832;
local $/ = undef;