Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
#!/usr/bin/perl
sub jpg_resize
{
use GD;
#settings--------------------------------------
my $source_file = "";
my $target_file = "";
my $jpeg_quality = 60; #Quality
my $max_sizex = 220; #max picturewith
my $max_sizey = 220; #max pictureheight
#----------------------------------------------
$source_file = shift();
$target_file = shift();
GD::Image->trueColor(1); #improves quality
my $bildle = newFromJpeg GD::Image($source_file, 1) || die "could not open image."; #Bild ffnen...
#find size-------------------------------------
(my $width, my $height) = $bildle->getBounds(); #Mae herausfinden...
if ($width > $height)
{$max_sizey = $height / ($width / $max_sizex);}
else
{$max_sizex = $width / ($height / $max_sizey);}
#create new picture (thumbnail)
my $bild=newTrueColor GD::Image($max_sizex,$max_sizey);
$bild->copyResized($bildle,0,0,0,0,$max_sizex,$max_sizey,$width,$height);
$bild->interlaced('true');
#save the new picture...
open(DATEI ,">$target_file") || die "could not write image: $!";
binmode DATEI;
print DATEI ($bild->jpeg($jpeg_quality));
close(DATEI);
return('true');
}