SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    is craving 'the potato' slayerment's Avatar
    Join Date
    Nov 2002
    Location
    Scottsdale, Arizona, USA
    Posts
    603
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Q: Color issues with imagecopy()

    I am having some issues getting imagecopy to correctly copy my image over with the correct colors. You can see my problem here: http://www.myonebaby.com/node/495/image.png . You can see the majority of the code I am using below. I have used this same type of setup before for another site and had no issues. Has anybody experienced this type of problem?

    PHP Code:
    $img imageCreateFromPNG(drupal_get_path('module''embed').'/files/baby_bg.png');
    $photo file_directory_path().'/'.$image->images['preview'];
    $photo imageCreateFromJPEG($photo);
    imagecopy($img$photo1100197203);
    Header ("Content-type: image/png");
    ImagePng ($img); 
    If I do ImagePng ($photo) it will look just fine, but as soon as I try to combine the 2 and return $img it gets messed up.

    Thanks,
    Quinton

  2. #2
    Working on it... Contrid's Avatar
    Join Date
    Apr 2006
    Location
    Online
    Posts
    955
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    What version of GD do you have?

    Also...you said that you used this same code on another site.
    What version does it have?
    And so I got lost in code...completely asphyxiated by it...

    Premium WordPress plugins - Tribulant Software

  3. #3
    is craving 'the potato' slayerment's Avatar
    Join Date
    Nov 2002
    Location
    Scottsdale, Arizona, USA
    Posts
    603
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Contrid View Post
    What version of GD do you have?

    Also...you said that you used this same code on another site.
    What version does it have?
    The working version is:
    bundled (2.0.34 compatible)

    The non-working version is:
    bundled (2.0.28 compatible)

    Could this be the problem? It seems like these versions are very close and it wouldn't matter.

  4. #4
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Is the PNG indexed color?
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  5. #5
    is craving 'the potato' slayerment's Avatar
    Join Date
    Nov 2002
    Location
    Scottsdale, Arizona, USA
    Posts
    603
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by logic_earth View Post
    Is the PNG indexed color?
    Not sure if the PNG was indexed color or not but this was the problem. I changed it from a PNG-8 to a PNG-24 and it worked perfect.

    Thanks!


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •