]> git.donarmstrong.com Git - lilypond.git/blobdiff - scripts/build/output-distance.py
Add '-dcrop' option to ps and svg backends
[lilypond.git] / scripts / build / output-distance.py
index 569c892a8f63e7754c6b568c81275df7ef6e4e73..625ce12a1e3f1ab70db53797457ddc400e2472a5 100755 (executable)
@@ -89,7 +89,7 @@ def compare_png_images (old, new, dest_dir):
     system ('convert -depth 8 -crop %dx%d+0+0 %s %s/crop1.png' % (dims + (old, dir)))
     system ('convert -depth 8 -crop %dx%d+0+0 %s %s/crop2.png' % (dims + (new, dir)))
 
-    system ('compare -depth 8 -dissimilarity-threshold 1 %(dir)s/crop1.png %(dir)s/crop2.png %(dir)s/diff.png' % locals ())
+    system1 ('compare -depth 8 -dissimilarity-threshold 1 %(dir)s/crop1.png %(dir)s/crop2.png %(dir)s/diff.png' % locals ())
 
     system ("convert  -depth 8 %(dir)s/diff.png -blur 0x3 -negate -channel alpha,blue -type TrueColorMatte -fx 'intensity'    %(dir)s/matte.png" % locals ())
 
@@ -642,6 +642,7 @@ class SignatureFileLink (FileLink):
                 cmd = ('gs -sDEVICE=png16m -dGraphicsAlphaBits=4 -dTextAlphaBits=4 '
                        ' %(data_option)s '
                        ' -r101 '
+                       ' -dAutoRotatePages=/None '
                        ' -sOutputFile=%(outfile)s -dNOSAFER -dEPSCrop -q -dNOPAUSE '
                        ' %(infile)s  -c quit ') % locals ()
 
@@ -1089,6 +1090,12 @@ def system (x):
     stat = os.system (x)
     assert stat == 0
 
+def system1 (x):
+# Allow exit status 0 and 1
+    print 'invoking', x
+    stat = os.system (x)
+    assert (stat == 0) or (stat == 256) # This return value convention is sick.
+
 
 def test_paired_files ():
     print paired_files (os.environ["HOME"] + "/src/lilypond/scripts/",