PerlMagick is an object-oriented Perl interface to ImageMagick. Use this forum to discuss, make suggestions about, or report bugs concerning PerlMagick.
#!/usr/bin/env perl
use strict;
use Cwd;
use Image::Magick;
sub montage {
my $cwd = getcwd();
my $montage = new Image::Magick;
$montage -> Read($_[0], $_[1]);
my $filename = sprintf "%s/my_montage", $cwd;
$montage -> Montage();
$montage -> Write($filename);
}
&montage($ARGV[0], $ARGV[1]);
However, this code does not work:
it produces an image called my_montage-0 instead of my_montage
it doesn't produce a the image that (pseudocode) montage $ARGV[0] $ARGV[1] my_montage would have produced on the command line
In case they're interesting, my system specs are: This is perl, v5.10.1 (*) built for x86_64-linux-gnu-thread-multi
ImageMagick 6.5.7-8 2010-12-02 Q16
PerlMagick 7:6.5.7.8-1ubuntu1
#!/usr/bin/env perl
use strict;
use Cwd;
use Image::Magick;
sub montage {
my $cwd = getcwd();
my $images = new Image::Magick;
$images -> Read($_[0], $_[1]);
my $filename = sprintf "%s/my_montage.png", $cwd;
my $montage = $images -> Montage();
$montage -> Write($filename);
}
&montage($ARGV[0], $ARGV[1]);
For some reason, the extension is required in the filename. The following line does not work: