feat(phase1): add image storage utilities
- Create backend/services/image_storage.py with 4 core functions:
- sanitize_filename(): remove unsafe chars, limit to 255 chars, convert to lowercase
- get_unique_filename(): handle collisions with UUID suffix (format: {name}_{uuid8}_{variant}.jpg)
- ensure_image_directories(): create /images/ root and category subdirs on startup
- save_image(): save bytes to /images/{category}/{filename}, returns relative path
- Create comprehensive test suite (22 tests) covering all functionality
- Integrate ensure_image_directories() into FastAPI startup event
- Directory structure: /images/{category}/{filename}
- Collision handling: auto-suffix with UUID if filename exists
- All tests passing, pathlib.Path for safe operations
This commit is contained in:
BIN
venv/lib/python3.12/site-packages/pillow.libs/libXau-154567c4.so.6.0.0
Executable file
BIN
venv/lib/python3.12/site-packages/pillow.libs/libXau-154567c4.so.6.0.0
Executable file
Binary file not shown.
BIN
venv/lib/python3.12/site-packages/pillow.libs/libavif-a883386a.so.16.4.1
Executable file
BIN
venv/lib/python3.12/site-packages/pillow.libs/libavif-a883386a.so.16.4.1
Executable file
Binary file not shown.
BIN
venv/lib/python3.12/site-packages/pillow.libs/libbrotlicommon-785b7a00.so.1.2.0
Executable file
BIN
venv/lib/python3.12/site-packages/pillow.libs/libbrotlicommon-785b7a00.so.1.2.0
Executable file
Binary file not shown.
BIN
venv/lib/python3.12/site-packages/pillow.libs/libbrotlidec-08d35d18.so.1.2.0
Executable file
BIN
venv/lib/python3.12/site-packages/pillow.libs/libbrotlidec-08d35d18.so.1.2.0
Executable file
Binary file not shown.
BIN
venv/lib/python3.12/site-packages/pillow.libs/libfreetype-d2d71ad9.so.6.20.6
Executable file
BIN
venv/lib/python3.12/site-packages/pillow.libs/libfreetype-d2d71ad9.so.6.20.6
Executable file
Binary file not shown.
BIN
venv/lib/python3.12/site-packages/pillow.libs/libharfbuzz-ef65cc8a.so.0.61321.0
Executable file
BIN
venv/lib/python3.12/site-packages/pillow.libs/libharfbuzz-ef65cc8a.so.0.61321.0
Executable file
Binary file not shown.
BIN
venv/lib/python3.12/site-packages/pillow.libs/libjpeg-8296d2fa.so.62.4.0
Executable file
BIN
venv/lib/python3.12/site-packages/pillow.libs/libjpeg-8296d2fa.so.62.4.0
Executable file
Binary file not shown.
BIN
venv/lib/python3.12/site-packages/pillow.libs/liblcms2-545f6561.so.2.0.18
Executable file
BIN
venv/lib/python3.12/site-packages/pillow.libs/liblcms2-545f6561.so.2.0.18
Executable file
Binary file not shown.
BIN
venv/lib/python3.12/site-packages/pillow.libs/liblzma-3c942967.so.5.8.3
Executable file
BIN
venv/lib/python3.12/site-packages/pillow.libs/liblzma-3c942967.so.5.8.3
Executable file
Binary file not shown.
BIN
venv/lib/python3.12/site-packages/pillow.libs/libopenjp2-f3576751.so.2.5.4
Executable file
BIN
venv/lib/python3.12/site-packages/pillow.libs/libopenjp2-f3576751.so.2.5.4
Executable file
Binary file not shown.
BIN
venv/lib/python3.12/site-packages/pillow.libs/libpng16-65c953c0.so.16.56.0
Executable file
BIN
venv/lib/python3.12/site-packages/pillow.libs/libpng16-65c953c0.so.16.56.0
Executable file
Binary file not shown.
BIN
venv/lib/python3.12/site-packages/pillow.libs/libsharpyuv-0bacc318.so.0.1.2
Executable file
BIN
venv/lib/python3.12/site-packages/pillow.libs/libsharpyuv-0bacc318.so.0.1.2
Executable file
Binary file not shown.
BIN
venv/lib/python3.12/site-packages/pillow.libs/libtiff-f4bc73ff.so.6.2.0
Executable file
BIN
venv/lib/python3.12/site-packages/pillow.libs/libtiff-f4bc73ff.so.6.2.0
Executable file
Binary file not shown.
BIN
venv/lib/python3.12/site-packages/pillow.libs/libwebp-67ee3789.so.7.2.0
Executable file
BIN
venv/lib/python3.12/site-packages/pillow.libs/libwebp-67ee3789.so.7.2.0
Executable file
Binary file not shown.
BIN
venv/lib/python3.12/site-packages/pillow.libs/libwebpdemux-eeb71312.so.2.0.17
Executable file
BIN
venv/lib/python3.12/site-packages/pillow.libs/libwebpdemux-eeb71312.so.2.0.17
Executable file
Binary file not shown.
BIN
venv/lib/python3.12/site-packages/pillow.libs/libwebpmux-20a90b09.so.3.1.2
Executable file
BIN
venv/lib/python3.12/site-packages/pillow.libs/libwebpmux-20a90b09.so.3.1.2
Executable file
Binary file not shown.
BIN
venv/lib/python3.12/site-packages/pillow.libs/libxcb-bac6ebc8.so.1.1.0
Executable file
BIN
venv/lib/python3.12/site-packages/pillow.libs/libxcb-bac6ebc8.so.1.1.0
Executable file
Binary file not shown.
BIN
venv/lib/python3.12/site-packages/pillow.libs/libzstd-6ea785c0.so.1.5.7
Executable file
BIN
venv/lib/python3.12/site-packages/pillow.libs/libzstd-6ea785c0.so.1.5.7
Executable file
Binary file not shown.
Reference in New Issue
Block a user