el problema esta en el GD alguien me diria que esta mal??
Código PHP:
<?php
require_once("../inc/config.php" ) ;
require_once("../inc/func.php" ) ;
// Path to the the requested file
$string = "_tn.";
$referer = $_SERVER['HTTP_REFERER'];
$ip = $_SERVER['REMOTE_ADDR'];
$defaultImage = "default.gif";
$path = $_SERVER['DOCUMENT_ROOT'].$_SERVER['REQUEST_URI'];
$path_parts = pathinfo($path) ;
$file_ext = strtolower($path_parts['extension']) ;
if ($file_ext == "bmp" ) {
$image = ImageCreateFromBMP(file_get_contents($path)) ;
} else {
// Load the requested image
$image = imagecreatefromstring(file_get_contents($path)) ;
}
$w = imagesx($image) ;
$h = imagesy($image) ;
if($watermarking=="1" ) {
if($w<"300" || $h<"300" ) {
$watermark = imagecreatefrompng('th_watermark.png') ;
}
else {
// Load the watermark image
$watermark = imagecreatefrompng('watermark.png') ;
}
$ww = imagesx($watermark) ;
$wh = imagesy($watermark) ;
// Merge watermark upon the original image
imagecopy($image, $watermark, $w-$ww, $h-$wh, 0, 0, $ww, $wh) ;
// Send the image
if ($file_ext == "bmp" ) {
header('Content-type: image/bmp') ;
imagebmp($image,$file="",$RLE=0) ;
imagedestroy($image) ;
exit() ; }
if ($file_ext == "png" ) {
header('Content-type: image/png') ;
imagepng($image) ;
imagedestroy($image) ;
exit() ; }
if ($file_ext == "gif" ) {
header('Content-type: image/gif') ;
imagegif($image) ;
imagedestroy($image) ;
exit() ; }
if ($file_ext == "jpg" ) {
header('Content-type: image/jpeg') ;
imagejpeg($image) ;
imagedestroy($image) ;
exit() ;}
if ($file_ext == "jpeg" ) {
header('Content-type: image/jpeg') ;
imagejpeg($image) ;
imagedestroy($image) ;
exit() ;}
}
// don't watermark if watermarking is disabled
if($watermarking=="0" ) {
if ($file_ext == "bmp" ) {
header('Content-type: image/bmp') ;
imagebmp($image,$file="",$RLE=0) ;
imagedestroy($image) ;
exit() ; }
if ($file_ext == "png" ) {
header('Content-type: image/png') ;
imagepng($image) ;
imagedestroy($image) ;
exit() ; }
if ($file_ext == "gif" ) {
header('Content-type: image/gif') ;
imagegif($image) ;
imagedestroy($image) ;
exit() ; }
if ($file_ext == "jpg" ) {
header('Content-type: image/jpeg') ;
imagejpeg($image) ;
imagedestroy($image) ;
exit() ;
}
if ($file_ext == "jpeg" ) {
header('Content-type: image/jpeg') ;
imagejpeg($image) ;
imagedestroy($image) ;
exit() ;}
}?>