Expand fix for #630 to fix #551

This commit is contained in:
Andrew Senetar 2021-08-28 17:29:25 -05:00
parent 3da9d5d869
commit 0a0694e095
Signed by: arsenetar
GPG Key ID: C63300DCE48AB2F1
1 changed files with 6 additions and 4 deletions

View File

@ -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)