Improve error message for imagecropauto if palette index is not found

Abierto
#708 1 comentario 0 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
38/100
Tipo de issue
Error
Claridad
Bien especificado
Estado de actividad
Estancado
Stack tecnológico
c

Línea de trabajo

The issue asks that imagecropauto's threshold-mode error, raised when the palette index given as the color argument is absent, say the index was not found instead of the current 'must be greater than or equal to 0' wording. Search the repository for that message text and for the imagecropauto implementation to find where it is raised, then reproduce with a threshold crop and an absent index. Done when the new message names the missing palette index and the existing tests still pass. The payload does not show which file holds the message, and the thread has had no reply in about five years, so confirm the maintainers still want the change first.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

When IMG_CROP_THRESHOLD is used and the palette index specified in imagecropauto (parameter $color) is not present in the image, the error message is:

Fatal error: Uncaught ValueError: imagecropauto(): Argument #4 ($color) must be greater than or equal to 0 when using the threshold mode in /srv/krauler/controller.php:68

This error message is confusing. It should rather say that the palette index was not found.

Lenguaje dominante
C
Estrellas
985
Forks
289
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de libgd/libgd

Todos los issues de libgd/libgd

Issues similares

Más issues de C

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.