Welcome Guest, Not a member yet? Register   Sign In
problem with big images
#1

[eluser]krishnakumar2k[/eluser]
am having problem with rotating big images .getting "NetworkError: 500 Internal Server Error
same is working fine with my server.problem is with client server.
my function


public function setImage($image,$cropw,$croph,$flag){
//ini_set('memory_limit', '260M');
//Your Image
if($flag == 1) {
$degrees = 90;
// Load
$source = imagecreatefromjpeg($image);
// Rotate
$rotate = imagerotate($source, $degrees, 0);
imagejpeg($rotate,$image);
$temp = $cropw;
$cropw = $croph;
$croph = $temp;
}
$this->imgSrc = $image;
//getting the image dimensions
list($width, $height) = getimagesize($this->imgSrc);
//create image from the jpeg
$this->myImage = imagecreatefromjpeg($this->imgSrc) or die("Error: Cannot find image!");
if($width > $height){ $biggestSide = $width; }//find biggest length
else { $biggestSide = $height; }
//The crop size will be half that of the largest side
/*$cropPercent = .5; // This will zoom in to 50% zoom (crop)
$this->cropWidth = $biggestSide*$cropPercent;
$this->cropHeight = $biggestSide*$cropPercent; */
$this->cropWidth = $cropw;
$this->cropHeight = $croph;
//getting the top left coordinate
$this->x = ($width-$this->cropWidth)/2;
$this->y = ($height-$this->cropHeight)/2;
$this->thumb = @imagecreatetruecolor($this->cropWidth, $this->cropHeight);
//echo $this->thumb;exit;
@imagecopyresampled($this->thumb, $this->myImage, 0, 0,$this->x, $this->y, $this->cropWidth, $this->cropHeight, $this->cropWidth, $this->cropHeight);
//echo $this->thumb;exit;
if($flag == 1) {
$degree = 270;
$source = $this->thumb;
$this->thumb = imagerotate($source,$degree,0);
-------------------------------------------------------------------here i gets the error
}
imagejpeg($this->thumb,$image,100);
imagedestroy($this->thumb);
}


any idea ?
#2

[eluser]cahva[/eluser]
If you have "500 Internal Server Error", check your webserver error log. In there you can find there more detailed description of the error.
#3

[eluser]InsiteFX[/eluser]
Also please use the code tags when listing your code!

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB