projects
/
Printer-Zebra.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
0b31384
)
repeat previous line : is now supported
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Mon, 6 Feb 2012 18:34:38 +0000
(19:34 +0100)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Mon, 6 Feb 2012 18:34:38 +0000
(19:34 +0100)
pbm2ZPL.pl
patch
|
blob
|
history
diff --git
a/pbm2ZPL.pl
b/pbm2ZPL.pl
index
9652e2e
..
7223742
100755
(executable)
--- a/
pbm2ZPL.pl
+++ b/
pbm2ZPL.pl
@@
-66,11
+66,12
@@
sub zpl_compress {
foreach my $y ( 0 .. $h - 1 ) {
my $line = substr( $bitmap, $y * ( $w / 8 ), $w / 8 );
if ( $line eq $last_line ) {
foreach my $y ( 0 .. $h - 1 ) {
my $line = substr( $bitmap, $y * ( $w / 8 ), $w / 8 );
if ( $line eq $last_line ) {
- print ":" && warn "# $y repeat previous line\n";
+ print ':';
+ warn "# $y repeat previous line\n";
} else {
my $hex = unpack('H*', $line);
if ( $compress ) {
} else {
my $hex = unpack('H*', $line);
if ( $compress ) {
-
#
$last_line = $line;
+
$last_line = $line;
$hex =~ s/0+$/,/ && warn "# $y fill 0 to right\n";
$hex =~ s/F+$/!/i && warn "# $y fill 1 to right\n";
$hex =~ s/((.)\2+)/zpl_compress($1)/egs;
$hex =~ s/0+$/,/ && warn "# $y fill 0 to right\n";
$hex =~ s/F+$/!/i && warn "# $y fill 1 to right\n";
$hex =~ s/((.)\2+)/zpl_compress($1)/egs;