don't save RGBA as JPG CMYK
This commit is contained in:
parent
df572e092b
commit
2b432723f4
6
TODO
6
TODO
@ -1,3 +1,9 @@
|
|||||||
|
- on RGBA -> RGB conversion in foreign.c, need to use A channel to mask off
|
||||||
|
RGB ... Opera.png looks bad without it
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
blocking bugs
|
blocking bugs
|
||||||
=============
|
=============
|
||||||
|
|
||||||
|
@ -1160,9 +1160,18 @@ vips_foreign_convert_saveable( VipsForeignSave *save )
|
|||||||
in = out;
|
in = out;
|
||||||
}
|
}
|
||||||
else if( in->Bands > 3 &&
|
else if( in->Bands > 3 &&
|
||||||
class->saveable == VIPS_SAVEABLE_RGB ) {
|
(class->saveable == VIPS_SAVEABLE_RGB ||
|
||||||
|
(class->saveable == VIPS_SAVEABLE_RGB_CMYK &&
|
||||||
|
in->Type != VIPS_INTERPRETATION_CMYK)) ) {
|
||||||
VipsImage *out;
|
VipsImage *out;
|
||||||
|
|
||||||
|
/* Don't let 4 bands though unless the image really is
|
||||||
|
* a CMYK.
|
||||||
|
*
|
||||||
|
* Consider a RGBA png being saved as JPG. We can
|
||||||
|
* write CMYK jpg, but we mustn't do that for RGBA
|
||||||
|
* images.
|
||||||
|
*/
|
||||||
if( vips_extract_band( in, &out, 0,
|
if( vips_extract_band( in, &out, 0,
|
||||||
"n", 3,
|
"n", 3,
|
||||||
NULL ) ) {
|
NULL ) ) {
|
||||||
@ -1174,7 +1183,8 @@ vips_foreign_convert_saveable( VipsForeignSave *save )
|
|||||||
in = out;
|
in = out;
|
||||||
}
|
}
|
||||||
else if( in->Bands > 4 &&
|
else if( in->Bands > 4 &&
|
||||||
(class->saveable == VIPS_SAVEABLE_RGB_CMYK ||
|
((class->saveable == VIPS_SAVEABLE_RGB_CMYK &&
|
||||||
|
in->Type == VIPS_INTERPRETATION_CMYK) ||
|
||||||
class->saveable == VIPS_SAVEABLE_RGBA) ) {
|
class->saveable == VIPS_SAVEABLE_RGBA) ) {
|
||||||
VipsImage *out;
|
VipsImage *out;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user