datasets metadata --update crops cover images larger than 560x280 to their top-left corner
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
Research direction
Start with _upload_dataset_image_file in src/kaggle/api/kaggle_api_extended.py and the crop behavior described in docs/datasets_metadata.md. Check how the image dimensions can be read for PNG, JPEG, and WebP, then compare the proposed centered 2:1 and 1:1 crops with the existing 560x280 behavior and fallback. Done when larger images get centered crops, unreadable dimensions retain the current crops, and the documented behavior matches.
Written by the indexing model from the issue text.
Description
When I upload a 1600x800 dataset-cover-image.png with kaggle datasets metadata --update, the dataset header shows only the top-left 560x280 pixels of the image, zoomed in. The thumbnail is a 280x280 square at x=140, so it's cut from the same corner.
The cause is that _upload_dataset_image_file always sends the same two crop rectangles, whatever the image size:
The docs mention it too ("While you can upload a larger image than 560px x 280px, the crops as specified above will be applied, and this may not look good"):
Most cover images are larger than the 560x280 minimum, so most uploads end up with a cropped corner, and the crop has to be fixed by hand in the web UI.
Suggestion: read the image size from the file header (PNG, JPEG and WebP all store it near the start, so no new dependency is needed) and send the largest centered 2:1 and 1:1 rectangles. For a 560x280 image that gives exactly the current crops, and the current crops can stay as the fallback when the size can't be read.
For now I work around it by patching the rectangles before the upload (tools/push_cover.py), and the API accepts full-image crops fine. I have a PR ready if this sounds good.
- Dominant language
- Python
- Stars
- 7.7k
- Forks
- 1.5k
- Avg merge
- 1d 6h
- Merged PRs (30d)
- 17
Getting set up
- Ships a Dockerfile or Docker Compose file
- No pull request template
- Read the contributing 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.
More from Kaggle/kaggle-cli
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Kaggle/kaggle-cli#1254 ·
Maintainers usually reply within 1 day
-
duplicate
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
Kaggle/kaggle-cli#1248 · 1 comment ·
Maintainers usually reply within 1 day
-
bug dependencies
Difficulty 3/5 1-2 days Newbie friendliness 52/100
Kaggle/kaggle-cli#1229 · 2 comments ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 Under an hour Newbie friendliness 50/100
Kaggle/kaggle-cli#1217 ·
Maintainers usually reply within 1 day
-
bug dependencies
Difficulty 4/5 3-5 days Newbie friendliness 45/100
Kaggle/kaggle-cli#1207 · 1 reaction ·
Maintainers usually reply within 1 day
All issues in Kaggle/kaggle-cli
Similar issues
-
Implement parse_url and accept http URLs for CPAN backendPossibly taken @patelshivani2283-lab claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
fedora-infra/anitya#2203 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
jingyaogong/minimind#947 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
berntpopp/litvar-link#173 ·
Maintainers usually reply within 1 day
-
area/compression comp/agent P2 type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
NousResearch/hermes-agent#158133 ·
Maintainers usually reply within 1 day