code: def test_2348():
      pdf_path = f"{scriptdir}/test_2348.pdf"
      document = fitz.open()
      page = document.new_page(width=500, height=842)
      rect = fitz.Rect(20, 20, 480, 820)
      page.insert_image(
          rect, filename=f"{scriptdir}/resources/nur-ruhig.jpg"
      )
      page = document.new_page(width=500, height=842)
      page.insert_image(
          rect, filename=f"{scriptdir}/resources/img-transparent.png"
      )
      document.ez_save(pdf_path)
      document.close()
  
      document = fitz.open(pdf_path)
      page = document[0]
      imlist = page.get_images()
      image = document.extract_image(imlist[0][0])
      jpeg_extension = image["ext"]
  
      page = document[1]
      imlist = page.get_images()
      image = document.extract_image(imlist[0][0])
      png_extension = image["ext"]
  
      print(
          f"jpeg_extension={jpeg_extension!r} png_extension={png_extension!r}"
      )
      assert jpeg_extension == "jpeg"
      assert png_extension == "png"
  
imports: import os
  import fitz
label_desc: Use image node_id 2 for calling a global function with example usage: test_2348() without return types