Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update #185

Closed
wants to merge 4 commits into from
Closed

Update #185

wants to merge 4 commits into from

Conversation

dragonked2
Copy link

Exception Handling and Assertions:
The original code contained comments that explained the purpose of exceptions and assertions. Since comments are removed, you will need to refer to the original code if you need detailed explanations on these parts.

Consistency and Formatting:
Minor formatting changes were applied to ensure consistent indentation and spacing, maintaining Python's PEP 8 style guide.

Asserting Exif Data Location:
The final find_exif() function asserts that the Exif data is correctly located in the HEIC file. This involves checking offsets and verifying that the Exif header is in the expected format.

    Encoding the Filename:
        Removed a redundant assignment of escaped_fn.
        Used a single assignment to properly encode and decode the filename.

    File Handling:
        Changed how the file is opened and processed using a with statement.
        This ensures the file is closed automatically after processing.

    Error Handling:
        Added handling for cases where a file is not found (FileNotFoundError).
        Added a catch-all exception handler for other unexpected errors.

    Logging:
        Improved log messages for better context and readability.
        Included specific messages for file not found and processing errors.

    Printing:
        Replaced print() with logger.info('') for consistency in logging.

    Exception Handling in logger.info():
        Made sure that any errors when formatting log messages are caught.

    User-Friendly Messages:
        Provided clearer messages when a file is not found or when errors occur.

    Argument Parsing and Main Function:
        Added type hints to function signatures for better code understanding.
Exception Handling and Assertions:
The original code contained comments that explained the purpose of exceptions and assertions. Since comments are removed, you will need to refer to the original code if you need detailed explanations on these parts.

Consistency and Formatting:
Minor formatting changes were applied to ensure consistent indentation and spacing, maintaining Python's PEP 8 style guide.

Asserting Exif Data Location:
The final find_exif() function asserts that the Exif data is correctly located in the HEIC file. This involves checking offsets and verifying that the Exif header is in the expected format.
@dragonked2 dragonked2 closed this Aug 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant