qdrant / qdrant/fastembed

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

Open Beginner friendly
#649 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
3.2k
Forks
248
Avg merge
4d 8h
Merged PRs (30d)
4

Description

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.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the Resize transform and inspect how its internal (height, width) size is passed to PIL.Image.resize(). Reproduce the issue with Resize(size=(100, 200)); done means the output dimensions are (200, 100), with coverage for a non-square configuration if the existing test structure supports it.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-vision
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
76/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.