Commit Graph

43 Commits

Author SHA1 Message Date
Daniel Löbl ed79cfba7e
magicksave: Add bitdepth option (#2819)
* flag to save bmp with bitdepth 1

* magicksave: add bitdepth option

* update comments

* update documentation

* revised based on review comments

Co-authored-by: Thomas Barton <thomasryanbarton@gmail.com>
2022-05-27 11:41:01 +01:00
Kleis Auke Wolthuizen 0337c09700
Cleanup gettext handling (#2695)
Use GLib's i18n support instead of copying and pasting that
logic into its own header. This deprecates the vips/intl.h
header in favour of glib/gi18n.h.
2022-02-27 15:27:28 +00:00
Kleis Auke Wolthuizen 34c0f31643 Build a dynamically loadable module for *magick
By default, a dynamically loadable module is built for *magick (i.e.
`--with-magick=module`) when:
* ImageMagick or GraphicsMagick is found;
* GModule is supported (`gmodule_supported` pkg-config variable).

This can be overridden on the command line with:
* `--without-magick` - to disable *magick usage;
* `--with-magick[=yes]` - to restore the previous behavior;
* `--disable-modules` - to disable the build of dynamic modules.
2021-04-22 12:28:37 +02:00
Kleis Auke Wolthuizen 9246094033 Fix function pointer cast issues
It is undefined behavior in C and C++ to cast a function pointer
to another type and call it that way. This does work in most native
platforms, however, despite it being UB, but in WASM it can fail.

See:
https://emscripten.org/docs/porting/guidelines/function_pointer_issues.html
2020-06-30 13:35:41 +02:00
John Cupitt 2ad29ed09e better error msg in magicksave 2020-04-27 17:03:18 +01:00
John Cupitt 8c1c8b6c9f fix a warning from magicksave on some platforms
we were leaving delay_gvalue as {0} then unsetting it, which will
produce a warning with some versions of glib.

Thanks chregu.

See https://github.com/libvips/libvips/issues/1524
2020-01-13 16:23:58 +00:00
John Cupitt 4616cf1f5c small changes to the gif-loop fix
see https://github.com/libvips/libvips/pull/1362
2019-12-18 18:09:30 +00:00
Tomáš Szabo 1fde574a86
Merge branch 'master' of https://github.com/libvips/libvips 2019-12-17 07:39:14 +01:00
Tomáš Szabo d14e0d5c97
feat: add normalized `loop` field 2019-12-17 07:28:28 +01:00
DarthSim c7e0c073ca Add `optimize_gif_frames` and `optimize_gif_transparency` options to `vips_magicksave` 2019-08-08 02:52:54 +06:00
Tomáš Szabo ab7ef2c2bc
fix: make gif-loop consistent between GIF and WEBP 2019-07-08 14:28:48 +02:00
John Cupitt c8ca8f02ba keep magicksave delay array alive for longer
fixes a segv in magicksave_buffer ... we could try to use delay after im
had been unreffed in some circumstances
2019-07-06 17:45:41 +01:00
John Cupitt 515bf68f46 reformatting for vips2webp
- move a couple of small functions inline for simplicity
- mark "gif-delay" as deprecated
- minor reformatting
2019-07-06 13:37:33 +01:00
Tomáš Szabo bd9c97feed
Changes based on review 2019-07-05 17:23:29 +02:00
Tomáš Szabo 166aae1440
sync fork 2019-06-30 17:10:56 +02:00
John Cupitt aac01126af magicksave supports strip option 2019-06-29 20:23:46 +01:00
Tomáš Szabo 42218cd613
formatting: use tabs instead of spaces 2019-06-21 15:59:32 +02:00
Tomáš Szabo ae50136845
feat: support frame delays 2019-06-21 15:06:22 +02:00
John Cupitt ea9e477ad3 better gif-loop handling (again)
setting loops to 0 was broken
2019-04-29 17:12:20 +01:00
John Cupitt 53b43e0497 fix setting of iterations in magicksave
ImageMagick uses 0 to mean unset, so we must always add 1. See
coders/gif.c.

See https://github.com/libvips/libvips/issues/1302
2019-04-29 08:43:39 +01:00
John Cupitt cf860b27fa start working over thumbnail to support anim 2019-02-19 17:27:23 +00:00
John Cupitt d4ddfa5eb4 note recent magick changes in headers 2019-02-17 12:41:59 +00:00
John Cupitt f41c1439c9 just one sink_disc() for magicksave
we used to cut the input image into tiles, then sink_disc() for each one
... instead, make a single sink_disc() and chop in _generate

simpler and faster
2019-02-17 12:28:13 +00:00
John Cupitt 30b5c49d0b set dispose in magicksave
since we always give complete new frames

revise gifload slightly too
2019-02-16 17:37:23 +00:00
John Cupitt 931b661d2b fix up and test with im6/im7/gm
seems to work! phew
2019-02-07 18:35:51 +00:00
John Cupitt 90fef08ee0 start adding xmp/icc/exif/etc. for IM
needs to work for im6, im7 and gm, and it's not quite there yet :(
2019-02-06 16:39:14 +00:00
John Cupitt 10b3000581 reorganise magicksave a little 2019-02-06 10:24:11 +00:00
DarthSim cd1560c1cb vips_magicksave for GraphicsMagick 2019-02-06 00:07:30 +06:00
John Cupitt 1619c8b1a1 fix memleak in magick6load
IM ExceptionInfo were not being freed correctly. This patch
adds a small wrapper function and uses it to allocate and free all IM
exception objects.

Tested with im 6.9 and gm 1.3.

See:

https://github.com/libvips/lua-vips/issues/24

https://github.com/libvips/libvips/issues/1203
2019-01-04 08:38:58 +00:00
John Cupitt 25ff103408 fix build without magicksave
an ifdef was in the wrong place
2018-01-12 11:28:34 +00:00
John Cupitt f27b5a81f7 register magicksave for gif and bmp 2018-01-10 08:30:52 +00:00
John Cupitt 1b3329acc4 add C API wrappers for magicksave 2017-12-23 17:27:26 +00:00
John Cupitt 585469b192 add configure flags for magick load and save
so you can turn load and save on and off independently
2017-12-23 16:57:36 +00:00
John Cupitt 140a3b3ed0 try to improve error handling in magicksave 2017-12-23 14:53:15 +00:00
John Cupitt e830ca7776 fix greyscale magicksave write
credit kleisauke
2017-12-23 14:16:29 +00:00
John Cupitt e12df167e6 Merge branch 'magicksave' of https://github.com/dlemstra/libvips into dlemstra-magicksave 2017-12-23 12:39:50 +00:00
John Cupitt 7ab77d66c3 move magicksave write struct into class
magicksave used to have its own Write struct to track write state.
Instead, keep the write state in the save class.

break the magick6/magick7 compat wrappers out into a separete file so they
can be shared with the loaders.

small style changes.
2017-12-23 12:12:11 +00:00
Dirk Lemstra 6b0f676a5e Fixed issue with grayscale images. 2017-12-22 22:06:11 +01:00
Dirk Lemstra e8df2aa190 Added extra check to fix issue with zero height. 2017-12-22 02:09:45 +01:00
Dirk Lemstra 383125a031 Moved code to magicksave.c and added extra define to enable only saving with ImageMagick. 2017-12-22 01:52:17 +01:00
Dirk Lemstra ccf894c738 Added quality option. 2017-12-17 11:59:57 +01:00
Dirk Lemstra 8f4179f496 Added support for writing buffers with magicksave.
Added --format for the filename.
2017-12-16 23:10:23 +01:00
Dirk Lemstra e22282a844 Start of support for writing files with ImageMagick. 2017-12-16 21:37:17 +01:00