karthikanov24 Posted August 10, 2009 Share Posted August 10, 2009 hi in admin module of plaincart(www.phpwebcommerce.com) if i add a new category and upload a jpg file,i cannot see the display of thumbnail..at running of the project.. I have attached : C:\wamp\www\plaincart\admin\library\functions.php C:\wamp\www\plaincart\admin\category\processcategory.php Refer funtions at line 56 and 74 at processcategory.php and refer functions at line 197 and 218 at funtions.php Also if i am trying to echo $srcFile,$destFile and $dest by inserting it in the lines 220,221,236 in funtion.php file as follow..i do not get the output of echo when running.. function createThumbnail($srcFile, $destFile, $width, $quality = 75) { $thumbnail = ''; if (file_exists($srcFile) && isset($destFile)) { $size = getimagesize($srcFile); $w = number_format($width, 0, ',', ''); $h = number_format(($size[1] / $size[0]) * $width, 0, ',', ''); $thumbnail = copyImage($srcFile, $destFile, $w, $h, $quality); } // return the thumbnail file name on sucess or blank on fail return basename($thumbnail); } /* Copy an image to a destination file. The destination image size will be $w X $h pixels */ function copyImage($srcFile, $destFile, $w, $h, $quality = 75) { [color=red]echo $srcFile; echo $destFile [/color] $tmpSrc = pathinfo(strtolower($srcFile)); $tmpDest = pathinfo(strtolower($destFile)); $size = getimagesize($srcFile); if ($tmpDest['extension'] == "gif" || $tmpDest['extension'] == "jpg") { $destFile = substr_replace($destFile, 'jpg', -3); $dest = imagecreatetruecolor($w, $h); imageantialias($dest, TRUE); } elseif ($tmpDest['extension'] == "png") { $dest = imagecreatetruecolor($w, $h); imageantialias($dest, TRUE); } else { return false; } [color=red]echo $dest;[/color] switch($size[2]) { case 1: //GIF $src = imagecreatefromgif($srcFile); break; case 2: //JPEG $src = imagecreatefromjpeg($srcFile); break; case 3: //PNG $src = imagecreatefrompng($srcFile); break; default: return false; break; } imagecopyresampled($dest, $src, 0, 0, 0, 0, $w, $h, $size[0], $size[1]); switch($size[2]) { case 1: case 2: imagejpeg($dest,$destFile, $quality); break; case 3: imagepng($dest,$destFile); } return $destFile; } [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/169591-the-thumbnail-is-not-displayed-when-a-new-category-is-added/ Share on other sites More sharing options...
karthikanov24 Posted August 11, 2009 Author Share Posted August 11, 2009 hi Quote Link to comment https://forums.phpfreaks.com/topic/169591-the-thumbnail-is-not-displayed-when-a-new-category-is-added/#findComment-895313 Share on other sites More sharing options...
karthikanov24 Posted August 11, 2009 Author Share Posted August 11, 2009 hi could u give me solution for my first post plz... Quote Link to comment https://forums.phpfreaks.com/topic/169591-the-thumbnail-is-not-displayed-when-a-new-category-is-added/#findComment-895412 Share on other sites More sharing options...
infiniteacuity Posted August 14, 2009 Share Posted August 14, 2009 Have you confirmed the jpg is actually uploaded to the server and viewable by going directly to it before determining this is a PHP issue? Quote Link to comment https://forums.phpfreaks.com/topic/169591-the-thumbnail-is-not-displayed-when-a-new-category-is-added/#findComment-898116 Share on other sites More sharing options...
karthikanov24 Posted August 22, 2009 Author Share Posted August 22, 2009 hi could u say me what is the code and where to insert it, to check whehter the jpeg file stored in temporary folder in server and how to view it.... Quote Link to comment https://forums.phpfreaks.com/topic/169591-the-thumbnail-is-not-displayed-when-a-new-category-is-added/#findComment-903983 Share on other sites More sharing options...
karthikanov24 Posted August 25, 2009 Author Share Posted August 25, 2009 hi can u give me the solution for my above question..... Quote Link to comment https://forums.phpfreaks.com/topic/169591-the-thumbnail-is-not-displayed-when-a-new-category-is-added/#findComment-905549 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.