imagecolorallocate() problem with GD 1.6.2

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Neal

    imagecolorallocate() problem with GD 1.6.2

    Using the GD library, I'm having a bit of difficulty getting
    imagecoloralloc ate() to work as I would expect it to. Using a call of

    $color = imagecoloralloc ate ($image, 255, 0, 0);

    (after loading with $image = imagecreatefrom jpeg( $filename );), I
    would expect a call to imageline() using $color to draw a red line.

    Under GD 2.0.12 this works fine.

    But under GD 1.6.2, this is not true. The line winds up using one of
    the colors in the image's existing palette instead of creating a new
    entry in the palette as I would think it should.

    How do I get 1.6.2 to actually use the new color I've defined? So far
    the only work-around I've discovered is to make sure the image has at
    least 1 red pixel somewhere in it.

    I'm stuck with 1.6 since that is what the hosting service has
    installed.

    Thanks,
    Neal
Working...