Commit Graph

34 Commits

Author SHA1 Message Date
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
Lovell Fuller f844dbb623 Ensure magick buffer+file checks use consistent min length guard
Prevents a zero-length buffer from crashing GetImageMagick

It looks like the fix for magick7 in #1642 is also now required
for magick6 as the assertion appears to have been backported.
2020-08-17 12:29:19 +01:00
John Cupitt 9ef8b55218 better handling of short files in vips7 compat
the sniffer could read beyond the end of the file sometimes
2020-03-04 17:38:41 +00:00
John Cupitt bb75535151 much faster ismagick
We used to Ping files to see if IM would load them, but this can be
extremely slow for file formats like ARW.

Instead, use GetImageMagick() ... it just checks the magic number.
2019-06-08 16:47:40 +01:00
John Cupitt e106e1d100 add n/page params to webpload
and renumber all optional load args
2018-11-01 20:43:07 +00:00
John Cupitt 72f589764a remove the @format param to magickload 2018-07-24 17:03:38 +01:00
John Cupitt c410dc2db8 add format option to magickload
Some magick coders (eg. ICO) don't sniff the filetype from the data, so
when you try to load from a string, imagemagick is unable to pick the
right decode path.

Add a @format option so callers can hint the filetype.

see https://github.com/jcupitt/pyvips/issues/39
2018-04-24 15:06:52 +01:00
John Cupitt 8d08255ff7 rename HAVE_MAGICK as HAVE_MAGICK6
clearer meaning
2017-12-23 17:13:44 +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
Dirk Lemstra 90167902b9 Added define for loading with ImageMagick. 2017-12-22 01:59:56 +01:00
Alistair Thomas 0506c49444 Update GObject introspection annotations for libvips/foreign directory 2017-09-26 23:39:06 +01:00
John Cupitt 8970df2e1f try disabling operation cache for magickload
magickload can eat huge amounts of memory and disc, fon't keep it in the
operation cache

see https://github.com/jcupitt/libvips/issues/731
2017-09-08 04:55:55 +01:00
John Cupitt 6e26e317e0 update magick6 loader
now supports page/n/page-height
2016-11-25 14:46:46 +00:00
John Cupitt 8c84e6cc34 add page-height to pdfload 2016-11-23 22:11:26 +00:00
John Cupitt c90b8be0b8 add tiffsave_buffer
add tests

also some cleanups to foreign include files

see https://github.com/jcupitt/libvips/issues/417
2016-10-15 12:29:14 +01:00
John Cupitt 50468a07a2 clean up foreign
various cosmetic changes:

- pngsave_buffer now uses Write, not WriteBuf, same change for
  radsave_buffer

- move C wrappers out to class defs from foreign.c

- use g_free() not vips_free() for buffer free from low-level savers

- fix var names in some comments

- various style changes for radiance.c
2016-05-24 10:57:02 +01:00
John Cupitt 8e667fbb3e still not quite there
works, but is no faster, how odd

john@kiwi:~/pics$ time vips magickload nipguide.pdf[40] x.tif
real	0m0.244s
user	0m0.212s
sys	0m0.040s

$ time vips magickload nipguide.pdf x.tif --page 40
real	0m7.035s
user	0m6.900s
sys	0m0.152s

both give same result
2016-02-15 08:53:23 +00:00
John Cupitt 2b46b7e889 many more const decls
ruby gobject-introspection is quite fussy about needing a lot of const
declarations ... these changes help vips_image_matrix_from_array()
appear in Ruby
2015-10-23 11:45:11 +01:00
John Cupitt 99b4bcb838 small cleanups
split magicload up into a base class plus file and buffer subclasses

magickload_buffer should do all reading in header method
2015-02-16 10:45:56 +00:00
Maurus Cuelenaere dba1b1d81b Add ImageMagick buffer support
This commits adds buffer support for the ImageMagick backend, using the Blob
API.
2015-02-15 21:45:17 +01:00
Lovell Fuller 14c8aa33fc Expose 'density' attribute for magickload
Allows control of vector format resolution
2014-12-04 17:01:06 +00:00
John Cupitt c85dd26627 oops, better filename set on foreign load
we were setting the filename in the wrong place
2014-06-10 13:46:05 +01:00
John Cupitt 1ba188dc83 better file format sniffing
and vips_error_freeze/thaw() to stop errors from sniffing
being logged

plus better matrix sniffing
2013-07-04 09:43:57 +01:00
John Cupitt 87bdfd1cf5 oop turn off DEBUG 2013-06-11 14:54:01 +01:00
John Cupitt c77386f3cf vips_magickload() only reads 1st image in sequence
with an @all_frames option to get them all, thanks acrispino
2013-06-11 14:29:43 +01:00
Benjamin Gilbert 8cc76a6ba3 Update address for Free Software Foundation
Also update LGPLv2.1 license text from the copy currently on the GNU
website.
2013-03-07 00:40:19 -05:00
John Cupitt 19c0f928a7 never delay-load IM files
IM is too unreliable to be able to separate Ping and Read, always Read
2012-02-28 14:16:09 +00:00
John Cupitt e518427437 more magick tweaks 2012-01-18 17:39:01 +00:00
John Cupitt 2e4dedeebc gm tweaks 2012-01-18 14:57:22 +00:00
John Cupitt 4311fa71da fix the magick loader
see
http://www.imagemagick.org/discourse-server/viewtopic.php?f=1&t=20017
2012-01-17 15:29:39 +00:00
John Cupitt 0983b50905 Merge remote-tracking branch 'origin/gobject-introspection' into goi-merge
Conflicts:
	TODO
	libvips/arithmetic/im_recomb.c
	libvips/arithmetic/im_stats.c
	libvips/deprecated/im_measure.c
	libvips/include/vips/header.h
	libvips/include/vips/image.h
	libvips/include/vips/object.h
	libvips/iofuncs/header.c
	libvips/iofuncs/image.c
	libvips/iofuncs/object.c
2011-12-24 17:36:55 +00:00
John Cupitt 3e45e2cd6b move rad over to the new thing 2011-12-20 14:57:05 +00:00
John Cupitt 3015d7d7b8 move imagemagick load over to the new style 2011-12-19 08:58:04 +00:00