Ask for a custom function that determines the format of a picture
To determine the image format of the custom function, after writing has not been normal output, the picture is JPG format, without the custom function can output normally, the code is as follows:
function Image_check ($AA, $im)
{
$img =getimagesize ($AA);
Switch ($img [2])
{
Case 1;
[Email protected] ($AA);
Break
Case 2;
[Email protected] ($AA);
Break
Case 3;
[Email protected] ($AA);
Break
}
return $im;
}
$image = ' c:\www\news\Winter.jpg ';
Image_check ($image, $BB);
Header ("Content-type:image/jpeg");
Imagejpeg ($BB);
------Solution--------------------
function Image_check ($AA)
{
$img =getimagesize ($AA);
Switch ($img [2])
{
Case 1;
[Email protected] ($AA);
Break
Case 2;
[Email protected] ($AA);
Break
Case 3;
[Email protected] ($AA);
Break
}
return $im;
}
$image = ' c:\www\news\Winter.jpg ';
$BB =image_check ($image);
Header ("Content-type:image/jpeg");
Imagejpeg ($BB);
I have just looked at, it should be your transfer of the question, now I changed, you try to trial not