[rt-devel] Statistics3 package - corrupted PNG images

Kelly F. Hickel kfh at mqsoftware.com
Fri Jan 30 17:22:08 EST 2004


Alex, 
	The "extra newline" seems to have been caused by a semi-recent
change to RTFM.  Jesse released a newer version to fix this a couple of
weeks ago (sorry don't remember the date or RTFM version, you could
check the archives), and that seemed to correct it.  It didn't work for
me until I realized that I had some tweaked RTFM files in my local area
(since those override the ones in the share area where RTFM is installed
by default).  Once I removed the local versions, the problem went away.

Kelly F. Hickel
Senior Software Architect
MQSoftware, Inc
952.345.8677
kfh at mqsoftware.com


> -----Original Message-----
> From: Alex Rebrik [mailto:arebrik at zappos.com]
> Sent: Friday, January 30, 2004 4:19 PM
> To: rt-devel at lists.bestpractical.com
> Subject: [rt-devel] Statistics3 package - corrupted PNG images
> 
> Hi everyone,
> 
> I've noticed quite a few messages on the lists regarding corrupted
> graphs' images genereated by Haralad Wagener's Statistics3 package. I
> too was faced with the same problem, particularly new-line being added
> in the begining of image output resulting in broken PNG image header.
> While I didn't find any practicle resolution to this issue in the list
> archive I was nevertheless able to solve the problem a few ways. Here
is
> what I did:
> 
> 1. I figured out that when printing to a file images are generated
> properly. So explicitly specified the STDOUT descriptor in print
> statement and that resulted in proper image being generated. So for
> example in "Statistics/Resolution/Elements/Chart" print satement looks
> like:
> 
> <%perl>
> print STDOUT $graph->plot(\@data)->$format();
> ---SNIP---
> 
> 2. Reading up on HTML::Mason I found out that Mason buffers all its
> output but gives you a way to clear the buffer. Next thing I tried is
to
> revert to original print statement without explicitly naming STDOUT
> descriptor but clearing the output buffer beforehand. This also has
> worked and generated proper images not prepended by a newline.
> 
> <%perl>
> $m->clear_buffer();
> print $graph->plot(\@data)->$format();
> ---SNIP---
> 
> 3. HTML::Mason has a preferred output method $m->out(), replacing
print
> statement with $m->out has also worked, but $m->clear_buffer() was
still
> necessary to avoid newline injection.
> 
> <%perl>
> $m->clear_buffer();
> $m->out($graph->plot(\@data)->$format());
> ---SNIP---
> 
> Hope this is helpful to some of you having similar issues.
> 
> --Alex
> 
> _______________________________________________
> rt-devel mailing list
> rt-devel at lists.bestpractical.com
> http://lists.bestpractical.com/mailman/listinfo/rt-devel



More information about the Rt-devel mailing list