added orientation option for slideshow
This commit is contained in:
parent
3d4e24eee1
commit
031b3211ec
@ -40,7 +40,12 @@ 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"]
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
def __init__(self, config):
|
def __init__(self, config):
|
||||||
@ -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 )
|
||||||
|
Loading…
Reference in New Issue
Block a user