diff options
| author | Lars Ingebrigtsen | 2022-04-11 12:32:55 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2022-04-11 12:32:55 +0200 |
| commit | 11080420dd7f2c34bbebf797de6eb4d4a14dae35 (patch) | |
| tree | c1e95bf5e0944105e3f866c115d7161091e6854d /src | |
| parent | 7d5d0abd2d5a29cb1a5ea18298d49690fe60dc6f (diff) | |
| download | emacs-11080420dd7f2c34bbebf797de6eb4d4a14dae35.tar.gz emacs-11080420dd7f2c34bbebf797de6eb4d4a14dae35.zip | |
Improve gif_load error messages
* src/image.c (gif_load): Improve error reporting (bug#54848).
Diffstat (limited to 'src')
| -rw-r--r-- | src/image.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/image.c b/src/image.c index e3e540e5e28..3f9111a7093 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -8754,10 +8754,21 @@ gif_load (struct frame *f, struct image *img) | |||
| 8754 | rc = DGifSlurp (gif); | 8754 | rc = DGifSlurp (gif); |
| 8755 | if (rc == GIF_ERROR || gif->ImageCount <= 0) | 8755 | if (rc == GIF_ERROR || gif->ImageCount <= 0) |
| 8756 | { | 8756 | { |
| 8757 | if (NILP (specified_data)) | 8757 | #if HAVE_GIFERRORSTRING |
| 8758 | image_error ("Error reading `%s'", img->spec); | 8758 | const char *errstr = GifErrorString (gif->Error); |
| 8759 | if (errstr) | ||
| 8760 | if (NILP (specified_data)) | ||
| 8761 | image_error ("Error reading `%s' (%s)", img->spec, | ||
| 8762 | build_string (errstr)); | ||
| 8763 | else | ||
| 8764 | image_error ("Error reading GIF data: %s", | ||
| 8765 | build_string (errstr)); | ||
| 8759 | else | 8766 | else |
| 8760 | image_error ("Error reading GIF data"); | 8767 | #endif |
| 8768 | if (NILP (specified_data)) | ||
| 8769 | image_error ("Error reading `%s'", img->spec); | ||
| 8770 | else | ||
| 8771 | image_error ("Error reading GIF data"); | ||
| 8761 | goto gif_error; | 8772 | goto gif_error; |
| 8762 | } | 8773 | } |
| 8763 | 8774 | ||