Skip to content

Conversation

@LeanderCS
Copy link
Owner

@LeanderCS LeanderCS commented Jul 3, 2025

Summary by Bito

This pull request enhances image processing capabilities by introducing new filters, ToBase64ImageFilter and ToImageFilter, for image conversion and processing. It also adds the IsImageValidator for improved input validation and updates existing filters and validation methods. Comprehensive unit tests have been added to ensure functionality and robustness.

Copilot AI review requested due to automatic review settings July 3, 2025 10:36
@sonarqubecloud
Copy link

sonarqubecloud bot commented Jul 3, 2025

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

Adds support for validating and converting image inputs by introducing a new image validator and two image filters, along with tests, a version bump, and changelog updates.

  • Introduce IsImageValidator with unit tests for PIL objects, base64, bytes, and custom errors.
  • Add ToImageFilter and ToBase64ImageFilter with corresponding tests to convert values to PIL.Image or base64 strings.
  • Bump package version to 0.6.2 and update changelog.rst, plus minor formatting adjustments in setup and mixins.

Reviewed Changes

Copilot reviewed 22 out of 22 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
tests/validators/test_is_image_validator.py Tests covering valid/invalid image inputs
flask_inputfilter/validators/is_image_validator.py Implementation of IsImageValidator
tests/filters/test_to_image_filter.py Tests for converting inputs to PIL.Image
flask_inputfilter/filters/to_image_filter.py Implementation of ToImageFilter
tests/filters/test_to_base64_image_filter.py Tests for converting inputs to base64 strings
flask_inputfilter/filters/to_base64_image_filter.py Implementation of ToBase64ImageFilter
pyproject.toml Version bump to 0.6.2 and formatting settings
docs/source/changelog.rst Added 0.6.2 entry for new features
Comments suppressed due to low confidence (2)

flask_inputfilter/filters/to_base64_image_filter.py:51

  • [nitpick] Parameter name format shadows the built-in format() function; consider renaming it to output_format for clarity and to avoid confusion.
        format: Optional[ImageFormatEnum] = None,

tests/validators/test_is_image_validator.py:22

  • Add a test for validating a file path string (e.g., pointing to a real image on disk) to ensure file-path support in IsImageValidator is covered.
        with open("tests/data/base64_image.txt") as file:

Repository owner deleted a comment from Copilot AI Jul 3, 2025
@LeanderCS LeanderCS merged commit cebba0e into main Jul 3, 2025
8 checks passed
@LeanderCS LeanderCS deleted the ruff branch July 3, 2025 10:45
LeanderCS added a commit that referenced this pull request Jul 3, 2025
Add IsImageValidator, ToBase64ImageFilter and ToImageFilter
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.

2 participants