[Bug]: Resize transform passes non-square dimensions to Pillow in the wrong order
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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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