code: def test_missing_resolution_metadata(tmp_path):
      tif_path = tmp_path / "test.tif"
      data = np.zeros((200, 100), dtype=np.uint8)
      iio.imwrite(tif_path, data)
  
      with tifffile.TiffFile(tif_path, mode="r+b") as tif:
          tags = tif.pages[0].tags
          xres = tags["XResolution"]
          tags["YResolution"].overwrite((10, 11))
  
      with tif_path.open("r+b") as f:
          # give XResolution tag another ID so it won't be recognized
          f.seek(xres.offset)
          f.write(struct.pack("<H", 65000))
  
      read_image = iio.immeta(tif_path, index=0)
      assert "XResolution" not in read_image
      assert read_image["YResolution"] == (10, 11)
      assert "resolution" not in read_image
      assert read_image["resolution_unit"] == 1
  
      tif_path2 = tmp_path / "test2.tif"
      data2 = np.zeros((200, 100), dtype=np.uint8)
      iio.imwrite(tif_path2, data2)
  
      with tifffile.TiffFile(tif_path2, mode="r+b") as tif:
          tags = tif.pages[0].tags
          res_u = tags["ResolutionUnit"]
  
      with tif_path2.open("r+b") as f:
          # give ResolutionUnit tag another ID so it won't be recognized
          f.seek(res_u.offset)
          f.write(struct.pack("<H", 65000))
  
      read_image2 = iio.immeta(tif_path2, index=0)
      assert "ResolutionUnit" not in read_image2
      assert "resolution" not in read_image2
      assert "resolution_unit" not in read_image2
  
imports: import datetime
  import numpy
  import pytest
  import io
  from copy import deepcopy
  import struct
  import imageio.v3
  from imageio.config import known_plugins, known_extensions
label_desc: Use image node_id 12 for calling a global function with example usage: test_missing_resolution_metadata(tmp_path) without return types