code: def test_aspect():
      im = Image.new("L", (128, 128))
      im.thumbnail((100, 100))
      assert im.size == (100, 100)
  
      im = Image.new("L", (128, 256))
      im.thumbnail((100, 100))
      assert im.size == (50, 100)
  
      im = Image.new("L", (128, 256))
      im.thumbnail((50, 100))
      assert im.size == (50, 100)
  
      im = Image.new("L", (256, 128))
      im.thumbnail((100, 100))
      assert im.size == (100, 50)
  
      im = Image.new("L", (256, 128))
      im.thumbnail((100, 50))
      assert im.size == (100, 50)
  
      im = Image.new("L", (64, 64))
      im.thumbnail((100, 100))
      assert im.size == (64, 64)
  
      im = Image.new("L", (256, 162))  # ratio is 1.5802469136
      im.thumbnail((33, 33))
      assert im.size == (33, 21)  # ratio is 1.5714285714
  
      im = Image.new("L", (162, 256))  # ratio is 0.6328125
      im.thumbnail((33, 33))
      assert im.size == (21, 33)  # ratio is 0.6363636364
  
      im = Image.new("L", (145, 100))  # ratio is 1.45
      im.thumbnail((50, 50))
      assert im.size == (50, 34)  # ratio is 1.47058823529
  
      im = Image.new("L", (100, 145))  # ratio is 0.689655172414
      im.thumbnail((50, 50))
      assert im.size == (34, 50)  # ratio is 0.68
  
      im = Image.new("L", (100, 30))  # ratio is 3.333333333333
      im.thumbnail((75, 75))
      assert im.size == (75, 23)
  
file_path: pillow-simd/Tests/test_image_thumbnail.py
imports: import pytest
  from PIL import Image
  from .helper import assert_image_equal, assert_image_similar, fromstring, hopper, tostring
label_desc: Use image node_id 2 for calling a global function with example usage: test_aspect() without return types