Preserve GIF bit-per-sample

This commit is contained in:
DarthSim
2023-05-23 19:09:30 +03:00
parent 157843ccb3
commit 39c436e527
2 changed files with 6 additions and 1 deletions

View File

@@ -4,6 +4,9 @@
### Add
- Add `IMGPROXY_URL_REPLACEMENTS` config.
### Change
- Preserve GIF's bit-per-sample.
## [3.17.0] - 2023-05-10
### Add
- Add `process_resident_memory_bytes`, `process_virtual_memory_bytes`, `go_memstats_sys_bytes`, `go_memstats_heap_idle_bytes`, `go_memstats_heap_inuse_bytes`, `go_goroutines`, `go_threads`, `buffer_default_size_bytes`, `buffer_max_size_bytes`, and `buffer_size_bytes` metrics to OpenTelemetry.

View File

@@ -712,7 +712,9 @@ vips_webpsave_go(VipsImage *in, void **buf, size_t *len, int quality) {
int
vips_gifsave_go(VipsImage *in, void **buf, size_t *len) {
#if VIPS_SUPPORT_GIFSAVE
return vips_gifsave_buffer(in, buf, len, NULL);
int bitdepth = vips_get_bits_per_sample(in);
if (bitdepth <= 0 || bitdepth > 8 ) bitdepth = 8;
return vips_gifsave_buffer(in, buf, len, "bitdepth", bitdepth, NULL);
#else
vips_error("vips_gifsave_go", "Saving GIF is not supported (libvips 8.12+ reuired)");
return 1;