5 Einträge, 1 Seite |
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
30
31
#!/usr/bin/perl
use strict;
use Image::Size;
use Image::Magick;
my $file = '/home/format_c/Documents/Eigene Bilder/Beispiel.jpg';
my $new_file = '/home/format_c/Documents/Eigene Bilder/Beispiel_new.jpg';
my ($old_x,$old_y) = imgsize($file);
my $new_x = int $old_x / 2;
my $new_y = int $old_y / 2;
print "Old Size:\n";
print "X: $old_x --> $new_x\n";
print "Y: $old_y --> $new_y\n";
my $image = Image::Magick->new();
$image->Read($file);
$image->Set(size=>$new_x . "x" . $new_y);
$image->Write($new_file);
undef $image;
my ($x,$y) = imgsize($new_file);
print "New Size:\n";
print "X: $x\n";
print "Y: $y\n";
:! perl resize.pl
Old Size:
X: 283 --> 141
Y: 212 --> 106
New Size:
X: 283
Y: 212
5 Einträge, 1 Seite |