[Download] Image Thumb Maker Script I wrote - 100% Free

Discussion in 'Programming' started by Vooler, Jul 4, 2008.

  1. ghprod

    ghprod Active Member

    Messages:
    1,010
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    78
    #21
    Thnx for ur hard work :)

    btw can we make thumb from img with transparent background without getting dark background?

    Thnx :D
     
    ghprod, Aug 21, 2008 IP
  2. Vooler

    Vooler Well-Known Member

    Messages:
    1,146
    Likes Received:
    64
    Best Answers:
    4
    Trophy Points:
    150
    #22
    draw a bar of same size as image on a new image, and paste the new one over it. Then resize it.

    regards
     
    Vooler, Aug 24, 2008 IP
  3. ghprod

    ghprod Active Member

    Messages:
    1,010
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    78
    #23
    Colud u explain more details :)

    Thnx
     
    ghprod, Aug 24, 2008 IP
  4. Vooler

    Vooler Well-Known Member

    Messages:
    1,146
    Likes Received:
    64
    Best Answers:
    4
    Trophy Points:
    150
    #24
    Sorry, the time is short and time is money :D here is the code that will add background color

        function gd_hexgd(&$image,$hex) {
    		$R = hexdec(@$hex{0}.@$hex{1});
    		$G = hexdec(@$hex{2}.@$hex{3});
    		$B = hexdec(@$hex{4}.@$hex{5});
    
    		return imagecolorallocate ($image, $R, $G, $B);    
        } 
        function gd_newimage($width,$height) {
    		return imagecreatetruecolor($width, $height); 
        }
        function gd_bar(&$image,$x=0,$y=0,$width,$height,$color="FFFFFF") {
    		return imagefilledrectangle ($image, $x, $y, $x+$width, $y+$height, gd_hexgd($image,$color));
        }
    	function gd_set_bg(&$img,$color="FFFFFF") {
    		$w = imageSX($img);
    		$h = imageSY($img);
    		$img2 = gd_newimage($w,$h);
    		gd_bar($img2,0,0,$w,$h,$color);
    		imagecopy($img2, $img, 0, 0, 0, 0, $w, $h); 
    		return $img2;
    	}
    Code (markup):

    Usage:
    $img = gd_set_bg($img, "FFFFFF");
    Code (markup):

    regards
     
    Vooler, Aug 24, 2008 IP
  5. ghprod

    ghprod Active Member

    Messages:
    1,010
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    78
    #25
    Thnx :)

    btw can we resize image with GD but still with transparent background?

    or maybe create let say PNG with transparent background in GD?

    Regards :)
     
    ghprod, Aug 25, 2008 IP
  6. Vooler

    Vooler Well-Known Member

    Messages:
    1,146
    Likes Received:
    64
    Best Answers:
    4
    Trophy Points:
    150
    #26
    You can do either, it is matter of digging out more functions in php GD2 manual. I will try to collect you some documents.

    regards
     
    Vooler, Aug 25, 2008 IP
  7. Glamtronic

    Glamtronic Banned

    Messages:
    6
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #27
    thnk you for this, it will come in very handy!
     
    Glamtronic, Aug 25, 2008 IP
  8. ghprod

    ghprod Active Member

    Messages:
    1,010
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    78
    #28
    i'm googling about gd2 manual but not found :(

    anyone can help .... ?

    Thnx :D
     
    ghprod, Aug 26, 2008 IP
  9. ghprod

    ghprod Active Member

    Messages:
    1,010
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    78
    #29
    i've found it:)

    just try to practice at home:D
     
    ghprod, Aug 26, 2008 IP
  10. Vooler

    Vooler Well-Known Member

    Messages:
    1,146
    Likes Received:
    64
    Best Answers:
    4
    Trophy Points:
    150
    #30
    Obtain php chm manual from php.net, that includes the gd functions list in detail.

    regars
     
    Vooler, Aug 26, 2008 IP
  11. ghprod

    ghprod Active Member

    Messages:
    1,010
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    78
    #31
    Vooler :)

    Can u integrate transparent function into this script?

    i'm noob in PHP :p
     
    ghprod, Aug 28, 2008 IP
  12. Vooler

    Vooler Well-Known Member

    Messages:
    1,146
    Likes Received:
    64
    Best Answers:
    4
    Trophy Points:
    150
    #32
    Vooler, Aug 30, 2008 IP
  13. projectWORD

    projectWORD Active Member

    Messages:
    287
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    63
    #33
    can this script take a thumbnail of a website?
     
    projectWORD, Sep 25, 2008 IP
  14. Vooler

    Vooler Well-Known Member

    Messages:
    1,146
    Likes Received:
    64
    Best Answers:
    4
    Trophy Points:
    150
    #34
    No, it cannot.
     
    Vooler, Sep 25, 2008 IP
  15. Barti1987

    Barti1987 Well-Known Member

    Messages:
    2,703
    Likes Received:
    115
    Best Answers:
    0
    Trophy Points:
    185
    #35
    I am currently working on one too.

    If you do one, insure you have the "paid membership" option, I get alot of requests but barely have time.

    Peace,
     
    Barti1987, Sep 25, 2008 IP
  16. iLife

    iLife Peon

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #36
    simple yet powerfull thanks for this great piece of work
     
    iLife, Jan 2, 2009 IP