mirror of https://github.com/vladmandic/automatic
thumbnail creation exception handling
parent
8374f08de8
commit
145b990c73
|
|
@ -73,7 +73,7 @@ will need to handle in the code before we get out of alpha
|
||||||
|
|
||||||
## Issues
|
## Issues
|
||||||
|
|
||||||
- TBD
|
- seed vs batch size?
|
||||||
|
|
||||||
## Notes for HF
|
## Notes for HF
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -133,12 +133,15 @@ class ExtraNetworksPage:
|
||||||
fn = f'{fn}.thumb.jpg'
|
fn = f'{fn}.thumb.jpg'
|
||||||
if os.path.exists(fn):
|
if os.path.exists(fn):
|
||||||
continue
|
continue
|
||||||
created += 1
|
try:
|
||||||
img = Image.open(f)
|
img = Image.open(f)
|
||||||
img = img.convert('RGB')
|
img = img.convert('RGB')
|
||||||
img.thumbnail((512, 512), Image.HAMMING)
|
img.thumbnail((512, 512), Image.HAMMING)
|
||||||
img.save(fn)
|
img.save(fn)
|
||||||
img.close()
|
img.close()
|
||||||
|
created += 1
|
||||||
|
except Exception as e:
|
||||||
|
shared.log.error(f'Extra network error creating thumbnail: {f} {e}')
|
||||||
if len(self.missing_thumbs) > 0:
|
if len(self.missing_thumbs) > 0:
|
||||||
shared.log.info(f"Extra network created thumbnails: {self.name} {created}")
|
shared.log.info(f"Extra network created thumbnails: {self.name} {created}")
|
||||||
self.missing_thumbs.clear()
|
self.missing_thumbs.clear()
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue