]> git.aero2k.de Git - sirius.git/commitdiff
Flip image before RLE encoding. The printer prints upside-down.
authorTom Hunger <tehunger@gmail.com>
Mon, 2 Feb 2015 14:24:48 +0000 (14:24 +0000)
committerTom Hunger <tehunger@gmail.com>
Mon, 2 Feb 2015 14:24:48 +0000 (14:24 +0000)
sirius/coding/image_encoding.py

index 2459bd32dcc33a1906e5ec53eefcca0dcc147f83..f6ddd2b9760c8366c8c515553f1cfa543852a4ff 100644 (file)
@@ -71,6 +71,7 @@ def rle_from_bw(bw_image):
     :param bw_image: A mode "1" PIL image.
     :returns: A 2-tuple of (number of pixels, RLE-encoded pixel data)
     """
+    bw_image = bw_image.transpose(Image.ROTATE_180)
     pixels = list(bw_image.getdata())
 
     # Group each run length into lists each list is (result of