Leser: 3
10 Einträge, 1 Seite |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#!/usr/bin/perl
use warnings;
use strict;
use Image::Magick;
my $filename = shift;
my $target = $filename;
$target =~ s/(\..*)$/_thumb$1/;
my $image = new Image::Magick;
$image->Read( $filename );
$image->Scale( '320x200' );
$image->Write( $target );
$image->Thumbnail(geometry => 'geometry', width=>100, height=>100);
$image->Thumbnail('100x100');
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
#!/usr/bin/perl use warnings; use strict; use Image::Magick; my $filename = shift; my $target = $filename; $target =~ s/(\..*$)/_thumb$1/; my $image = new Image::Magick; $image->Read( $filename ); my ($width, $height) = $image->get('width', 'height'); if ( $width > $height ) { my $diff = $width - $height; $width -= $diff; my $xoffset = ( $diff / 2 ); $image->Crop( geometry => "${width}x$height+$xoffset+0" ); } else { my $diff = $height - $width; $height -= $diff; my $yoffset = ( $diff / 2 ); $image->Crop( geometry => "${width}x$height+0+$yoffset" ); } $image->Scale( width => 100, height => 100 ); $image->Write( $target );
10 Einträge, 1 Seite |