summaryrefslogtreecommitdiff
path: root/src/lib/image.h
diff options
context:
space:
mode:
authorKim Woelders <kim@woelders.dk>2021-09-16 09:36:05 +0200
committerKim Woelders <kim@woelders.dk>2021-12-28 16:08:06 +0100
commitbf93574b8bd2eb315bf1a76dce6e5730eebd2018 (patch)
treea896456eae7494de57f84d7f90c01f28f5c4a60e /src/lib/image.h
parentf3db9c99b687030634f9f89818eb9c7361718e77 (diff)
downloadimlib2-bf93574b8bd2eb315bf1a76dce6e5730eebd2018.tar.gz
Introduce more loader return codes
Used to avoid potentially wasting time trying to load corrupt images by trying loaders which won't recognize the image anyway.
Diffstat (limited to 'src/lib/image.h')
-rw-r--r--src/lib/image.h10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/image.h b/src/lib/image.h
index 904b1bd..daaac57 100644
--- a/src/lib/image.h
+++ b/src/lib/image.h
@@ -143,9 +143,13 @@ int __imlib_CurrentCacheSize(void);
#define UPDATE_FLAG(flags, f, set) \
do { if (set) SET_FLAG(flags, f); else UNSET_FLAG(flags, f); } while(0)
-#define LOAD_FAIL 0
-#define LOAD_SUCCESS 1
-#define LOAD_BREAK 2
+#define LOAD_BREAK 2 /* Break signaled by progress callback */
+#define LOAD_SUCCESS 1 /* Image loaded successfully */
+#define LOAD_FAIL 0 /* Image was not recognized by loader */
+#define LOAD_OOM -1 /* Could not allocate memory */
+#define LOAD_BADFILE -2 /* File could not be accessed */
+#define LOAD_BADIMAGE -3 /* Image is corrupt */
+#define LOAD_BADFRAME -4 /* Requested frame not found */
/* 32767 is the maximum pixmap dimension and ensures that
* (w * h * sizeof(DATA32)) won't exceed ULONG_MAX */