PDA

View Full Version : Question about results graphs


uncle_fungus
05-08-2008, 03:49 PM
I've noticed that the png files that are produced by pts-grapher are rather large (170Kb per file) and was wondering why you aren't applying any of png's compression to the images.

It only needs a 1 character change in pts_Graph.php to reduce size of the generated images from 170Kb to 6Kb each. I suspect this would be useful to have on PTS Global to as it would significantly reduce the bandwidth of viewing test results.

diff --git a/pts-core/objects/pts_Graph.php b/pts-core/objects/pts_Graph.php
index 0c55ff2..f58b189 100644
--- a/pts-core/objects/pts_Graph.php
+++ b/pts-core/objects/pts_Graph.php
@@ -438,7 +438,7 @@ class pts_Graph
}
protected function return_graph_image()
{
- Imagepng($this->graph_image, $this->graph_output, 0);
+ Imagepng($this->graph_image, $this->graph_output, 9);
ImageDestroy($this->graph_image);
}
public function save_graph($file)

Michael
05-08-2008, 03:55 PM
Yeah, I really don't know why I hadn't enabled PNG compression earlier... Anyways, it's compressed now in git.