Skip to content

BUG:API crash if invalid metadata found #1111

@aniket866

Description

@aniket866

Is there an existing issue for this?

  • I have searched the existing issues

What happened?

Where :backend/app/routes/images.py

What happened ? : The MetadataModel enforces strict types (e.g., width: int), so if the database contains images where metadata parsing failed (returning None), Pydantic validation throws an error.

What should be : Make fields Optional (e.g., width: Optional[int] = None) or use validators to provide defaults.

Why?: A single image with missing EXIF data causes the get_all_images endpoint to return HTTP 500, breaking the gallery for the entire library.

Record

  • I agree to follow this project's Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions