aboutsummaryrefslogtreecommitdiffstats
path: root/readers.c
diff options
context:
space:
mode:
Diffstat (limited to 'readers.c')
-rw-r--r--readers.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/readers.c b/readers.c
index 24cb818..b7e8899 100644
--- a/readers.c
+++ b/readers.c
@@ -3,6 +3,7 @@
#include <stddef.h>
#include <string.h>
#include <assert.h>
+#include <endian.h>
#include "readers.h"
@@ -130,8 +131,13 @@ int load_free_extras(struct ida_image_info *info)
void ida_image_alloc(struct ida_image *img)
{
assert(img->p == NULL);
- img->p = pixman_image_create_bits(/* PIXMAN_r8g8b8 */ PIXMAN_b8g8r8,
- img->i.width, img->i.height, NULL, 0);
+ img->p = pixman_image_create_bits(
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+ PIXMAN_b8g8r8,
+#else
+ PIXMAN_r8g8b8,
+#endif
+ img->i.width, img->i.height, NULL, 0);
}
uint8_t *ida_image_scanline(struct ida_image *img, int y)