Skip to content

[Bug]: Resize transform passes non-square dimensions to Pillow in the wrong order #649

Description

@CODING-DARSH

What happened?

The Resize transform passes FastEmbed's internal image size representation
directly to PIL.Image.resize().

FastEmbed stores image sizes as (height, width), while Pillow expects
(width, height).

This is not observable for square image sizes, but for non-square image
processor configurations the output dimensions are swapped.

What is the expected behaviour?

The Resize transform should convert the internal (height, width) format
to Pillow's expected (width, height) format before calling
PIL.Image.resize().

A minimal reproducible example

img = Image.new("RGB", (300, 300))
resize = Resize(size=(100, 200))
out = resize(img)
print(out.size)

What Python version are you on? e.g. python --version

python 3.13.3

FastEmbed version

0.7.4

What os are you seeing the problem on?

Windows

Relevant stack traces and/or logs

None.

The issue does not raise an exception.
It produces incorrect output dimensions for non-square resize configurations.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions