From 90dff85e40c7e18d1acae81a5e41cbef7bd9cedc Mon Sep 17 00:00:00 2001 From: Isaac Connor Date: Mon, 3 May 2021 13:17:58 -0400 Subject: [PATCH] Only default to BGRA when colours are > 1. --- src/zm_image.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/zm_image.cpp b/src/zm_image.cpp index ca987c5e0..f39afcae6 100644 --- a/src/zm_image.cpp +++ b/src/zm_image.cpp @@ -174,7 +174,7 @@ Image::Image(int p_width, int p_height, int p_colours, int p_subpixelorder, uint } else { AllocImgBuffer(size); } - if (!subpixelorder) { + if (!subpixelorder and colours>1) { // Default to RGBA when no subpixelorder is specified. subpixelorder = ZM_SUBPIX_ORDER_RGBA; } @@ -205,7 +205,7 @@ Image::Image(int p_width, int p_linesize, int p_height, int p_colours, int p_sub } else { AllocImgBuffer(size); } - if (!subpixelorder) { + if (!subpixelorder and colours>1) { // Default to RGBA when no subpixelorder is specified. subpixelorder = ZM_SUBPIX_ORDER_RGBA; }