Skip to content

Commit

Permalink
Merge pull request #698 from glubsy/fix_630
Browse files Browse the repository at this point in the history
Workaround for #630
  • Loading branch information
arsenetar authored Aug 7, 2020
2 parents ab402d4 + 3333d26 commit 9e6b117
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions qt/pe/photo.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ def _plat_get_dimensions(self):
def _plat_get_blocks(self, block_count_per_side, orientation):
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.",
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
# 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
Expand Down

0 comments on commit 9e6b117

Please sign in to comment.