From 0a0694e0950eb014013d4b043a76624e90afd328 Mon Sep 17 00:00:00 2001 From: Andrew Senetar Date: Sat, 28 Aug 2021 17:29:25 -0500 Subject: [PATCH] Expand fix for #630 to fix #551 --- qt/pe/photo.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/qt/pe/photo.py b/qt/pe/photo.py index 22e750a5..4ba1de76 100644 --- a/qt/pe/photo.py +++ b/qt/pe/photo.py @@ -29,14 +29,16 @@ class File(PhotoBase): 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)