source: src/daemon/gnuboat-splashscreen@ 7549de9

0.5 app-cordova debian/bullseye debian/jessie
Last change on this file since 7549de9 was 10edeb0, checked in by Joachim Langenbach <joachim.langenbach@…>, 10 years ago
  • Improved the gnuboat daemon
  • Added gnutboat-splashscreen program for epd
  • Property mode set to 100755
File size: 1.6 KB
RevLine 
[10edeb0]1#!/usr/bin/python
2'''
3 Copyright (C) 2016 EngSaS - Engineering Solutions and Services Langenbach. All rights reserved.
4
5 This program is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program. If not, see <http://www.gnu.org/licenses/>.
17'''
18
19import sys
20import os
21import getopt
22from PIL import Image
23from PIL import ImageOps
24from EPD import EPD
25
26def displayImage(epd, imageFilePath):
27 image = Image.open(imageFilePath)
28 image = ImageOps.grayscale(image)
29 imageResized = image.resize((epd.width, epd.height))
30 imageBlackWhite = imageResized.convert("1", dither=Image.FLOYDSTEINBERG)
31 epd.display(imageBlackWhite)
32
33def main(argv):
34 image = ""
35 try:
36 opts, args = getopt.getopt(argv, "hi:", ["help", "image="])
37 except getopt.GetoptError:
38 usage()
39 sys.exit(2)
40
41 if not os.path.exists(image):
42 usage()
43 sys.exit(2)
44
45 epd = EPD()
46 epd.clear()
47 displayImage(epd, image)
48
49if __name__ == "__main__":
50 main(sys.argv[1:])
Note: See TracBrowser for help on using the repository browser.