@@ -405,7 +405,6 @@ def check(orientation_im: Image.Image) -> None:
405405 else :
406406 original_exif = im .info ["exif" ]
407407 transposed_im = ImageOps .exif_transpose (im )
408- assert transposed_im is not None
409408 assert_image_similar (base_im , transposed_im , 17 )
410409 if orientation_im is base_im :
411410 assert "exif" not in im .info
@@ -417,7 +416,6 @@ def check(orientation_im: Image.Image) -> None:
417416
418417 # Repeat the operation to test that it does not keep transposing
419418 transposed_im2 = ImageOps .exif_transpose (transposed_im )
420- assert transposed_im2 is not None
421419 assert_image_equal (transposed_im2 , transposed_im )
422420
423421 check (base_im )
@@ -433,7 +431,6 @@ def check(orientation_im: Image.Image) -> None:
433431 assert im .getexif ()[0x0112 ] == 3
434432
435433 transposed_im = ImageOps .exif_transpose (im )
436- assert transposed_im is not None
437434 assert 0x0112 not in transposed_im .getexif ()
438435
439436 transposed_im ._reload_exif ()
@@ -446,14 +443,12 @@ def check(orientation_im: Image.Image) -> None:
446443 assert im .getexif ()[0x0112 ] == 3
447444
448445 transposed_im = ImageOps .exif_transpose (im )
449- assert transposed_im is not None
450446 assert 0x0112 not in transposed_im .getexif ()
451447
452448 # Orientation set directly on Image.Exif
453449 im = hopper ()
454450 im .getexif ()[0x0112 ] = 3
455451 transposed_im = ImageOps .exif_transpose (im )
456- assert transposed_im is not None
457452 assert 0x0112 not in transposed_im .getexif ()
458453
459454
@@ -464,7 +459,6 @@ def test_exif_transpose_xml_without_xmp() -> None:
464459
465460 del im .info ["xmp" ]
466461 transposed_im = ImageOps .exif_transpose (im )
467- assert transposed_im is not None
468462 assert 0x0112 not in transposed_im .getexif ()
469463
470464
0 commit comments