After updating to custombuild1.1 phpinfo() prints about gd:
But when i try to work with .jpg-files (any .jpg file, i've test that) I see:
(pathes in example are fake, but in fact they are absolutely correct)
Rebuilding libjpeg didn't bring a success.
For any case, there is my example code wich brings an error in output:
Code:
GD Support enabled
GD Version bundled (2.0.34 compatible)
FreeType Support enabled
FreeType Linkage with freetype
FreeType Version 2.3.11
GIF Read Support enabled
GIF Create Support enabled
JPG Support enabled
PNG Support enabled
WBMP Support enabled
XBM Support enabled
Code:
Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: gd-jpeg: JPEG library reports unrecoverable error: in /home/blablabla/domains/blablabla/public_html/test.php on line 23
Warning: imagecreatefromjpeg() [function.imagecreatefromjpeg]: '/home/blablabla/domains/blablabla/public_html/uploads/blablabla.jpg' is not a valid JPEG file in /home/blablabla/domains/blablabla/public_html/test.php on line 23
Rebuilding libjpeg didn't bring a success.
For any case, there is my example code wich brings an error in output:
Code:
<?php
$sFileFullPath = "/home/blablabla/domains/blablabla/public_html/uploads/";
if (isset($_FILES['image']) and move_uploaded_file($_FILES['image']['tmp_name'],$sFileFullPath.$_FILES['image']['name'])){
if (!($aSize=getimagesize($sFileFullPath.$_FILES['image']['name']))) {
return false;
}
$img_src=false;
switch ($aSize['mime']) {
case 'image/png':
$img_src=imagecreatefrompng($sFileFullPath.$_FILES['image']['name']);
break;
case 'image/gif':
$img_src=imagecreatefromgif($sFileFullPath.$_FILES['image']['name']);
break;
case 'image/jpeg':
$img_src=imagecreatefromjpeg($sFileFullPath.$_FILES['image']['name']);
break;
default:
return false;
break;
}
$img_dest=imagecreatetruecolor(100,100);
if (imagecopyresampled($img_dest,$img_src,0,0,0,0,100,100,$aSize[0],$aSize[1])) {
imagedestroy($img_src);
switch ($aSize['mime']) {
case 'image/png':
if (imagepng($img_dest,$sFileFullPath)) {
chmod($sFileFullPath,0666);
return;
}
break;
case 'image/gif':
if (imagegif($img_dest,$sFileFullPath)) {
chmod($sFileFullPath,0666);
return;
}
break;
case 'image/jpeg':
if (imagejpeg($img_dest,$sFileFullPath)) {
chmod($sFileFullPath,0666);
return;
}
break;
}
}
}
?>