Need help on PHP(Image thumbnail)

Discussion in 'PHP' started by xceedbd, Jul 1, 2009.

  1. #1
    Hello,

    I save image database and retrive it.

    i want it thumbnail this image.

    i already code. its works but my image color look guly.


    Site link: http://xceedbd.com/gallery/

    thumbnail link: http://xceedbd.com/gallery/view.php?recid=19

    code:
    Please help me. How can i get good color.
     
    xceedbd, Jul 1, 2009 IP
  2. Social.Network

    Social.Network Member

    Messages:
    517
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    35
    #2
    Have you tried the ImageCreateTrueColor function?
     
    Social.Network, Jul 1, 2009 IP
  3. vaibhavcoder

    vaibhavcoder Peon

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Yes I think that will work.

    very rare I have seen this kind of problem.

    I will go through your code now and will get back to you :)

    Noddy
     
    vaibhavcoder, Jul 1, 2009 IP
  4. xceedbd

    xceedbd Well-Known Member

    Messages:
    640
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    128
    Digital Goods:
    1
    #4
    thanks for ur post.

    i tried ImageCreateTrueColor function but come error.

    can u clear me where i use it(ImageCreateTrueColor) my code
     
    xceedbd, Jul 1, 2009 IP
  5. AlilG

    AlilG Peon

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5

    find this line at your code:
    
    $thumb=imagecreate($new_width,$new_height);
    
    PHP:
    replace it with this:
    
    $thumb=imagecreatetruecolor($new_width,$new_height);
    
    PHP:
    save it.

    done

    now your gallery will display images in true colors!
     
    AlilG, Jul 1, 2009 IP
  6. xceedbd

    xceedbd Well-Known Member

    Messages:
    640
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    128
    Digital Goods:
    1
    #6
    Thanks AlilG

    its works nice.
     
    xceedbd, Jul 1, 2009 IP
  7. techbongo

    techbongo Active Member

    Messages:
    309
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    80
    #7
    Any way other than using GDI library to resize images or creating thumbnails? I think, the quality of the thumbnails still reduces. Any other way, which preserves the quality while resizing?
     
    techbongo, Jul 1, 2009 IP
  8. Social.Network

    Social.Network Member

    Messages:
    517
    Likes Received:
    15
    Best Answers:
    0
    Trophy Points:
    35
    #8
    Did you read post #2? I provided the answer and you think you solved the issue?
     
    Social.Network, Jul 1, 2009 IP