From:             [EMAIL PROTECTED]
Operating system: Win 2000
PHP version:      4.0.5
PHP Bug Type:     GD related
Bug description:  GD not working on digitalcamera jpg's

Look at the bugs for GetImageSize. I guess it's the same JPG problem with GD functions.

This function works perfect with most jpg's but when uploading pictures from digital 
cameras it does nothing. 

function resize($bildet, $forholdstall) {
        $size = GetImageSize("$bildet");
        $width = $size[0];
        $height = $size[1];
        echo "Skalerer...";
        //regner ut forholdstall
        if ($width > $height) # resize ny bildestørrelse 
                $utregnettall = ($width / $forholdstall);
                $width = $forholdstall;
                $height = (int)($height / $utregnettall);
                $utregnettall = ($height / $forholdstall);
                $height = $forholdstall;
                $width = (int)($width / $utregnettall);
        if (strpos("$bildet", ".jpg") || strpos("$bildet", ".jpeg")) {
                $status = true;
                $img_in = ImageCreateFromJPEG("$bildet");

                // den resiza fila skal være så mye mindre:
                $img_out = ImageCreate($width, $height);
                ImageCopyResized($img_out, $img_in,0,0,0,0, $width, $height, $size[0], 
                ImageJPEG($img_out, "$bildet");
        else {
                $status = false;
        $retur = array(
                "error" => $status,
                "height" => $height,
                "width" => $width
        return $retur;
}# function resize

Edit Bug report at:

PHP Development Mailing List <>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to