diff -Nurd imagesize-1.4.1.orig/imagesize/imagesize.py imagesize-1.4.1/imagesize/imagesize.py
--- imagesize-1.4.1.orig/imagesize/imagesize.py	2022-07-01 08:14:01.000000000 -0400
+++ imagesize-1.4.1/imagesize/imagesize.py	2022-10-02 22:04:47.000000000 -0400
@@ -84,7 +84,7 @@
     """
     Return (width, height) for a given img file content
     no requirements
-    :type filepath: Union[bytes, str, pathlib.Path]
+    :type filepath: Union[str, pathlib.Path]
     :rtype Tuple[int, int]
     """
     height = -1
@@ -93,7 +93,7 @@
     if isinstance(filepath, io.BytesIO):  # file-like object
         fhandle = filepath
     else:
-        fhandle = open(filepath, 'rb')
+        fhandle = open(str(filepath), 'rb')
 
     try:
         head = fhandle.read(31)
@@ -272,16 +272,12 @@
     """
     Return (x DPI, y DPI) for a given img file content
     no requirements
-    :type filepath: Union[bytes, str, pathlib.Path]
+    :type filepath: Union[str, pathlib.Path]
     :rtype Tuple[int, int]
     """
     xDPI = -1
     yDPI = -1
-
-    if not isinstance(filepath, bytes):
-        filepath = str(filepath)
-
-    with open(filepath, 'rb') as fhandle:
+    with open(str(filepath), 'rb') as fhandle:
         head = fhandle.read(24)
         size = len(head)
         # handle GIFs
diff -Nurd imagesize-1.4.1.orig/test/test_get.py imagesize-1.4.1/test/test_get.py
--- imagesize-1.4.1.orig/test/test_get.py	2021-11-09 10:07:47.000000000 -0500
+++ imagesize-1.4.1/test/test_get.py	2022-10-02 22:07:56.000000000 -0400
@@ -2,14 +2,7 @@
 import os
 import imagesize
 
-try:
-    from pathlib import Path
-except ImportError:
-    # Python 2
-    Path = None
-
 imagedir = os.path.join(os.path.dirname(__file__), "images")
-imagedir_bytes = imagedir.encode("utf-8")
 
 
 class GetTest(unittest.TestCase):
@@ -68,80 +61,3 @@
                 width, height = imagesize.get(test_file)
                 self.assertEqual(width, 65)
                 self.assertEqual(height, 20)
-
-    def test_load_png_bytes(self):
-        width, height = imagesize.get(os.path.join(imagedir_bytes, b"test.png"))
-        self.assertEqual(width, 802)
-        self.assertEqual(height, 670)
-
-    def test_load_jpeg_bytes(self):
-        width, height = imagesize.get(os.path.join(imagedir_bytes, b"test.jpg"))
-        self.assertEqual(width, 802)
-        self.assertEqual(height, 670)
-
-    def test_load_jpeg2000_bytes(self):
-        width, height = imagesize.get(os.path.join(imagedir_bytes, b"test.jp2"))
-        self.assertEqual(width, 802)
-        self.assertEqual(height, 670)
-
-    def test_load_gif_bytes(self):
-        width, height = imagesize.get(os.path.join(imagedir_bytes, b"test.gif"))
-        self.assertEqual(width, 802)
-        self.assertEqual(height, 670)
-
-    def test_bigendian_tiff_bytes(self):
-        width, height = imagesize.get(os.path.join(imagedir_bytes, b"test.tiff"))
-        self.assertEqual(width, 802)
-        self.assertEqual(height, 670)
-
-    def test_load_svg_bytes(self):
-        width, height = imagesize.get(os.path.join(imagedir_bytes, b"test.svg"))
-        self.assertEqual(width, 90)
-        self.assertEqual(height, 60)
-
-    def test_littleendian_tiff_bytes(self):
-        width, height = imagesize.get(os.path.join(imagedir_bytes, b"multipage_tiff_example.tif"))
-        self.assertEqual(width, 800)
-        self.assertEqual(height, 600)
-
-    @unittest.skipIf(Path is None, "requires pathlib support")
-    def test_load_png_path(self):
-        width, height = imagesize.get(Path(imagedir, "test.png"))
-        self.assertEqual(width, 802)
-        self.assertEqual(height, 670)
-
-    @unittest.skipIf(Path is None, "requires pathlib support")
-    def test_load_jpeg_path(self):
-        width, height = imagesize.get(Path(imagedir, "test.jpg"))
-        self.assertEqual(width, 802)
-        self.assertEqual(height, 670)
-
-    @unittest.skipIf(Path is None, "requires pathlib support")
-    def test_load_jpeg2000_path(self):
-        width, height = imagesize.get(Path(imagedir, "test.jp2"))
-        self.assertEqual(width, 802)
-        self.assertEqual(height, 670)
-
-    @unittest.skipIf(Path is None, "requires pathlib support")
-    def test_load_gif_path(self):
-        width, height = imagesize.get(Path(imagedir, "test.gif"))
-        self.assertEqual(width, 802)
-        self.assertEqual(height, 670)
-
-    @unittest.skipIf(Path is None, "requires pathlib support")
-    def test_bigendian_tiff_path(self):
-        width, height = imagesize.get(Path(imagedir, "test.tiff"))
-        self.assertEqual(width, 802)
-        self.assertEqual(height, 670)
-
-    @unittest.skipIf(Path is None, "requires pathlib support")
-    def test_load_svg_path(self):
-        width, height = imagesize.get(Path(imagedir, "test.svg"))
-        self.assertEqual(width, 90)
-        self.assertEqual(height, 60)
-
-    @unittest.skipIf(Path is None, "requires pathlib support")
-    def test_littleendian_tiff_path(self):
-        width, height = imagesize.get(Path(imagedir, "multipage_tiff_example.tif"))
-        self.assertEqual(width, 800)
-        self.assertEqual(height, 600)
diff -Nurd imagesize-1.4.1.orig/test/test_getdpi.py imagesize-1.4.1/test/test_getdpi.py
--- imagesize-1.4.1.orig/test/test_getdpi.py	2021-11-09 10:07:47.000000000 -0500
+++ imagesize-1.4.1/test/test_getdpi.py	2022-10-02 22:11:57.000000000 -0400
@@ -2,15 +2,7 @@
 import os
 import imagesize
 
