mirror of
https://github.com/talgo-cloud/bimg.git
synced 2026-03-08 23:18:19 -07:00
Adding support for TIFF save.
Signed-off-by: Yoan Blanc <yoan@dosimple.ch>
This commit is contained in:
parent
190fe92e28
commit
dcd91c85e0
3 changed files with 62 additions and 18 deletions
28
vips.h
28
vips.h
|
|
@ -144,6 +144,23 @@ vips_type_find_bridge(int t) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
vips_type_find_save_bridge(int t) {
|
||||
if (t == TIFF) {
|
||||
return vips_type_find("VipsOperation", "tiffsave_buffer");
|
||||
}
|
||||
if (t == WEBP) {
|
||||
return vips_type_find("VipsOperation", "webpsave_buffer");
|
||||
}
|
||||
if (t == PNG) {
|
||||
return vips_type_find("VipsOperation", "pngsave_buffer");
|
||||
}
|
||||
if (t == JPEG) {
|
||||
return vips_type_find("VipsOperation", "jpegsave_buffer");
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
vips_rotate(VipsImage *in, VipsImage **out, int angle) {
|
||||
int rotate = VIPS_ANGLE_D0;
|
||||
|
|
@ -276,6 +293,17 @@ vips_webpsave_bridge(VipsImage *in, void **buf, size_t *len, int strip, int qual
|
|||
);
|
||||
}
|
||||
|
||||
int
|
||||
vips_tiffsave_bridge(VipsImage *in, void **buf, size_t *len) {
|
||||
#if (VIPS_MAJOR_VERSION >= 8 && VIPS_MINOR_VERSION >= 5)
|
||||
return vips_tiffsave_buffer(in, buf, len,
|
||||
NULL
|
||||
);
|
||||
#else
|
||||
return 0;
|
||||
#endif
|
||||
}
|
||||
|
||||
int
|
||||
vips_is_16bit (VipsInterpretation interpretation) {
|
||||
return interpretation == VIPS_INTERPRETATION_RGB16 || interpretation == VIPS_INTERPRETATION_GREY16;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue