1
0
mirror of https://github.com/imgproxy/imgproxy.git synced 2025-11-29 23:07:40 +02:00

Fallback to no profile while saving PNG if profile is invalid

This commit is contained in:
DarthSim
2018-11-29 16:30:59 +06:00
parent 5ac6ce5ce9
commit bb4f4602c3
2 changed files with 10 additions and 3 deletions

8
vips.h
View File

@@ -264,8 +264,12 @@ vips_jpegsave_go(VipsImage *in, void **buf, size_t *len, int strip, int quality,
}
int
vips_pngsave_go(VipsImage *in, void **buf, size_t *len, int interlace) {
return vips_pngsave_buffer(in, buf, len, "filter", VIPS_FOREIGN_PNG_FILTER_NONE, "interlace", interlace, NULL);
vips_pngsave_go(VipsImage *in, void **buf, size_t *len, int interlace, int embed_profile) {
if (embed_profile) {
return vips_pngsave_buffer(in, buf, len, "filter", VIPS_FOREIGN_PNG_FILTER_NONE, "interlace", interlace, NULL);
}
return vips_pngsave_buffer(in, buf, len, "profile", "none", "filter", VIPS_FOREIGN_PNG_FILTER_NONE, "interlace", interlace, NULL);
}
int