From 53f53874a6426b812d1942ecc326db1ddf72039d Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 5 May 2024 22:51:17 +0100 Subject: [PATCH] Update 8-bit assertion --- src/tiff/tiffread.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/tiff/tiffread.c b/src/tiff/tiffread.c index c976c2b..9a371e8 100644 --- a/src/tiff/tiffread.c +++ b/src/tiff/tiffread.c @@ -131,11 +131,13 @@ Image *read_baseline_tiff(const char *file, Arena *arena) { assert((reader.img.type == TIFF_IMAGE_TYPE_RGB) && "Currently, only RGB images are supported"); - assert((reader.img.rgba_bits_per_sample.r == MIN_BITS_PER_SAMPLE && - reader.img.rgba_bits_per_sample.g == MIN_BITS_PER_SAMPLE && - reader.img.rgba_bits_per_sample.b == MIN_BITS_PER_SAMPLE && - reader.img.rgba_bits_per_sample.a == MIN_BITS_PER_SAMPLE) && - "Currently, only 8-bit images are supported"); + + bool image_is_8_bit = + (reader.img.rgba_bits_per_sample.r == MIN_BITS_PER_SAMPLE && + reader.img.rgba_bits_per_sample.g == MIN_BITS_PER_SAMPLE && + reader.img.rgba_bits_per_sample.b == MIN_BITS_PER_SAMPLE && + reader.img.rgba_bits_per_sample.a == MIN_BITS_PER_SAMPLE); + assert(image_is_8_bit && "Currently, only 8-bit images are supported"); load_image_pixels(&reader, temp_arena); if (!reader.pixels) {