L
L
Lorents2011-06-12 17:06:03
Perl
Lorents, 2011-06-12 17:06:03

Perl programming

Good afternoon!
There is one Perl project called Image PNG Rewriter . The essence of the work is to compress PNG using Compress-Deflate7 for this , but I still can’t get it to work, it doesn’t compress images.

It seems that everything is installed, the code is using the following parameters perl new.pl old.png new.png Algorithm 1 Pass 15 FastBytes 128 Cycles 2 I really hope for help

use Image::PNG::Rewriter;
use Compress::Deflate7;
use IO::File;
my ($in, $out) = splice @ARGV, 0, 2;
IO::File->new($out, '>:raw')->syswrite(
Image::PNG::Rewriter->new(handle => IO::File->new($in, '<:raw'), zlib => \&zlib7)->as_png
);
sub zlib7 {
Compress::Deflate7::zlib7($_[0], @ARGV);
}



Answer the question

In order to leave comments, you need to log in

3 answer(s)
A
afiskon, 2011-06-12
@afiskon

Rewrite your code in a human way so that it can be read. Look and see the error.

L
Lorents, 2011-06-12
@Lorents

I would love to, but the code is not mine, one person kindly wrote it to me. This is my first time working with Perl.

S
Sb0y, 2011-06-12
@Sb0y

>no errors, new.png is created, with the same size as old.png, but different MD5.
At first glance, it seems that some parameter is missing, and in my opinion, that determines the compression level.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question