Jump to content

Anyone know where patch for uploading GIFS is?


Guest jazzmeister

Recommended Posts

Guest jazzmeister

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

Link to comment
Share on other sites

... :unsure:

.. :huh: ...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... :P

hope it helped...

Link to comment
Share on other sites

Guest billmc

Hi jazzmeister,

In CC2 you must have gd2 available and edit make_thumb.txt to enable *.gif files.

Don't know about CC3

billmc

Link to comment
Share on other sites

Guest jazzmeister

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

Link to comment
Share on other sites

Guest billmc

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

Link to comment
Share on other sites

Guest jazzmeister

Have tried this again with edit products and it does not seem to work like it did for add products?!

Any ideas?

Tah

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...