Skip to content

Commit

Permalink
pngsave: ensure 8-bit palette images can be created (#3031)
Browse files Browse the repository at this point in the history
  • Loading branch information
lovell committed Sep 8, 2022
1 parent fc01771 commit b58b7bd
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions libvips/foreign/pngsave.c
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ vips_foreign_save_png_build( VipsObject *object )
png->bitdepth < 8 )
png->palette = TRUE;

/* Disable palettization for >8 bit save.
*/
if( png->bitdepth >= 8 )
/* Disable palettization for >8 bit save.
*/
if( png->bitdepth > 8 )
png->palette = FALSE;

if( vips__png_write_target( in, png->target,
Expand Down
6 changes: 3 additions & 3 deletions libvips/foreign/spngsave.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,9 +613,9 @@ vips_foreign_save_spng_build( VipsObject *object )
spng->bitdepth < 8 )
spng->palette = TRUE;

/* Disable palettization for >8 bit save.
*/
if( spng->bitdepth >= 8 )
/* Disable palettization for >8 bit save.
*/
if( spng->bitdepth > 8 )
spng->palette = FALSE;

if( vips_foreign_save_spng_write( spng, in ) ) {
Expand Down

0 comments on commit b58b7bd

Please sign in to comment.