]> xenbits.xensource.com Git - people/liuw/osstest.git/commitdiff
cs-bisection-step: Use pbm tools, not graphicsmagick/imagemagick
authorIan Jackson <ian.jackson@eu.citrix.com>
Thu, 30 Apr 2015 15:20:51 +0000 (16:20 +0100)
committerIan Jackson <Ian.Jackson@eu.citrix.com>
Wed, 6 May 2015 23:49:27 +0000 (00:49 +0100)
Graphicsmagick / imagemagick have very poor performance with images
with large pixel sizes.  The bisector can generate some very large
images.

In an example I have seen, a 21595x21048 png, occupying only 2.6Mby of
disk space.  An invocation of `convert' to resize this was using 3Gby
of RAM and lots of CPU.  Whereas, the pbm utilities can process this
with much less memory and a tiny fraction of the cpu time.

Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
cs-bisection-step

index d5f8cb856773813fff8a03e682fb0232dcf12b15..c9c8bb6c60822e4cc5ea796c8e16124b083b7c59 100755 (executable)
@@ -992,8 +992,13 @@ END
         }
         1;
     }) {
-        system_checked("convert -resize $c{BisectionRevisonGraphSize}".
-                       " $graphfile.png $graphfile.mini.png");
+       my $gsize = $c{BisectionRevisonGraphSize};
+        system_checked("pngtopnm <$graphfile.png".
+                      " | pnmscale -xysize ".
+                      ($gsize =~ m/^(\d+)x(\d+)$/ ? "$1 $2" :
+                       $gsize =~ m/^(\d+)$/ ? "$1 $1" :
+                       die "$gsize ?").
+                      " | pnmtopng >$graphfile.mini.png");
         print HTML <<END or die $!;
 <h2>Revision graph overview</h2>
 <img src="$href.mini.png">