datasets metadata --update crops cover images larger than 560x280 to their top-left corner
Los mantenedores suelen responder en 1 día
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 55/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- Python
- Estrellas
- 7.7k
- Forks
- 1.5k
- Merge medio
- 1 d 6 h
- PR fusionados (30 d)
- 17
Preparar el entorno
- Incluye un Dockerfile o un archivo de Docker Compose
- Sin plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Kaggle/kaggle-cli
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Kaggle/kaggle-cli#1254 ·
Los mantenedores suelen responder en 1 día
-
duplicate
Dificultad 2/5 1-3 horas Aptitud para principiantes 66/100
Kaggle/kaggle-cli#1248 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug dependencies
Dificultad 3/5 1-2 días Aptitud para principiantes 52/100
Kaggle/kaggle-cli#1229 · 2 comentarios ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 2/5 Menos de una hora Aptitud para principiantes 50/100
Kaggle/kaggle-cli#1217 ·
Los mantenedores suelen responder en 1 día
-
bug dependencies
Dificultad 4/5 3-5 días Aptitud para principiantes 45/100
Kaggle/kaggle-cli#1207 · 1 reacción ·
Los mantenedores suelen responder en 1 día
Todos los issues de Kaggle/kaggle-cli
Issues similares
-
documentation
Dificultad 1/5 Menos de una hora Aptitud para principiantes 74/100
BrainLesion/BraTS#200 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
OpenHands/extensions#970 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 62/100
rl-institut/enetra#91 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
huggingface/datasets#9100 ·
Los mantenedores suelen responder en 1 día
-
needs-triage
Dificultad 2/5 1-3 horas Aptitud para principiantes 74/100
NVIDIA/garak#2486 · 1 comentario ·
Los mantenedores suelen responder en 2 días