Skip to content

Commit b58b7bd

Browse files
authored
pngsave: ensure 8-bit palette images can be created (#3031)
1 parent fc01771 commit b58b7bd

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

libvips/foreign/pngsave.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -145,9 +145,9 @@ vips_foreign_save_png_build( VipsObject *object )
145145
png->bitdepth < 8 )
146146
png->palette = TRUE;
147147

148-
/* Disable palettization for >8 bit save.
149-
*/
150-
if( png->bitdepth >= 8 )
148+
/* Disable palettization for >8 bit save.
149+
*/
150+
if( png->bitdepth > 8 )
151151
png->palette = FALSE;
152152

153153
if( vips__png_write_target( in, png->target,

libvips/foreign/spngsave.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -613,9 +613,9 @@ vips_foreign_save_spng_build( VipsObject *object )
613613
spng->bitdepth < 8 )
614614
spng->palette = TRUE;
615615

616-
/* Disable palettization for >8 bit save.
617-
*/
618-
if( spng->bitdepth >= 8 )
616+
/* Disable palettization for >8 bit save.
617+
*/
618+
if( spng->bitdepth > 8 )
619619
spng->palette = FALSE;
620620

621621
if( vips_foreign_save_spng_write( spng, in ) ) {

0 commit comments

Comments
 (0)