Problem
Directory mode skips files with uppercase extensions (.JPG, .JPEG, .PNG) because the endswith check is case-sensitive. Common iPhone/Android/Windows camera outputs are .JPG and get silently ignored with no warning.
Steps
mkdir photos && cp IMG_0001.JPG photos/ (uppercase extension, as produced by most cameras)
split-image photos 2 2
Expected
Image tiled into 4 pieces.
Actual
Output: Splitting all images in directory: photos then Done! — file skipped silently, no tiles produced, no warning.
Cite
src/split_image/split.py:175:
if file.endswith(".jpg") or file.endswith(".jpeg") or file.endswith(".png"):
Fix: lowercase the extension before compare, e.g. if file.lower().endswith((".jpg", ".jpeg", ".png")). Also consider adding .webp, .bmp, .tiff (all Pillow-supported).
Environment
split-image 2.0.3 (setup.py), Pillow>=9.0.0, Python >=3.6, any OS.
Thanks for maintaining whiplashoo/split-image!
Problem
Directory mode skips files with uppercase extensions (
.JPG,.JPEG,.PNG) because theendswithcheck is case-sensitive. Common iPhone/Android/Windows camera outputs are.JPGand get silently ignored with no warning.Steps
mkdir photos && cp IMG_0001.JPG photos/(uppercase extension, as produced by most cameras)split-image photos 2 2Expected
Image tiled into 4 pieces.
Actual
Output:
Splitting all images in directory: photosthenDone!— file skipped silently, no tiles produced, no warning.Cite
src/split_image/split.py:175:Fix: lowercase the extension before compare, e.g.
if file.lower().endswith((".jpg", ".jpeg", ".png")). Also consider adding.webp,.bmp,.tiff(all Pillow-supported).Environment
split-image 2.0.3 (setup.py), Pillow>=9.0.0, Python >=3.6, any OS.
Thanks for maintaining whiplashoo/split-image!