[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 11080420dd: Improve gif_load error messages
From: |
Lars Ingebrigtsen |
Subject: |
master 11080420dd: Improve gif_load error messages |
Date: |
Mon, 11 Apr 2022 06:33:07 -0400 (EDT) |
branch: master
commit 11080420dd7f2c34bbebf797de6eb4d4a14dae35
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>
Improve gif_load error messages
* src/image.c (gif_load): Improve error reporting (bug#54848).
---
src/image.c | 17 ++++++++++++++---
1 file changed, 14 insertions(+), 3 deletions(-)
diff --git a/src/image.c b/src/image.c
index e3e540e5e2..3f9111a709 100644
--- a/src/image.c
+++ b/src/image.c
@@ -8754,10 +8754,21 @@ gif_load (struct frame *f, struct image *img)
rc = DGifSlurp (gif);
if (rc == GIF_ERROR || gif->ImageCount <= 0)
{
- if (NILP (specified_data))
- image_error ("Error reading `%s'", img->spec);
+#if HAVE_GIFERRORSTRING
+ const char *errstr = GifErrorString (gif->Error);
+ if (errstr)
+ if (NILP (specified_data))
+ image_error ("Error reading `%s' (%s)", img->spec,
+ build_string (errstr));
+ else
+ image_error ("Error reading GIF data: %s",
+ build_string (errstr));
else
- image_error ("Error reading GIF data");
+#endif
+ if (NILP (specified_data))
+ image_error ("Error reading `%s'", img->spec);
+ else
+ image_error ("Error reading GIF data");
goto gif_error;
}
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 11080420dd: Improve gif_load error messages,
Lars Ingebrigtsen <=