if ($cmd eq "add" || $cmd eq "mod")
{
get "Id==$_put_last{Id}","foto_foto";
# mod "Id==$_put_last{Id}", ["Thumb","Thumb"], "foto_foto";
$nummer=$_put_last{Id};
$pic=$Bild;
($x,$y,$size,$comm)=get ["width","height","filesize","comment"],"_files/$pic";
out "Info: $x - $y - $size - $comm - $_put_last{Id}<br>";
if ($x > 500)
{
$faktor=$x/500;
}
else
{
$faktor=1;
}
if ($x > $y)
{
$faktor_th=$x/100;
}
else
{
$faktor_th=$y/100;
}
out "Faktor: $faktor<br>";
$neu="bb_foto_$nummer.jpg";
$thumb="th_bb_foto_$nummer.jpg";
$name="nnn";
mod "Copy",{target=>$thumb},"_files/$pic";
mod "Rename",{target=>$neu},"_files/$pic";
my @aktionen;
push (@aktionen,["resize",{width=>int($x/$faktor),height=>int($y/$faktor)}]);
push (@aktionen,["Rename",{target=>$neu}]);
mod @aktionen,"_files/$neu";
my @aktionen_th;
push (@aktionen_th,["resize",{width=>int($x/$faktor_th),height=>int($y/$faktor_th)}]);
push (@aktionen_th,["Rename",{target=>$thumb}]);
mod @aktionen_th,"_files/$thumb";
out "Bild wurde skaliert und Vorschaubild erstellt!<br><img src=\"http://www.nnn.de/files/$thumb\"><br>Dateinamen: $neu - $thumb";
mod "Id==$nummer", ["Bild","$neu","Thumb","$thumb"], "foto_foto";
}