code: def test_jpg_more(test_images, tmp_path):
      fnamebase = str(tmp_path / "test")
  
      # Test broken JPEG
      fname = fnamebase + "_broken.jpg"
      open(fname, "wb").write(b"this is not an image")
      with pytest.raises(Exception):
          imageio.imread(fname)
      #
      img = get_ref_im(3, 0, 0)
      bb = imageio.imsave(imageio.RETURN_BYTES, img, "JPEG-PIL")
      with open(fname, "wb") as f:
          f.write(bb[:400])
          f.write(b" ")
          f.write(bb[400:])
      with pytest.raises(Exception):
          imageio.imread(fname, format="JPEG-PIL")
  
      # Test EXIF stuff
      fname = test_images / "rommel.jpg"
      im = imageio.imread(fname, format="JPEG-PIL")
      assert im.shape[0] > im.shape[1]
      im = imageio.imread(fname, exifrotate=False, format="JPEG-PIL")
      assert im.shape[0] < im.shape[1]
      im = imageio.imread(
          fname, exifrotate=2, format="JPEG-PIL"
      )  # Rotation in Python
      assert im.shape[0] > im.shape[1]
      # Write the jpg and check that exif data is maintained
      if sys.platform.startswith("darwin"):
          return  # segfaults on my osx VM, why?
      imageio.imsave(fnamebase + "rommel.jpg", im, format="JPEG-PIL")
      im = imageio.imread(fname, format="JPEG-PIL")
      assert im.meta.EXIF_MAIN
  
imports: import os
  import sys
  import io
  from zipfile import ZipFile
  import numpy
  import pytest
  import imageio
  from imageio import core
  from conftest import deprecated_test
label_desc: Use image node_id 8 for calling a global function with example usage: test_jpg_more(test_images, tmp_path) without return types