code: def test_ifd_signed_rational(tmp_path):
      im = hopper()
      info = TiffImagePlugin.ImageFileDirectory_v2()
  
      # pair of 4 byte signed longs
      numerator = 2**31 - 1
      denominator = -(2**31)
  
      info[37380] = TiffImagePlugin.IFDRational(numerator, denominator)
  
      out = str(tmp_path / "temp.tiff")
      im.save(out, tiffinfo=info, compression="raw")
  
      with Image.open(out) as reloaded:
          assert numerator == reloaded.tag_v2[37380].numerator
          assert denominator == reloaded.tag_v2[37380].denominator
  
      numerator = -(2**31)
      denominator = 2**31 - 1
  
      info[37380] = TiffImagePlugin.IFDRational(numerator, denominator)
  
      out = str(tmp_path / "temp.tiff")
      im.save(out, tiffinfo=info, compression="raw")
  
      with Image.open(out) as reloaded:
          assert numerator == reloaded.tag_v2[37380].numerator
          assert denominator == reloaded.tag_v2[37380].denominator
  
      # out of bounds of 4 byte signed long
      numerator = -(2**31) - 1
      denominator = 1
  
      info[37380] = TiffImagePlugin.IFDRational(numerator, denominator)
  
      out = str(tmp_path / "temp.tiff")
      im.save(out, tiffinfo=info, compression="raw")
  
      with Image.open(out) as reloaded:
          assert 2**31 - 1 == reloaded.tag_v2[37380].numerator
          assert -1 == reloaded.tag_v2[37380].denominator
  
imports: import io
  import struct
  import pytest
  from PIL import Image, TiffImagePlugin, TiffTags
  from PIL.TiffImagePlugin import IFDRational
  from .helper import assert_deep_equal, hopper
label_desc: Use image node_id 15 for calling a global function with example usage: test_ifd_signed_rational(tmp_path) without return types