-try:
-    from pathlib import Path
-except ImportError:
-    # Python 2
-    Path = None
-
-
 imagedir = os.path.join(os.path.dirname(__file__), "images")
-imagedir_bytes = imagedir.encode("utf-8")
 
 
 class GetDPITest(unittest.TestCase):
@@ -48,80 +40,3 @@
         xdpi, ydpi = imagesize.getDPI(os.path.join(imagedir, "multipage_tiff_example.tif"))
         self.assertEqual(xdpi, -1)
         self.assertEqual(ydpi, -1)
-
-    def test_png_bytes(self):
-        xdpi, ydpi = imagesize.getDPI(os.path.join(imagedir_bytes, b"test.png"))
-        self.assertEqual(xdpi, 72)
-        self.assertEqual(ydpi, 72)
-
-    def test_jpeg_bytes(self):
-        xdpi, ydpi = imagesize.getDPI(os.path.join(imagedir_bytes, b"test.jpg"))
-        self.assertEqual(xdpi, 72)
-        self.assertEqual(ydpi, 72)
-
-    def test_jpeg2000_bytes(self):
-        xdpi, ydpi = imagesize.getDPI(os.path.join(imagedir_bytes, b"test.jp2"))
-        self.assertEqual(xdpi, -1)
-        self.assertEqual(ydpi, -1)
-
-    def test_gif_bytes(self):
-        xdpi, ydpi = imagesize.getDPI(os.path.join(imagedir_bytes, b"test.gif"))
-        self.assertEqual(xdpi, -1)
-        self.assertEqual(ydpi, -1)
-
-    def test_bigendian_tiff_bytes(self):
-        xdpi, ydpi = imagesize.getDPI(os.path.join(imagedir_bytes, b"test.tiff"))
-        self.assertEqual(xdpi, -1)
-        self.assertEqual(ydpi, -1)
-
-    def test_svg_bytes(self):
-        xdpi, ydpi = imagesize.getDPI(os.path.join(imagedir_bytes, b"test.svg"))
-        self.assertEqual(xdpi, -1)
-        self.assertEqual(ydpi, -1)
-
-    def test_littleendian_tiff_bytes(self):
-        xdpi, ydpi = imagesize.getDPI(os.path.join(imagedir_bytes, b"multipage_tiff_example.tif"))
-        self.assertEqual(xdpi, -1)
-        self.assertEqual(ydpi, -1)
-
-    @unittest.skipIf(Path is None, "requires pathlib support")
-    def test_png_path(self):
-        xdpi, ydpi = imagesize.getDPI(Path(imagedir, "test.png"))
-        self.assertEqual(xdpi, 72)
-        self.assertEqual(ydpi, 72)
-
-    @unittest.skipIf(Path is None, "requires pathlib support")
-    def test_jpeg_path(self):
-        xdpi, ydpi = imagesize.getDPI(Path(imagedir, "test.jpg"))
-        self.assertEqual(xdpi, 72)
-        self.assertEqual(ydpi, 72)
-
-    @unittest.skipIf(Path is None, "requires pathlib support")
-    def test_jpeg2000_path(self):
-        xdpi, ydpi = imagesize.getDPI(Path(imagedir, "test.jp2"))
-        self.assertEqual(xdpi, -1)
-        self.assertEqual(ydpi, -1)
-
-    @unittest.skipIf(Path is None, "requires pathlib support")
-    def test_gif_path(self):
-        xdpi, ydpi = imagesize.getDPI(Path(imagedir, "test.gif"))
-        self.assertEqual(xdpi, -1)
-        self.assertEqual(ydpi, -1)
-
-    @unittest.skipIf(Path is None, "requires pathlib support")
-    def test_bigendian_tiff_path(self):
-        xdpi, ydpi = imagesize.getDPI(Path(imagedir, "test.tiff"))
-        self.assertEqual(xdpi, -1)
-        self.assertEqual(ydpi, -1)
-
-    @unittest.skipIf(Path is None, "requires pathlib support")
-    def test_svg_path(self):
-        xdpi, ydpi = imagesize.getDPI(Path(imagedir, "test.svg"))
-        self.assertEqual(xdpi, -1)
-        self.assertEqual(ydpi, -1)
-
-    @unittest.skipIf(Path is None, "requires pathlib support")
-    def test_littleendian_tiff_path(self):
-        xdpi, ydpi = imagesize.getDPI(Path(imagedir, "multipage_tiff_example.tif"))
-        self.assertEqual(xdpi, -1)
-        self.assertEqual(ydpi, -1)
