be more explicit, only exif_transform jpegs, and if mode is not rgb convert it first before thumbnail - fixes BUG-63 no thumbs for GIFs

This commit is contained in:
2021-09-21 16:53:47 +10:00
parent 13aab072db
commit 6f17e1677d
2 changed files with 8 additions and 6 deletions

7
BUGs
View File

@@ -1,4 +1,4 @@
### Next: 64
### Next: 65
BUG-56: when making a viewing list of AI:mich, (any search?) and going past the page_size, it gets the wrong data from the DB for the 'next' entry
BUG-60: entries per page (in folders view) ignores pagesize, and this also contributes to BUG-56 I think
BUG-61: in Fullscreen mode and next/prev occasionally dropped out of FS
@@ -19,5 +19,6 @@ BUG-62: viewlist on venice subdir and 'next' crashes server with a 500
ESC[36mpaweb |ESC[0m File "/code/files.py", line 478, in viewlist
ESC[36mpaweb |ESC[0m current = int(lst[0])
ESC[36mpaweb |ESC[0m ValueError: invalid literal for int() with base 10: ''
BUG-63: gif without thumbmnail (eg 20180704_104637.gif)
https://freeyeti.net/en/a/create-thumbnail-for-a-gif-image
BUG-64: seems when we move files, then somehow this triggers a lot of md5/thumb action (just for the moved files?) as they get a new? FILE entry -- why do I do that if that is the case,
the file, hash, thumb, faces, etc. should all still be connected to the FILE entry and just make it have a new home...

View File

@@ -113,9 +113,10 @@ def SymlinkName(ptype, path, file):
def GenThumb(fname):
try:
im_orig = Image.open(fname)
im = ImageOps.exif_transpose(im_orig)
bands = im.getbands()
if 'A' in bands:
if im_orig.format == 'JPEG':
im = ImageOps.exif_transpose(im_orig)
im = im_orig
if im.mode != "RGB":
im = im.convert('RGB')
orig_w, orig_h = im.size
im.thumbnail((THUMBSIZE,THUMBSIZE))