1
0
mirror of https://github.com/arsenetar/dupeguru.git synced 2024-10-31 22:05:58 +00:00

Merge pull request #698 from glubsy/fix_630

Workaround for #630
This commit is contained in:
Andrew Senetar 2020-08-06 23:16:02 -05:00 committed by GitHub
commit 9e6b117327
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -29,6 +29,15 @@ class File(PhotoBase):
def _plat_get_blocks(self, block_count_per_side, orientation): def _plat_get_blocks(self, block_count_per_side, orientation):
image = QImage(str(self.path)) image = QImage(str(self.path))
image = image.convertToFormat(QImage.Format_RGB888) image = image.convertToFormat(QImage.Format_RGB888)
if type(orientation) == str:
logging.warning("Orientation for file '%s' was a str '%s', not an int.",
str(self.path), orientation)
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 # 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 # 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 # the transform, we see that the image has been correctly flipped and rotated), but the