08.12.07

robobait: gd library bug – horizontal lines

Posted in Hacking, Maps, robobait at 11:12 pm by ducky

I had had a problem with horizontal lines in my census maps mashups for a long time.  Note the line at the bottom left.

Horizontal line bug

I was sure it was a bug in my code because the graphics library that I used, gd, was extremely mature and heavily-used.  (Way back in 1994 or 1995, my then-office partner Carlos Pero was using gd for Carlos’ Coloring Book!)

It turned out to be a bug in the gd polygon fill code. The fix turned out to be a very small number of lines of code, so if you are having problems with horizontal lines occasionally appearing in your images, look there.

More keywords: libgd, gdlib gd lib, flat, fill polygon, colored polygon, horizontal line, missing line, extra line, flat line, sideways line

2 Comments

  1. Best Webfoot Forward » Programming persistence said,

    November 30, 2008 at 11:21 pm

    […] I thus had to study and understand the gd code, fix it, report the bug (and patch), and of course blog about it so that other people wouldn’t have the same […]

  2. admin said,

    January 19, 2010 at 10:10 am

    After 2.5 years, WITH a patch that I submitted, they say they have finally fixed the bug. Yay!

    http://bugs.libgd.org/?do=details&task_id=100