spngsave: Don't shift indexed pixels (#3101)

This commit is contained in:
Sergey Alexandrovich 2022-10-19 22:34:43 +06:00 committed by GitHub
parent e6198361e5
commit 982a835eed
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -270,7 +270,7 @@ vips_foreign_save_spng_pack( VipsForeignSaveSpng *spng,
VipsPel *q, VipsPel *p, size_t n ) VipsPel *q, VipsPel *p, size_t n )
{ {
int pixel_mask = 8 / spng->bitdepth - 1; int pixel_mask = 8 / spng->bitdepth - 1;
int shift = 8 - spng->bitdepth; int shift = spng->palette ? 0 : 8 - spng->bitdepth;
VipsPel bits; VipsPel bits;
size_t x; size_t x;