cormanaz has asked for the wisdom of the Perl Monks concerning the following question:

I've had a strange problem using GD::Graph::lines. I'm using it in a script to draw graphs for six different variables, saved in PNG format and then displayed on an html page (on local drive). I've been doing this daily (on new data each dat) for a couple of weeks.

Today, the png file for one of the graphs won't display on the browser (MSIE). I look at the .png file using the XP pic previewer, and it looks fine. I open in Photoshop, save, and now it displays on the browser.

I'm at a loss to figure out how I can debug this. I'm using a loop to generate all six graphs and it's working for 5/6. So it would appear that GD::Graph must be writing something into the file that the browser doesn't like, and that it's doing this randomly or as a result of the data being plotted. Also Photoshop gets rid of this problem when it saves the file.

Anyone have suggestions for how I can resolve this?

Many thanks.... Steve

Replies are listed 'Best First'.
Re: GD::Graph PNG error
by PodMaster (Abbot) on Jul 18, 2004 at 03:06 UTC
    It looks like a MSIE bug to me. Do you have a copy of one of these bad PNG files? I would post process each file with something like pngcrush.

    MJD says "you can't just make shit up and expect the computer to know what you mean, retardo!"
    I run a Win32 PPM repository for perl 5.6.x and 5.8.x -- I take requests (README).
    ** The third rule of perl club is a statement of fact: pod is sexy.

Re: GD::Graph PNG error
by simonm (Vicar) on Jul 17, 2004 at 16:46 UTC
    I'm not sure what the problem is; you'll need to do more debugging on your end. Try repeatedly generating a bunch of graphs from different data and see whether it's consistent and if you can identify which data sets produce the problematic output.
Re: GD::Graph PNG error
by superfrink (Curate) on Jul 18, 2004 at 03:23 UTC
    I can't say why just one PNG wouldn't work but IE was slow to support PNG files in the first place (compared to Opera and Safari). Also as far as I know IE does not yet support transparent PNG files.