Skip to content

Commit

Permalink
Expand fix for #630 to fix #551
Browse files Browse the repository at this point in the history
  • Loading branch information
arsenetar committed Aug 28, 2021
1 parent 3da9d5d commit 0a0694e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions qt/pe/photo.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,16 @@ 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)
if type(orientation) != int:
logging.warning(
"Orientation for file '%s' was a %s '%s', not an int.", str(self.path), type(orientation), orientation
)
try:
orientation = int(orientation)
except Exception as e:
logging.exception(
"Skipping transformation because could not \
convert str to int. %s",
"Skipping transformation because could not convert %s to int. %s",
type(orientation),
e,
)
return getblocks(image, block_count_per_side)
Expand Down

0 comments on commit 0a0694e

Please sign in to comment.