code: def test_size():
      for in_size, req_size, out_size in [
          ((435, 361), (2048, 2048), (435, 361)),  # bigger
          ((435, 361), (435, 361), (435, 361)),  # same
          ((128, 128), (64, 64), (64, 64)),
          ((128, 128), (32, 32), (32, 32)),
          ((128, 128), (16, 16), (16, 16)),
          # large requested width
          ((435, 361), (218, 128), (435, 361)),  # almost 2x
          ((435, 361), (217, 128), (218, 181)),  # more than 2x
          ((435, 361), (109, 64), (218, 181)),  # almost 4x
          ((435, 361), (108, 64), (109, 91)),  # more than 4x
          ((435, 361), (55, 32), (109, 91)),  # almost 8x
          ((435, 361), (54, 32), (55, 46)),  # more than 8x
          ((435, 361), (27, 16), (55, 46)),  # more than 16x
          # and vice versa
          ((435, 361), (128, 181), (435, 361)),  # almost 2x
          ((435, 361), (128, 180), (218, 181)),  # more than 2x
          ((435, 361), (64, 91), (218, 181)),  # almost 4x
          ((435, 361), (64, 90), (109, 91)),  # more than 4x
          ((435, 361), (32, 46), (109, 91)),  # almost 8x
          ((435, 361), (32, 45), (55, 46)),  # more than 8x
          ((435, 361), (16, 22), (55, 46)),  # more than 16x
      ]:
          im = draft_roundtrip("L", in_size, None, req_size)
          im.load()
          assert im.size == out_size
  
imports: from PIL import Image
  from .helper import fromstring, skip_unless_feature, tostring
label_desc: Use image node_id 2 for calling a global function with example usage: test_size() without return types