prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  tifffile deprecation warning on test_tifffile.py
  ## Description
  
  <!--
  (Note: for guidance on how to use `scikit-image`, please post instead on https://forum.image.sc/tag/scikit-image)
  -->
  
  ## Way to reproduce
  ```python
  run pytest on skimage/io/tests/test_tifffile.py
  ```
  Will show deprecation warning issues
  ```bash
  skimage/io/tests/test_tifffile.py ...................................    [100%]
  
  =============================== warnings summary ===============================
  skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-float32-shape1]
  skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-float32-shape1]
    /scikit-image/.venv/lib/python3.10/site-packages/tifffile/tifffile.py:1155: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 3) and dtype 'float32' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default, unless the 'photometric' parameter is specified.
      result = tif.write(
  
  skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-float32-shape2]
  skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-float32-shape2]
    /scikit-image/.venv/lib/python3.10/site-packages/tifffile/tifffile.py:1155: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 4) and dtype 'float32' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default, unless the 'photometric' parameter is specified.
      result = tif.write(
  
  skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-int16-shape1]
  skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-int16-shape1]
    /scikit-image/.venv/lib/python3.10/site-packages/tifffile/tifffile.py:1155: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 3) and dtype 'int16' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default, unless the 'photometric' parameter is specified.
      result = tif.write(
  
  skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-int16-shape2]
  skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-int16-shape2]
    /scikit-image/.venv/lib/python3.10/site-packages/tifffile/tifffile.py:1155: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 4) and dtype 'int16' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default, unless the 'photometric' parameter is specified.
      result = tif.write(
  
  skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-float64-shape1]
  skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-float64-shape1]
    /scikit-image/.venv/lib/python3.10/site-packages/tifffile/tifffile.py:1155: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 3) and dtype 'float64' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default, unless the 'photometric' parameter is specified.
      result = tif.write(
  
  skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-float64-shape2]
  skimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-float64-shape2]
    /scikit-image/.venv/lib/python3.10/site-packages/tifffile/tifffile.py:1155: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 4) and dtype 'float64' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default, unless the 'photometric' parameter is specified.
      result = tif.write(
  
  -- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
  
  ```
  
  
  
  </issue>
  <code>
  [start of skimage/io/_plugins/tifffile_plugin.py]
  1 __all__ = ['imread', 'imsave']
  2 
  3 from tifffile import imwrite as imsave, imread as tifffile_imread
  4 
  5 
  6 def imread(fname, **kwargs):
  7     """Load a tiff image from file.
  8 
  9     Parameters
  10     ----------
  11     fname : str or file
  12         File name or file-like-object.
  13     kwargs : keyword pairs, optional
  14         Additional keyword arguments to pass through (see ``tifffile``'s
  15         ``imread`` function).
  16 
  17     Notes
  18     -----
  19     Provided by the tifffile library [1]_, and supports many
  20     advanced image types including multi-page and floating point.
  21 
  22     References
  23     ----------
  24     .. [1] https://pypi.org/project/tifffile/
  25 
  26     """
  27     if 'img_num' in kwargs:
  28         kwargs['key'] = kwargs.pop('img_num')
  29 
  30     return tifffile_imread(fname, **kwargs)
  31
  [end of skimage/io/_plugins/tifffile_plugin.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/skimage/io/_plugins/tifffile_plugin.py b/skimage/io/_plugins/tifffile_plugin.py
  --- a/skimage/io/_plugins/tifffile_plugin.py
  +++ b/skimage/io/_plugins/tifffile_plugin.py
  @@ -1,6 +1,50 @@
  +from tifffile import imread as tifffile_imread
  +from tifffile import imwrite as tifffile_imwrite
  +
   __all__ = ['imread', 'imsave']
   
  -from tifffile import imwrite as imsave, imread as tifffile_imread
  +
  +def imsave(fname, arr, **kwargs):
  +    """Load a tiff image to file.
  +
  +    Parameters
  +    ----------
  +    fname : str or file
  +        File name or file-like object.
  +    arr : ndarray
  +        The array to write.
  +    kwargs : keyword pairs, optional
  +        Additional keyword arguments to pass through (see ``tifffile``'s
  +        ``imwrite`` function).
  +
  +    Notes
  +    -----
  +    Provided by the tifffile library [1]_, and supports many
  +    advanced image types including multi-page and floating-point.
  +
  +    This implementation will set ``photometric='RGB'`` when writing if the first
  +    or last axis of `arr` has length 3 or 4. To override this, explicitly
  +    pass the ``photometric`` kwarg.
  +
  +    This implementation will set ``planarconfig='SEPARATE'`` when writing if the
  +    first axis of arr has length 3 or 4. To override this, explicitly
  +    specify the ``planarconfig`` kwarg.
  +
  +    References
  +    ----------
  +    .. [1] https://pypi.org/project/tifffile/
  +
  +    """
  +    if arr.shape[0] in [3, 4]:
  +        if 'planarconfig' not in kwargs:
  +            kwargs['planarconfig'] = 'SEPARATE'
  +        rgb = True
  +    else:
  +        rgb = arr.shape[-1] in [3, 4]
  +    if rgb and 'photometric' not in kwargs:
  +        kwargs['photometric'] = 'RGB'
  +
  +    return tifffile_imwrite(fname, arr, **kwargs)
   
   
   def imread(fname, **kwargs):
  
verification_info: {"golden_diff": "diff --git a/skimage/io/_plugins/tifffile_plugin.py b/skimage/io/_plugins/tifffile_plugin.py\n--- a/skimage/io/_plugins/tifffile_plugin.py\n+++ b/skimage/io/_plugins/tifffile_plugin.py\n@@ -1,6 +1,50 @@\n+from tifffile import imread as tifffile_imread\n+from tifffile import imwrite as tifffile_imwrite\n+\n __all__ = ['imread', 'imsave']\n \n-from tifffile import imwrite as imsave, imread as tifffile_imread\n+\n+def imsave(fname, arr, **kwargs):\n+    \"\"\"Load a tiff image to file.\n+\n+    Parameters\n+    ----------\n+    fname : str or file\n+        File name or file-like object.\n+    arr : ndarray\n+        The array to write.\n+    kwargs : keyword pairs, optional\n+        Additional keyword arguments to pass through (see ``tifffile``'s\n+        ``imwrite`` function).\n+\n+    Notes\n+    -----\n+    Provided by the tifffile library [1]_, and supports many\n+    advanced image types including multi-page and floating-point.\n+\n+    This implementation will set ``photometric='RGB'`` when writing if the first\n+    or last axis of `arr` has length 3 or 4. To override this, explicitly\n+    pass the ``photometric`` kwarg.\n+\n+    This implementation will set ``planarconfig='SEPARATE'`` when writing if the\n+    first axis of arr has length 3 or 4. To override this, explicitly\n+    specify the ``planarconfig`` kwarg.\n+\n+    References\n+    ----------\n+    .. [1] https://pypi.org/project/tifffile/\n+\n+    \"\"\"\n+    if arr.shape[0] in [3, 4]:\n+        if 'planarconfig' not in kwargs:\n+            kwargs['planarconfig'] = 'SEPARATE'\n+        rgb = True\n+    else:\n+        rgb = arr.shape[-1] in [3, 4]\n+    if rgb and 'photometric' not in kwargs:\n+        kwargs['photometric'] = 'RGB'\n+\n+    return tifffile_imwrite(fname, arr, **kwargs)\n \n \n def imread(fname, **kwargs):\n", "issue": "tifffile deprecation warning on test_tifffile.py\n## Description\r\n\r\n<!--\r\n(Note: for guidance on how to use `scikit-image`, please post instead on https://forum.image.sc/tag/scikit-image)\r\n-->\r\n\r\n## Way to reproduce\r\n```python\r\nrun pytest on skimage/io/tests/test_tifffile.py\r\n```\r\nWill show deprecation warning issues\r\n```bash\r\nskimage/io/tests/test_tifffile.py ...................................    [100%]\r\n\r\n=============================== warnings summary ===============================\r\nskimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-float32-shape1]\r\nskimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-float32-shape1]\r\n  /scikit-image/.venv/lib/python3.10/site-packages/tifffile/tifffile.py:1155: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 3) and dtype 'float32' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default, unless the 'photometric' parameter is specified.\r\n    result = tif.write(\r\n\r\nskimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-float32-shape2]\r\nskimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-float32-shape2]\r\n  /scikit-image/.venv/lib/python3.10/site-packages/tifffile/tifffile.py:1155: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 4) and dtype 'float32' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default, unless the 'photometric' parameter is specified.\r\n    result = tif.write(\r\n\r\nskimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-int16-shape1]\r\nskimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-int16-shape1]\r\n  /scikit-image/.venv/lib/python3.10/site-packages/tifffile/tifffile.py:1155: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 3) and dtype 'int16' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default, unless the 'photometric' parameter is specified.\r\n    result = tif.write(\r\n\r\nskimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-int16-shape2]\r\nskimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-int16-shape2]\r\n  /scikit-image/.venv/lib/python3.10/site-packages/tifffile/tifffile.py:1155: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 4) and dtype 'int16' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default, unless the 'photometric' parameter is specified.\r\n    result = tif.write(\r\n\r\nskimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-float64-shape1]\r\nskimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-float64-shape1]\r\n  /scikit-image/.venv/lib/python3.10/site-packages/tifffile/tifffile.py:1155: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 3) and dtype 'float64' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default, unless the 'photometric' parameter is specified.\r\n    result = tif.write(\r\n\r\nskimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[False-float64-shape2]\r\nskimage/io/tests/test_tifffile.py::TestSave::test_imsave_roundtrip[True-float64-shape2]\r\n  /scikit-image/.venv/lib/python3.10/site-packages/tifffile/tifffile.py:1155: DeprecationWarning: <tifffile.TiffWriter.write> data with shape (10, 10, 4) and dtype 'float64' are stored as RGB with contiguous samples. Future versions will store such data as MINISBLACK in separate pages by default, unless the 'photometric' parameter is specified.\r\n    result = tif.write(\r\n\r\n-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html\r\n\r\n```\r\n\r\n\n", "before_files": [{"content": "__all__ = ['imread', 'imsave']\n\nfrom tifffile import imwrite as imsave, imread as tifffile_imread\n\n\ndef imread(fname, **kwargs):\n    \"\"\"Load a tiff image from file.\n\n    Parameters\n    ----------\n    fname : str or file\n        File name or file-like-object.\n    kwargs : keyword pairs, optional\n        Additional keyword arguments to pass through (see ``tifffile``'s\n        ``imread`` function).\n\n    Notes\n    -----\n    Provided by the tifffile library [1]_, and supports many\n    advanced image types including multi-page and floating point.\n\n    References\n    ----------\n    .. [1] https://pypi.org/project/tifffile/\n\n    \"\"\"\n    if 'img_num' in kwargs:\n        kwargs['key'] = kwargs.pop('img_num')\n\n    return tifffile_imread(fname, **kwargs)\n", "path": "skimage/io/_plugins/tifffile_plugin.py"}]}