mirror of
https://github.com/arsenetar/dupeguru.git
synced 2025-03-09 21:24:36 +00:00
Try to handle conversion to int or fail gracefully
This commit is contained in:
parent
6e81042989
commit
3333d26557
@ -30,9 +30,14 @@ class File(PhotoBase):
|
||||
image = QImage(str(self.path))
|
||||
image = image.convertToFormat(QImage.Format_RGB888)
|
||||
if type(orientation) == str:
|
||||
logging.warning("Orientation for file '%s' was a str '%s', not an int!",
|
||||
logging.warning("Orientation for file '%s' was a str '%s', not an int.",
|
||||
str(self.path), orientation)
|
||||
return getblocks(image, block_count_per_side)
|
||||
try:
|
||||
orientation = int(orientation)
|
||||
except Exception as e:
|
||||
logging.exception("Skipping transformation because could not \
|
||||
convert str to int. %s", e)
|
||||
return getblocks(image, block_count_per_side)
|
||||
# MYSTERY TO SOLVE: For reasons I cannot explain, orientations 5 and 7 don't work for
|
||||
# duplicate scanning. The transforms seems to work fine (if I try to save the image after
|
||||
# the transform, we see that the image has been correctly flipped and rotated), but the
|
||||
|
Loading…
x
Reference in New Issue
Block a user