Skip to content

[Validator] Video and Image Constraints - minPixels nad maxPixels properties should not be float. #61980

@wkania

Description

@wkania

Description

I propose removing the float type from the minPixels and maxPixels parameters in the Video constraint.
For the Image constraint, the float type should likely be deprecated.

Reason for change:

  • minPixels and maxPixels can currently be float, even though the number of pixels is calculated as the product of width * height, which should always be an integer.
  • minWidth, maxWidth, minHeight, and maxHeight are of type int.
  • The Image documentation mentions integers, but the implementation also accepts floats.

The Video constraint was derived from the Image constraint, with the Image type definitions introduced in this PR.

I have not found any discussion addressing this issue, and it seems to be an oversight caused by the fact that minRatio and maxRatio can be floats.

I can submit a PR unless this was an intentional design decision.
If it was intentional, then the Image documentation should be updated accordingly.

Example

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions