Okay, ich bin kein php-ler, hoffe trotzdem, ich bekomme die richtigen Zeilen hin:
1. updatechapter.php
2. setup.php
3. bookcontents.php (dies wird das PopUp-Menü für die Bildgrösse sein)
4.) editpage.php
5. frontpage.php
Das "Testbild" hat das Script bei der nstallation übrigens problemlos akzeptiert.
merci
tinu
1. updatechapter.php
PHP:
// fix the big image if it is too big
if($maxwidth == ""){ $maxwidth = 300; }
if (($width > $maxwidth) && ($Processor != "none")){
$high_res = $imagename . "_high" . $ext;
copy("$dirpath/$largeimage", "$dirpath/$high_res");
chmod("$dirpath/$high_res", 0777);
if ($Processor == "ImageMagick"){
system("$imagemagic -geometry $maxwidthx100 $dirpath/$largeimage $dirpath/$largeimage");
chmod("$dirpath/$largeimage", 0777);
}
2. setup.php
PHP:
//ImageMagick
if ( $Processor == "ImageMagick"){
$tryone = file_exists("$pathtoproccess/utilities/convert");
$fullpathtoit = "$pathtoproccess/utilities/convert";
if (!$tryone){
$tryone = file_exists("$pathtoproccess/convert");
$fullpathtoit = "$pathtoproccess/convert";
if(!$tryone){
$errors .= "<li>Can not locate ImageMagick convert program.. ";
$errors .= "The program is looking for it at the full path of <b>$pathtoproccess</b> or <b>$pathtoproccess/utilities/</b>";
$errors .= "Make sure that the path does not contain a ending slash.. If your server will let you you might ";
$errors .= "be able to run a locate to try to find the path. IF YOU DO NOT HAVE this program you can download it or try NetPBM ";
} else {
$pathtoproccess = "$pathtoproccess/utilities/";
}
}
// if no errors try thumbnailing the test image.
if($errors == ""){
system("$fullpathtoit -geometry 10000x75 test.jpg userimages/test.jpg");
chmod ("userimages/test.jpg", 0777);
$info = stat("userimages/test.jpg");
if(($info[7] == 0) || ($info[7] == "") ){
$errors .= "Error Running ImageMagick on test image.. could not thumbnail test.jpg to userimages... ";
$errors .= "<font color=007700>How to fix this:</font><ul>";
$errors .= "<li>Make sure that the binaries are executable in <b>$pathtoproccess</b> they should all be chmod 755 to do this in ws_ftp right hand click on the files and select chmod";
$errors .= "<li>Make sure that <a href=test.jpg target=_blank>This image exists.</a> it is the test image for the installation.. ";
$errors .= "<li>Make sure that the binaries you downloaded are the correct compiled binaries. For example if you are running red hat linux and you downloaded the Freebsd file it is NOT going to work..";
$errors .= "<li>If all else fails try a different proccessor.. </ul>";
}
}
}
3. bookcontents.php (dies wird das PopUp-Menü für die Bildgrösse sein)
PHP:
<input type=FILE size=35 name=myfile ><br>
<? if ( ($Processor == "netpbm") || ($Processor == "ImageMagick") ){ ?>
re-size new image to: <select name=maxwidth><option>500</option><option>450</option><option>400</option><option>350</option><option SELECTED>300</option><option>250</option><option>200</option><option>150</option><option>100</option></select>width
<? } ?><br><br>
</td></tr>
4.) editpage.php
PHP:
// fix the big image if it is too big
if($maxwidth == ""){ $maxwidth = 300; }
if (($width > $maxwidth) && ($Processor != "none")){
$high_res = $imagename . "_high" . $ext;
copy("$dirpath/$largeimage", "$dirpath/$high_res");
chmod("$dirpath/$high_res", 0777);
if ($Processor == "ImageMagick"){
system("$imagemagic -geometry $maxwidthx10000 $dirpath/$largeimage $dirpath/$largeimage");
chmod("$dirpath/$largeimage", 0777);
}
if ($Processor == "netpbm"){
if ($ext == ".jpg"){
system("$imagemagic/pnmscale --quiet -width $maxwidth $dirpath/$imagename.pnm > $nextpath");
chmod("$nextpath", 0777);
system("$imagemagic/ppmtojpeg --quiet $nextpath > $dirpath/$largeimage");
chmod("$dirpath/$largeimage", 0777);
}
5. frontpage.php
PHP:
// if we are changing proccessors..
if( ($newProcessor != $Processor) || ($pathtoproccess != $imagemagic)){
if( $newProcessor == "ImageMagick"){
$tryone = file_exists("$pathtoproccess/utilities/convert");
$fullpathtoit = "$pathtoproccess/utilities/convert";
if (!$tryone){
$tryone = file_exists("$pathtoproccess/convert");
$fullpathtoit = "$pathtoproccess/convert";
if(!$tryone){
$errors .= "<li>Can not locate ImageMagick convert program.. ";
$errors .= "The program is looking for it at the full path of <b>$pathtoproccess</b> or <b>$pathtoproccess/utilities/</b>";
$errors .= "Make sure that the path does not contain a ending slash.. If your server will let you you might ";
$errors .= "be able to run a locate to try to find the path. IF YOU DO NOT HAVE this program you can download it or try NetPBM ";
} else {
$pathtoproccess = "$pathtoproccess/utilities/";
}
}
// if no errors try thumbnailing the test image.
Das "Testbild" hat das Script bei der nstallation übrigens problemlos akzeptiert.
merci
tinu