Announcement

Collapse
No announcement yet.

Question about results graphs

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Question about results graphs

    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.

    Code:
    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)

  • #2
    Yeah, I really don't know why I hadn't enabled PNG compression earlier... Anyways, it's compressed now in git.
    Michael Larabel
    https://www.michaellarabel.com/

    Comment

    Working...
    X