Guest jazzmeister Posted May 4, 2005 Share Posted May 4, 2005 Can anyone tell me where I can find a patch or code for uploading GIF's in Cube Cart? Yes I know it is not supported, and that it is illeagel in some countries, but if anyone knows where I can get some help on this, that would be cool. Thanks Quote Link to comment Share on other sites More sharing options...
xyncro Posted May 4, 2005 Share Posted May 4, 2005 ... .. ...never heard of any patch like this to the Cube... wouldn't this 'patch' you're asking for happen to be a ftp client...?? they are widely spread all over the net... just gooooogle... you can then with this favorite ftp client upload anything to your Cube... hope it helped... Quote Link to comment Share on other sites More sharing options...
Guest billmc Posted May 4, 2005 Share Posted May 4, 2005 Hi jazzmeister, In CC2 you must have gd2 available and edit make_thumb.txt to enable *.gif files. Don't know about CC3 billmc Quote Link to comment Share on other sites More sharing options...
Guest jazzmeister Posted May 4, 2005 Share Posted May 4, 2005 Thanks for your reply Bill I tried editing the make_thumb.txt in CC3, but this causes errors. Any idea how exactly you would script it in CC2 so I can compare my code? Thanks Quote Link to comment Share on other sites More sharing options...
Guest billmc Posted May 4, 2005 Share Posted May 4, 2005 Hi, I have yet to test this on linux but here is the logic 1. I am assuming gd2 enabled 2. Remove the error checking 3. Make the gif thumb 4. Save the gif thumb I have attached the modded CC2 makethumb.txt hth billmc <? /*************************************************************************** *  Copyright:    Copyright 2003 http://www.brooky.com *     ***************************************************************************/ // CONFIGURATION FOR THUMBNAILS // FOR GD VERSION 1.6 (default) SET $gd_version=1; // FOR GD VERSION 2.0+ FOR IMPROVED THUMBNAILS SET $gd_version=2; // IF YOU DO NOT HAVE GD SET $gd_version=0; $gd_version=2; // HOW CAN I TELL WHAT VERSION I RUN? // Login to admin and click server environment off the main menu. // If you have GD you will see a table entitled GD and the // version number will be displayed there. :o) // END THUMBNAILS CONFIG // ************************************************************************* class thumbnail { var $img; function thumbnail($imgfile) {  //detect image format  $this->img["format"]=ereg_replace(".*\.(.*)$","\\1",$imgfile);  $this->img["format"]=strtoupper($this->img["format"]);  if ($this->img["format"]=="JPG" || $this->img["format"]=="JPEG") {  //JPEG  $this->img["format"]="JPEG";  $this->img["src"] = ImageCreateFromJPEG ($imgfile);  } elseif ($this->img["format"]=="PNG") {  //PNG  $this->img["format"]="PNG";  $this->img["src"] = ImageCreateFromPNG ($imgfile);  } elseif ($this->img["format"]=="GIF") {  //GIF  $this->img["format"]="GIF";  $this->img["src"] = ImageCreateFromGIF ($imgfile);  }else {  //DEFAULT  echo "Not Supported File! Thumbnails can only be made from .jpg  .png and >gif images!";  exit();  }  @$this->img["lebar"] = imagesx($this->img["src"]);  @$this->img["tinggi"] = imagesy($this->img["src"]);  //default quality jpeg  $this->img["quality"]=75; } function size_auto($size=100) {  //size  if ($this->img["lebar"]>=$this->img["tinggi"]) {    $this->img["lebar_thumb"]=$size;    @$this->img["tinggi_thumb"] = ($this->img["lebar_thumb"]/$this->img["lebar"])*$this->img["tinggi"];  } else {    $this->img["tinggi_thumb"]=$size;    @$this->img["lebar_thumb"] = ($this->img["tinggi_thumb"]/$this->img["tinggi"])*$this->img["lebar"];  } } function jpeg_quality($quality=75) {  //jpeg quality  $this->img["quality"]=$quality; } function show($gd_version) {   @Header("Content-Type: image/".$this->img["format"]);  if($gd_version==2)         {         $this->img["des"] = imagecreatetruecolor($this->img["lebar_thumb"],$this->img["tinggi_thumb"]);      @imagecopyresampled ($this->img["des"], $this->img["src"], 0, 0, 0, 0, $this->img["lebar_thumb"],$this->img["tinggi_thumb"], $this->img["lebar"], $this->img["tinggi"]);      }         if($gd_version==1)         {         $this->img["des"] = imagecreate($this->img["lebar_thumb"],$this->img["tinggi_thumb"]);      @imagecopyresized ($this->img["des"], $this->img["src"], 0, 0, 0, 0, $this->img["lebar_thumb"],$this->img["tinggi_thumb"], $this->img["lebar"], $this->img["tinggi"]);      }  if ($this->img["format"]=="JPG" || $this->img["format"]=="JPEG") {  //JPEG  imageJPEG($this->img["des"],"",$this->img["quality"]);  } elseif ($this->img["format"]=="PNG") {  //PNG  imagePNG($this->img["des"]);  } elseif ($this->img["format"]=="GIF") {  //GIF  imageGIF($this->img["des"]);  } } function save($save="",$gd_version) {   if($gd_version==2)         {         $this->img["des"] = imagecreatetruecolor($this->img["lebar_thumb"],$this->img["tinggi_thumb"]);      @imagecopyresampled ($this->img["des"], $this->img["src"], 0, 0, 0, 0, $this->img["lebar_thumb"], $this->img["tinggi_thumb"], $this->img["lebar"], $this->img["tinggi"]);      }         if($gd_version==1)         {        $this->img["des"] = imagecreate($this->img["lebar_thumb"],$this->img["tinggi_thumb"]);     @imagecopyresized ($this->img["des"], $this->img["src"], 0, 0, 0, 0, $this->img["lebar_thumb"],    $this->img["tinggi_thumb"], $this->img["lebar"], $this->img["tinggi"]);      }  if ($this->img["format"]=="JPG" || $this->img["format"]=="JPEG") {  //JPEG  imageJPEG($this->img["des"],"$save",$this->img["quality"]);  } elseif ($this->img["format"]=="PNG") {  //PNG  imagePNG($this->img["des"],"$save");  } elseif ($this->img["format"]=="GIF") {  //GIF  imageGIF($this->img["des"],"$save");  } } } // ************************************************************************* ?>makethumb.txt Quote Link to comment Share on other sites More sharing options...
Guest jazzmeister Posted May 4, 2005 Share Posted May 4, 2005 Thanks, works great! Quote Link to comment Share on other sites More sharing options...
Guest Posted May 9, 2005 Share Posted May 9, 2005 use your file on my CC2 still comes up wrong file I did note you quote remove error check, how do i doi this? Quote Link to comment Share on other sites More sharing options...
Guest jazzmeister Posted May 10, 2005 Share Posted May 10, 2005 Have tried this again with edit products and it does not seem to work like it did for add products?! Any ideas? Tah Quote Link to comment Share on other sites More sharing options...
Guest Posted May 10, 2005 Share Posted May 10, 2005 You have to remove the error checking. See this post ... Quote Link to comment 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.