spngsave: fix 8bpp palette save with transparency (#2808)
This commit is contained in:
parent
7121f952d5
commit
550781cd18
@ -395,8 +395,6 @@ vips_foreign_save_spng_write( VipsForeignSaveSpng *spng, VipsImage *in )
|
|||||||
for( i = 0; i < palette_count; i++ ) {
|
for( i = 0; i < palette_count; i++ ) {
|
||||||
VipsPel *p = (VipsPel *)
|
VipsPel *p = (VipsPel *)
|
||||||
VIPS_IMAGE_ADDR( im_palette, i, 0 );
|
VIPS_IMAGE_ADDR( im_palette, i, 0 );
|
||||||
|
|
||||||
if( p[3] == 255 ) {
|
|
||||||
struct spng_plte_entry *entry =
|
struct spng_plte_entry *entry =
|
||||||
&plte.entries[plte.n_entries];
|
&plte.entries[plte.n_entries];
|
||||||
|
|
||||||
@ -404,8 +402,8 @@ vips_foreign_save_spng_write( VipsForeignSaveSpng *spng, VipsImage *in )
|
|||||||
entry->green = p[1];
|
entry->green = p[1];
|
||||||
entry->blue = p[2];
|
entry->blue = p[2];
|
||||||
plte.n_entries += 1;
|
plte.n_entries += 1;
|
||||||
}
|
|
||||||
else {
|
if( p[3] != 255 ) {
|
||||||
trns.type3_alpha[trns.n_type3_entries] = p[3];
|
trns.type3_alpha[trns.n_type3_entries] = p[3];
|
||||||
trns.n_type3_entries += 1;
|
trns.n_type3_entries += 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user