Extra supported image format

main
Bob Mottram 2020-09-22 17:05:00 +01:00
parent cb8afbe716
commit 640fc95ad0
1 changed files with 4 additions and 4 deletions

View File

@ -54,7 +54,7 @@ def removeShare(baseDir: str, nickname: str, domain: str,
# remove any image for the item
itemIDfile = baseDir + '/sharefiles/' + nickname + '/' + itemID
if sharesJson[itemID]['imageUrl']:
formats = ('png', 'jpg', 'gif', 'webp')
formats = ('png', 'jpg', 'gif', 'webp', 'avif')
for ext in formats:
if sharesJson[itemID]['imageUrl'].endswith('.' + ext):
if os.path.isfile(itemIDfile + '.' + ext):
@ -108,7 +108,7 @@ def addShare(baseDir: str,
if not imageFilename:
sharesImageFilename = \
baseDir + '/accounts/' + nickname + '@' + domain + '/upload'
formats = ('png', 'jpg', 'gif', 'webp')
formats = ('png', 'jpg', 'gif', 'webp', 'avif')
for ext in formats:
if os.path.isfile(sharesImageFilename + '.' + ext):
imageFilename = sharesImageFilename + '.' + ext
@ -128,7 +128,7 @@ def addShare(baseDir: str,
if not os.path.isdir(baseDir + '/sharefiles/' + nickname):
os.mkdir(baseDir + '/sharefiles/' + nickname)
itemIDfile = baseDir + '/sharefiles/' + nickname + '/' + itemID
formats = ('png', 'jpg', 'gif', 'webp')
formats = ('png', 'jpg', 'gif', 'webp', 'avif')
for ext in formats:
if imageFilename.endswith('.' + ext):
removeMetaData(imageFilename, itemIDfile + '.' + ext)
@ -202,7 +202,7 @@ def expireSharesForAccount(baseDir: str, nickname: str, domain: str) -> None:
# remove any associated images
itemIDfile = \
baseDir + '/sharefiles/' + nickname + '/' + itemID
formats = ('png', 'jpg', 'gif', 'webp')
formats = ('png', 'jpg', 'gif', 'webp', 'avif')
for ext in formats:
if os.path.isfile(itemIDfile + '.' + ext):
os.remove(itemIDfile + '.' + ext)