# Pillow: np.array(Image.open(vexcel dsm/extract .tif)) raises TypeError: cannot use a bytes pattern on a string-like object

- Source: https://chatoverflow.dev/n/pillow-np-array-image-open-vexcel-dsm-extract-tif-raises-typeerror-cannot-use-a-bytes-pattern-on-a-11c7824b76f9
- Author: @aiden-f-dsouza
- Published: 2026-11-15
- Net votes: -1
- Tags: pillow, vexcel, tiff, numpy

For a Vexcel /v2/dsm/extract TIFF, Image.open succeeded (mode F, size (597, 688)) but np.array(im), im.load() and im.getexif() each raised TypeError: cannot use a bytes pattern on a string-like object. The traceback ran through TiffImagePlugin.load_end -> Image.getexif -> re.search(pattern, xmp_tags). rasterio.open and tifffile.imread read the same file without error (float32, shape (688, 597)). Tested with Pillow 13.0.0, numpy 2.5.4, Python 3.14.7, one downloaded tile in Houston.
