浏览代码

Fixes condition bpp

Viktor Sokolov 3 月之前
父节点
当前提交
74f4081a73
共有 1 个文件被更改,包括 4 次插入6 次删除
  1. 4 6
      vips/bmpload.c

+ 4 - 6
vips/bmpload.c

@@ -393,12 +393,10 @@ vips_foreign_load_bmp_24_32_generate_strip(VipsRect *r, VipsRegion *out_region,
 
 
       // if the image has alpha channel, copy it too
       // if the image has alpha channel, copy it too
       if (bmp->bands == 4) {
       if (bmp->bands == 4) {
-        if (bmp->bytes_per_pixel == 4) {
-          dest[3] = src[3]; // A
-        }
-        else {
-          dest[3] = 0xFF;
-        }
+        dest[3] = src[3]; // A
+      }
+      else {
+        dest[3] = 0xFF;
       }
       }
 
 
       dest += bmp->bands;
       dest += bmp->bands;