Skip to content

Commit

Permalink
🎨 refactor(image-metadata): reorganize and optimize metadata handling
Browse files Browse the repository at this point in the history
- Add `_type.py` for type definitions and helper functions
- Improve error handling and type checking in `lsb_extractor.py`
- Refactor `__init__.py` to use new types and helper functions
- Update `CommentModel` to use `Optional` for all fields
- Enhance `apply_to_image` to handle various input types
- Add `_extract_metadata_from_lsb` and `_extract_metadata_from_comments` methods
- Improve `verify_image_is_novelai` for better metadata extraction and verification
  • Loading branch information
sudoskys committed Sep 27, 2024
1 parent 7569169 commit 76afcc2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/novelai_python/tool/image_metadata/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def _extract_metadata_from_lsb(cls, image: IMAGE_INPUT_TYPE):
def _extract_metadata_from_comments(cls, image: IMAGE_INPUT_TYPE):
"""
Extract metadata from image comments and other info.
:param image: IMAGE_INPUT_TYPE
:param image: Union[str, bytes, Path, BytesIO]
"""
with Image.open(image) as img:
title = img.info.get("Title", None)
Expand Down

0 comments on commit 76afcc2

Please sign in to comment.