[From nobody Wed Mar  3 11:09:29 2021
To: 
Subject: 
Date: Tue, 8 Jun 2004 01:30:38 +0200 
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: message/rfc822

To: 
Subject: 
Date: Tue, 8 Jun 2004 01:30:38 +0200 
MIME-Version: 1.0
X-Mailer: Internet Mail Service (5.5.2653.19)
Content-Type: multipart/mixed; boundary=&quot;----_=_NextPart_004_01C44CE7.6B9FAF00&quot;


------_=_NextPart_004_01C44CE7.6B9FAF00
Content-Type: text/plain



------_=_NextPart_004_01C44CE7.6B9FAF00
Content-Type: text/plain;
	name=&quot;ATT17166.txt&quot;
Content-Disposition: attachment;
	filename=&quot;ATT17166.txt&quot;

Hi,

I have written a little testsuite performing several checks.
I hope it helps and that's what you expected. I post the result and the 
script. It's not clean, it's just a hack.

Taken from the ideas of Ernesto Baschny.


[Run: GraphicsMagick]   amsterdam.jpg   150             104.338884353638
[Run: ImageMagick]      amsterdam.jpg   150             116.749048233032
[Run: GraphicsMagick]   amsterdam.jpg   250             217.24009513855
[Run: ImageMagick]      amsterdam.jpg   250             238.112211227417
[Run: GraphicsMagick]   amsterdam.jpg   400             268.996000289917
[Run: ImageMagick]      amsterdam.jpg   400             314.572811126709
[Run: GraphicsMagick]   amsterdam.jpg   640             613.486051559448
[Run: ImageMagick]      amsterdam.jpg   640             741.302967071533
[Run: GraphicsMagick]   amsterdam.jpg   800             735.54515838623
[Run: ImageMagick]      amsterdam.jpg   800             919.518947601318
[Run: GraphicsMagick]   hochzeit.jpg    150             83.9288234710693
[Run: ImageMagick]      hochzeit.jpg    150             97.1081256866455
[Run: GraphicsMagick]   hochzeit.jpg    250             164.16597366333
[Run: ImageMagick]      hochzeit.jpg    250             188.657999038696
[Run: GraphicsMagick]   hochzeit.jpg    400             322.736024856567
[Run: ImageMagick]      hochzeit.jpg    400             365.272998809814
[Run: GraphicsMagick]   hochzeit.jpg    640             863.472938537598
[Run: ImageMagick]      hochzeit.jpg    640             943.603038787842
[Run: GraphicsMagick]   hochzeit.jpg    800             994.582891464233
[Run: ImageMagick]      hochzeit.jpg    800             1144.6578502655


Greeting Sven

------_=_NextPart_004_01C44CE7.6B9FAF00
Content-Type: application/x-perl;
	name=&quot;testsuite.pl&quot;
Content-Disposition: attachment;
	filename=&quot;testsuite.pl&quot;

#!/usr/bin/perl

#
# This script is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# The GNU General Public License can be found at
# http://www.gnu.org/copyleft/gpl.html.
#
# This script is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# This copyright notice MUST APPEAR in all copies of the script!
#

use strict;
use warnings;
use File::Copy;
use Time::HiRes qw(time tv_interval);

my %progs = ('im' =&gt; '/usr/bin/convert',
	     'gm' =&gt; '/opt/im/bin/gm convert');
my %Program = ('im' =&gt; 'ImageMagick',
	       'gm' =&gt; 'GraphicsMagick');

my @images = ('amsterdam.jpg', 'hochzeit.jpg');
my @sizes = qw[150 250 400 640 800];

my $testsuite = '/tmp/perl_testsuite';

sub setup_testsuite {
    if(!-d $testsuite) { mkdir $testsuite; }
    chdir($testsuite);

    # we expect the images under /tmp
    foreach(@images) { copy('/tmp/'.$_, $_); }
}

sub pre_run {
    # perform a pre_run so that libraries will be loaded
    # into ram
    my $cmd_im = sprintf(&quot;%s -size 800x800 -geometry 800x800 &quot; .
			 &quot;-quality 75 %s im_pre_run_%s&quot;,
			 $progs{im}, $images[0], $images[0]);
    my $cmd_gm = sprintf(&quot;%s -size 800x800 -geometry 800x800 &quot; .
			 &quot;-quality 75 %s gm_pre_run_%s&quot;,
			 $progs{gm}, $images[0], $images[0]);
    system($cmd_im);
    system($cmd_gm);
}

sub run_suite {
    my($start, $stop, $cmd, $prog, $img, $size, $result);
    foreach $img (@images) {
	foreach $size (@sizes) {
	    foreach $prog (keys %progs) {
		$cmd = sprintf(&quot;%s -size %sx%s -geometry %sx%s &quot;.
			       &quot;-quality 75 %s %s_%s_%s&quot;,
			       $progs{$prog}, $size, $size, $size, $size,
			       $img, $prog, $size, $img);
		$start = time();
		system($cmd);
		$stop = time();
		$result = sprintf(&quot;[Run: %s]\t%s\t%s\t\t%s \n&quot;,
				  $Program{$prog}, $img, $size,
				  (($stop - $start) * 1000));
		print($result);
	    }
	}
    }
}

setup_testsuite();
pre_run();
run_suite();

------_=_NextPart_004_01C44CE7.6B9FAF00--
]