added orientation option for slideshow
This commit is contained in:
		| @@ -40,6 +40,11 @@ class Slideshow(inkycal_module): | |||||||
|     "autoflip":{ |     "autoflip":{ | ||||||
|         "label":"Should the image be flipped automatically?", |         "label":"Should the image be flipped automatically?", | ||||||
|         "options": [True, False] |         "options": [True, False] | ||||||
|  |         }, | ||||||
|  |  | ||||||
|  |     "orientation":{ | ||||||
|  |       "label": "Please select the desired orientation", | ||||||
|  |       "options": ["vertical", "horizontal"] | ||||||
|       } |       } | ||||||
|     } |     } | ||||||
|  |  | ||||||
| @@ -59,6 +64,7 @@ class Slideshow(inkycal_module): | |||||||
|     self.path = config['path'] |     self.path = config['path'] | ||||||
|     self.use_colour = config['use_colour'] |     self.use_colour = config['use_colour'] | ||||||
|     self.autoflip = config['autoflip'] |     self.autoflip = config['autoflip'] | ||||||
|  |     self.orientation = config['orientation'] | ||||||
|  |  | ||||||
|     # Get the full path of all png/jpg/jpeg images in the given folder |     # Get the full path of all png/jpg/jpeg images in the given folder | ||||||
|     all_files = glob.glob(f'{self.path}/*') |     all_files = glob.glob(f'{self.path}/*') | ||||||
| @@ -107,7 +113,7 @@ class Slideshow(inkycal_module): | |||||||
|  |  | ||||||
|     # if autoflip was enabled, flip the image |     # if autoflip was enabled, flip the image | ||||||
|     if self.autoflip == True: |     if self.autoflip == True: | ||||||
|       im.autoflip('vertical') |       im.autoflip(self.orientation) | ||||||
|  |  | ||||||
|     # resize the image so it can fit on the epaper |     # resize the image so it can fit on the epaper | ||||||
|     im.resize( width=im_width, height=im_height ) |     im.resize( width=im_width, height=im_height ) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user