Requirements ... PHP and such
Posted: 26 Jul 2008, 16:21
What actually are the requirements , PHP and such to run Imagevue V2 beta ?
I ask this because on one server its working and on one it ain;t.
PHP INFO from server where it isn;t working :
http://www.pfsquad.nl/phpversie.php
Getting this error :
======================================
type; var $imageinfo; var $imagepath; var $new_x; var $new_y; var $debug; function ivImage($path) { if (!extension_loaded('gd')) die ('
You have to install GD2 extension, to do that uncomment in php.ini line which starts with:
;extension=php_gd2...
'); return ($this->_init($path)); } function _init($path) { //$this->debug=0; if (!file_exists($path)) return -1; $this->imageinfo=array(); list($this->imageinfo['width'], $this->imageinfo['height'], $this->imageinfo['type']) = getimagesize($path); //Returns an array with 4 elements. Index 0 contains the width of the image in pixels. Index 1 contains the height. Index 2 is a flag indicating the type of the image: 1 = GIF, 2 = JPG, 3 = PNG, 4 = SWF, 5 = PSD, 6 = BMP, 7 = TIFF(intel byte order), 8 = TIFF(motorola byte order), 9 = JPC, 10 = JP2, 11 = JPX, 12 = JB2, 13 = SWC, 14 = IFF, 15 = WBMP, 16 = XBM. These values correspond to the IMAGETYPE constants that were added in PHP 4.3.0. Index 3 is a text string with the correct height="yyy" width="xxx" string that can be used directly in an IMG tag. $this->imagetype=$this->imageinfo['type']; unset ($this->imageinfo['type']); $this->imageinfo['date']=filectime($path); $this->imageinfo['size']=filesize($path); switch ($this->imagetype) { case IMAGETYPE_GIF: $this->imageData=imagecreatefromgif($path); break; case IMAGETYPE_JPEG: $this->imageData=imagecreatefromjpeg ($path); break; case IMAGETYPE_PNG: $this->imageData=imagecreatefrompng($path); break; } if ($this->imageData) $this->imagepath=$path; return true; } //$img->rotate( cw,ccw ); // 90' function rotate ($direction='cw') { if (is_string($direction) and $direction=='cw') $angle=-90; else $angle=90; if (is_numeric($direction)) $angle=$direction; $this->imageData = imagerotate($this->imageData, $angle, 0xFFFFFF); } //creates image file /* function getimage($path='') { if ($path=='') { header ("Content-type: ".image_type_to_mime_type($this->imagetype)); } switch ($this->imagetype) { case IMAGETYPE_GIF: imagegif( $this->imageData, $path, 80 ); break; case IMAGETYPE_JPEG: imagejpeg ($this->imageData, $path, 80); break; case IMAGETYPE_PNG: imagepng($this->imageData, $path, 80); break; } } */ function getimage($path='') { if ($path=='') { header ("Content-type: ".image_type_to_mime_type(IMAGETYPE_JPEG)); } imagejpeg ($this->imageData, $path, 80); } //makethumb //creates file.jpg function write($newpath='') { if ($newpath) $path=$newpath; else $path=$this->imagepath; $this->getimage($path); } /** * Crops image by size and start coordinates * * @param int width Cropped image width * @param int height Cropped image height * @param int x X-coordinate to crop at * @param int y Y-coordinate to crop at * * @return bool|PEAR_Error TRUE or a PEAR_Error object on error * @access public */ function crop($width, $height) { $x = floor(($this->imageinfo['width'] - $width)/2); $y = floor(($this->imageinfo['height'] - $height)/2); $new_img = imagecreatetruecolor($width, $height); // if ($this->debug) echo $x,$y; // imagecopy( //resource $dst_im, //� //resource $src_im, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_w, int $src_h) // if (!imagecopy($new_img, $this->imageData, 0, 0, $x, $y, $width, $height)) { imagedestroy($new_img); return 0; } $this->old_image = $this->imageData; $this->imageData = $new_img; $this->resized = true; $this->new_x = $width; $this->new_y = $height; return true; } /** * Resize Action * * For GD 2.01+ the new copyresampled function is used * It uses a bicubic interpolation algorithm to get far * better result. * * * @param int $new_x New width * @param int $new_y New height * @param mixed $options Optional parameters * * @return bool|PEAR_Error TRUE on success or PEAR_Error object on error * @access protected */ function resize($new_x, $new_y) { // Make sure to get a true color image if doing resampled resizing // otherwise get the same type of image $new_img = imagecreatetruecolor($new_x, $new_y); //if (function_exists('ImageCopyResampled')) { //$icr_res = ImageCopyResampled($new_img, $this->imageData, 0, 0, 0, 0, $new_x, $new_y, $this->imageinfo['width'], $this->imageinfo['height']); //} $this->old_image = $this->imageData; $this->imageData = $new_img; $this->resized = true; $this->imageinfo['width'] = $new_x; $this->imageinfo['height'] = $new_y; return true; } function makeThumb($boxwidth=120, $boxheight=80,$resizetype = "croptobox", $keepaspect=true, $allowscaleup=false ) { //resizetypes = [ resizetobox, croptobox ] // // // $keepaspect = true; // $allowscaleup = false; //--------------------- $originalwidth=$this->imageinfo['width']; $originalheight=$this->imageinfo['height']; if (!$originalwidth or !$originalheight) return false; //$imagewidth = $originalwidth; //$imageheight = $originalheight; $boxaspect = $boxwidth/$boxheight; $originalaspect = $originalwidth/$originalheight; if($resizetype=="croptobox") { if ($this->debug) echo "croptobox
"; if($boxaspect > $originalaspect){ if($allowscaleup || $originalwidth > $boxwidth){ $imagewidth = $boxwidth; $imageheight = round($originalheight/($originalwidth/$boxwidth)); } // $cropx1 = 0; // $cropy1 = round($imageheight/2 - $boxheight/2); // $cropx2 = $imagewidth; // $cropy2 = round($imageheight/2 - $boxheight/2); // $cropx3 = $imagewidth; // $cropy3 = round($imageheight/2 + $boxheight/2); // $cropx4 = 0; // $cropy4 = round($imageheight/2 + $boxheight/2); } else { if($allowscaleup || $originalheight > $boxheight){ $imagewidth = round($originalwidth/($originalheight/$boxheight)); $imageheight = $boxheight; } // $cropx1 = round($imagewidth/2 - $boxwidth/2); // $cropy1 = 0; // $cropx2 = round($imagewidth/2 + $boxwidth/2); // $cropy2 = 0; // $cropx3 = round($imagewidth/2 + $boxwidth/2); // $cropy3 = $imagewidth; // $cropx4 = round($imagewidth/2 - $boxwidth/2); // $cropy4 = $imagewidth; } } else // resizetobox { if ($this->debug) echo "resizetobox
"; if($keepaspect){ if ($this->debug) echo "keepaspect
"; if($boxaspect > $originalaspect){ if ($this->debug) echo "boxaspect gt original"; if($allowscaleup || $originalheight > $boxheight){ $imagewidth = round($originalwidth/($originalheight/$boxheight)); $imageheight = $boxheight; } } else { if ($this->debug) echo "boxaspect lt original
"; if($allowscaleup || $originalwidth > $boxwidth){ $imagewidth = $boxwidth; $imageheight = round($originalheight/($originalwidth/$boxwidth)); } } } else { if ($this->debug) echo "nokeepaspect
"; if($allowscaleup){ if ($this->debug) echo "allowscaleup
"; $imagewidth = $boxwidth; $imageheight = $boxheight; } else { if ($this->debug) echo "noallowscaleup
"; if($boxwidth > $originalwidth){ $imagewidth = $originalwidth; } else { $imagewidth = $boxwidth; } if($boxheight > $originalheight){ $imageheight = $originalheight; } else { $imageheight = $boxheight; } } } } if ($this->debug) dump ( array ( 'imgwidth'=>$imagewidth, 'imgheight'=>$imageheight, 'boxwidth'=>$boxwidth, 'boxheight'=>$boxheight ) ); if (isset($imagewidth) and isset ($imageheight))$this->resize($imagewidth, $imageheight); if ($resizetype=='croptobox') { $this->crop($boxwidth,$boxheight); } /*else { $newboxwidth=($boxwidth>$imagewidth)?$imagewidth:0; $newboxheight=($boxheight>$imageheight)?$imageheight:0; if ($newboxwidth and $newboxheight) { dump ( array ( 'warning'=>'RECROP', 'newboxwidth'=>$newboxwidth, 'newboxheight'=>$newboxheight ) ); $this->crop($newboxwidth,$newboxheight); } } */ return true; } // mthumb } ?>
Fatal error: Cannot redeclare class ivLayout in /home/pfsquad/domains/pfsquad.nl/public_html/NEW/imagevue/include/ivLayout.class.php on line 37
======================================
PHP INFO form server where it is working :
http://chocolate.alphamegahosting.com/am-phpinfo.php
Preview : www2.writeitdown.nl/NEW/
If anyone could clear this up I would appreciate it
EDIT :
Have updated php ... but still same error persists.
I ask this because on one server its working and on one it ain;t.
PHP INFO from server where it isn;t working :
http://www.pfsquad.nl/phpversie.php
Getting this error :
======================================
type; var $imageinfo; var $imagepath; var $new_x; var $new_y; var $debug; function ivImage($path) { if (!extension_loaded('gd')) die ('
You have to install GD2 extension, to do that uncomment in php.ini line which starts with:
;extension=php_gd2...
'); return ($this->_init($path)); } function _init($path) { //$this->debug=0; if (!file_exists($path)) return -1; $this->imageinfo=array(); list($this->imageinfo['width'], $this->imageinfo['height'], $this->imageinfo['type']) = getimagesize($path); //Returns an array with 4 elements. Index 0 contains the width of the image in pixels. Index 1 contains the height. Index 2 is a flag indicating the type of the image: 1 = GIF, 2 = JPG, 3 = PNG, 4 = SWF, 5 = PSD, 6 = BMP, 7 = TIFF(intel byte order), 8 = TIFF(motorola byte order), 9 = JPC, 10 = JP2, 11 = JPX, 12 = JB2, 13 = SWC, 14 = IFF, 15 = WBMP, 16 = XBM. These values correspond to the IMAGETYPE constants that were added in PHP 4.3.0. Index 3 is a text string with the correct height="yyy" width="xxx" string that can be used directly in an IMG tag. $this->imagetype=$this->imageinfo['type']; unset ($this->imageinfo['type']); $this->imageinfo['date']=filectime($path); $this->imageinfo['size']=filesize($path); switch ($this->imagetype) { case IMAGETYPE_GIF: $this->imageData=imagecreatefromgif($path); break; case IMAGETYPE_JPEG: $this->imageData=imagecreatefromjpeg ($path); break; case IMAGETYPE_PNG: $this->imageData=imagecreatefrompng($path); break; } if ($this->imageData) $this->imagepath=$path; return true; } //$img->rotate( cw,ccw ); // 90' function rotate ($direction='cw') { if (is_string($direction) and $direction=='cw') $angle=-90; else $angle=90; if (is_numeric($direction)) $angle=$direction; $this->imageData = imagerotate($this->imageData, $angle, 0xFFFFFF); } //creates image file /* function getimage($path='') { if ($path=='') { header ("Content-type: ".image_type_to_mime_type($this->imagetype)); } switch ($this->imagetype) { case IMAGETYPE_GIF: imagegif( $this->imageData, $path, 80 ); break; case IMAGETYPE_JPEG: imagejpeg ($this->imageData, $path, 80); break; case IMAGETYPE_PNG: imagepng($this->imageData, $path, 80); break; } } */ function getimage($path='') { if ($path=='') { header ("Content-type: ".image_type_to_mime_type(IMAGETYPE_JPEG)); } imagejpeg ($this->imageData, $path, 80); } //makethumb //creates file.jpg function write($newpath='') { if ($newpath) $path=$newpath; else $path=$this->imagepath; $this->getimage($path); } /** * Crops image by size and start coordinates * * @param int width Cropped image width * @param int height Cropped image height * @param int x X-coordinate to crop at * @param int y Y-coordinate to crop at * * @return bool|PEAR_Error TRUE or a PEAR_Error object on error * @access public */ function crop($width, $height) { $x = floor(($this->imageinfo['width'] - $width)/2); $y = floor(($this->imageinfo['height'] - $height)/2); $new_img = imagecreatetruecolor($width, $height); // if ($this->debug) echo $x,$y; // imagecopy( //resource $dst_im, //� //resource $src_im, int $dst_x, int $dst_y, int $src_x, int $src_y, int $src_w, int $src_h) // if (!imagecopy($new_img, $this->imageData, 0, 0, $x, $y, $width, $height)) { imagedestroy($new_img); return 0; } $this->old_image = $this->imageData; $this->imageData = $new_img; $this->resized = true; $this->new_x = $width; $this->new_y = $height; return true; } /** * Resize Action * * For GD 2.01+ the new copyresampled function is used * It uses a bicubic interpolation algorithm to get far * better result. * * * @param int $new_x New width * @param int $new_y New height * @param mixed $options Optional parameters * * @return bool|PEAR_Error TRUE on success or PEAR_Error object on error * @access protected */ function resize($new_x, $new_y) { // Make sure to get a true color image if doing resampled resizing // otherwise get the same type of image $new_img = imagecreatetruecolor($new_x, $new_y); //if (function_exists('ImageCopyResampled')) { //$icr_res = ImageCopyResampled($new_img, $this->imageData, 0, 0, 0, 0, $new_x, $new_y, $this->imageinfo['width'], $this->imageinfo['height']); //} $this->old_image = $this->imageData; $this->imageData = $new_img; $this->resized = true; $this->imageinfo['width'] = $new_x; $this->imageinfo['height'] = $new_y; return true; } function makeThumb($boxwidth=120, $boxheight=80,$resizetype = "croptobox", $keepaspect=true, $allowscaleup=false ) { //resizetypes = [ resizetobox, croptobox ] // // // $keepaspect = true; // $allowscaleup = false; //--------------------- $originalwidth=$this->imageinfo['width']; $originalheight=$this->imageinfo['height']; if (!$originalwidth or !$originalheight) return false; //$imagewidth = $originalwidth; //$imageheight = $originalheight; $boxaspect = $boxwidth/$boxheight; $originalaspect = $originalwidth/$originalheight; if($resizetype=="croptobox") { if ($this->debug) echo "croptobox
"; if($boxaspect > $originalaspect){ if($allowscaleup || $originalwidth > $boxwidth){ $imagewidth = $boxwidth; $imageheight = round($originalheight/($originalwidth/$boxwidth)); } // $cropx1 = 0; // $cropy1 = round($imageheight/2 - $boxheight/2); // $cropx2 = $imagewidth; // $cropy2 = round($imageheight/2 - $boxheight/2); // $cropx3 = $imagewidth; // $cropy3 = round($imageheight/2 + $boxheight/2); // $cropx4 = 0; // $cropy4 = round($imageheight/2 + $boxheight/2); } else { if($allowscaleup || $originalheight > $boxheight){ $imagewidth = round($originalwidth/($originalheight/$boxheight)); $imageheight = $boxheight; } // $cropx1 = round($imagewidth/2 - $boxwidth/2); // $cropy1 = 0; // $cropx2 = round($imagewidth/2 + $boxwidth/2); // $cropy2 = 0; // $cropx3 = round($imagewidth/2 + $boxwidth/2); // $cropy3 = $imagewidth; // $cropx4 = round($imagewidth/2 - $boxwidth/2); // $cropy4 = $imagewidth; } } else // resizetobox { if ($this->debug) echo "resizetobox
"; if($keepaspect){ if ($this->debug) echo "keepaspect
"; if($boxaspect > $originalaspect){ if ($this->debug) echo "boxaspect gt original"; if($allowscaleup || $originalheight > $boxheight){ $imagewidth = round($originalwidth/($originalheight/$boxheight)); $imageheight = $boxheight; } } else { if ($this->debug) echo "boxaspect lt original
"; if($allowscaleup || $originalwidth > $boxwidth){ $imagewidth = $boxwidth; $imageheight = round($originalheight/($originalwidth/$boxwidth)); } } } else { if ($this->debug) echo "nokeepaspect
"; if($allowscaleup){ if ($this->debug) echo "allowscaleup
"; $imagewidth = $boxwidth; $imageheight = $boxheight; } else { if ($this->debug) echo "noallowscaleup
"; if($boxwidth > $originalwidth){ $imagewidth = $originalwidth; } else { $imagewidth = $boxwidth; } if($boxheight > $originalheight){ $imageheight = $originalheight; } else { $imageheight = $boxheight; } } } } if ($this->debug) dump ( array ( 'imgwidth'=>$imagewidth, 'imgheight'=>$imageheight, 'boxwidth'=>$boxwidth, 'boxheight'=>$boxheight ) ); if (isset($imagewidth) and isset ($imageheight))$this->resize($imagewidth, $imageheight); if ($resizetype=='croptobox') { $this->crop($boxwidth,$boxheight); } /*else { $newboxwidth=($boxwidth>$imagewidth)?$imagewidth:0; $newboxheight=($boxheight>$imageheight)?$imageheight:0; if ($newboxwidth and $newboxheight) { dump ( array ( 'warning'=>'RECROP', 'newboxwidth'=>$newboxwidth, 'newboxheight'=>$newboxheight ) ); $this->crop($newboxwidth,$newboxheight); } } */ return true; } // mthumb } ?>
Fatal error: Cannot redeclare class ivLayout in /home/pfsquad/domains/pfsquad.nl/public_html/NEW/imagevue/include/ivLayout.class.php on line 37
======================================
PHP INFO form server where it is working :
http://chocolate.alphamegahosting.com/am-phpinfo.php
Preview : www2.writeitdown.nl/NEW/
If anyone could clear this up I would appreciate it
EDIT :
Have updated php ... but still same error persists.