code: def test_exif(self):
      # With an EXIF chunk
      with Image.open("Tests/images/exif.png") as im:
          exif = im._getexif()
      assert exif[274] == 1
  
      # With an ImageMagick zTXt chunk
      with Image.open("Tests/images/exif_imagemagick.png") as im:
          exif = im._getexif()
          assert exif[274] == 1
  
          # Assert that info still can be extracted
          # when the image is no longer a PngImageFile instance
          exif = im.copy().getexif()
          assert exif[274] == 1
  
      # With a tEXt chunk
      with Image.open("Tests/images/exif_text.png") as im:
          exif = im._getexif()
      assert exif[274] == 1
  
      # With XMP tags
      with Image.open("Tests/images/xmp_tags_orientation.png") as im:
          exif = im.getexif()
      assert exif[274] == 3
  
imports: from __future__ import annotations
  import re
  import sys
  import warnings
  import zlib
  from io import BytesIO
  import pytest
  from PIL import Image, ImageFile, PngImagePlugin, features
  from .helper import PillowLeakTestCase, assert_image, assert_image_equal, assert_image_equal_tofile, hopper, is_win32, mark_if_feature_version, skip_unless_feature
label_desc: Use image node_id 46 for calling the TestFilePng obj's underlying member method code with example usage: obj.test_exif() without return types