Commit Graph

2158 Commits

Author SHA1 Message Date
John Cupitt
acabd2dc08 add gifload_source 2020-01-30 22:15:48 +00:00
John Cupitt
81fa983121 oop, dropped an "else" 2020-01-29 18:12:37 +00:00
John Cupitt
165a3a3855 Merge branch '8.9' 2020-01-28 13:36:46 +00:00
John Cupitt
42930e8d87 add "depth" param to tiffsave
Add a "depth" param to tiffsave to set pyramid depth, just like the
"depth" param on dzsave.

See https://github.com/libvips/libvips/issues/1485
2020-01-26 18:39:47 +00:00
John Cupitt
f8c7f9dac9 interpret \ as an escape char in break_token
So:

	vips_break_token( "hello\ world", " " )

Sees a single token, `"hello world"`.

This means you can now do things like:

	$ vips arrayjoin "k\ 2.jpg" x.png

Where "k 2.jpg" is a filename containing a space.

See https://github.com/libvips/libvips/issues/1493
2020-01-26 13:59:04 +00:00
John Cupitt
c14d7c254b add max and min to region_shrink
Add max and min to region_shrink. Useful with tiffsave and dzsave when
the image is (for example) line art. Thanks rgluskin.

See: https://github.com/libvips/libvips/issues/1490
2020-01-24 17:55:11 +00:00
John Cupitt
df6ff62cde add @id arg to dzsave
So you can now set the base of the id property in info.json in IIIF
output. Thanks regisrob.

See https://github.com/libvips/libvips/issues/1531
2020-01-24 17:12:46 +00:00
John Cupitt
767c87d6e6 better iiif json
Change "scalefactor" to "scaleFactor", thanks regisrob.

See https://github.com/libvips/libvips/issues/1530
2020-01-24 16:28:52 +00:00
John Cupitt
53407206cf start 8.10 cycle 2020-01-24 16:26:28 +00:00
John Cupitt
fda5e5c402 lock for metadata changes
Another attempt at fixing crashes on metadata chenage in highly threaded
applications.

Global lock around set, remove and copy metadata. This is crude, but
simple, the performance impact should be small, and ought to resolve the
problem.

We'll do something better for the next version.

see https://github.com/lovell/sharp/issues/1986
2020-01-21 08:29:59 +00:00
John Cupitt
fc9edfe593 improve imagemagick init
graphicsmagick, in some configurations, needs to be told to init the
various loaders.

Thanks @LebronCurry

See https://github.com/libvips/libvips/issues/1528
2020-01-15 14:42:58 +00:00
John Cupitt
8752a76e66 fix a race in tiled tiffload and pdfload
We weer minimising sources in the ::minimise handler, but this is called
outside the lock that protects _generate. This patch removes minimise in
this case.

See https://github.com/kleisauke/net-vips/issues/53
2020-01-14 18:06:12 +00: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
34fcd1fe69 fix autorot in thumbnail
`vips_thumbnail()` was not taking a private copy of the image before
modifying metadata during auto-rotate.

Thanks janko.

See https://github.com/libvips/libvips/issues/1523
2020-01-12 14:24:23 +00:00
John Cupitt
51fc2ff64e don't use new source API for new_from_file etc.
We were attempting to load images in new_from_file using the new source
API first, then only falling back to the file loaders if that failed.

However, this meant that we did not respect the priority ordering on
loaders, so openslide iamges (for example) were being loaded by the tiff
loader.
2020-01-09 14:47:14 +00:00
John Cupitt
06b52da52a update ChangeLog for stream rename 2019-12-29 21:48:14 +00:00
John Cupitt
e48f45187b make RGB and sRGB synonmous
We had a half-baked idea that RGB could mean generic RGB space and sRGB
would mean strict sRGB interpretation.

Unfortunately, this did not work well in practice. For example,
`icc_transform("srgb")` would tag the result as RGB rather than sRGB
(the converter didn't know it was writing sRGB pixels, it just saw
conversion to RGB with an ICC profile), and then later stages would do
unnecessary icc_imports, or worse, fail.

This patch makes RGB and sRGB strict synonyms. If you want to treat an
RGB image as something other than sRGB, you'll need to do it by hand
with the icc_ functions.

See

https://github.com/libvips/pyvips/issues/144

46212e92b1 (r34904985)

https://github.com/libvips/libvips/issues/1494
2019-12-22 11:40:09 +00:00
John Cupitt
acd9101037 always copy before exif_update
During write, we often call vips__exif_update(). This updates the exif
block from the other image metadata prior to save.

Always copy the image before calling this.

See https://github.com/lovell/sharp/issues/1986
2019-11-28 14:45:02 +00:00
John Cupitt
b003b36d7a Merge branch '8.8' 2019-11-27 15:30:33 +00:00
John Cupitt
0bc49a485e remove use of realpath
It won't work on linux systems with grsec.
2019-11-27 15:14:42 +00:00
John Cupitt
49a8f0779d Merge branch '8.8' 2019-11-26 09:15:39 +00:00
John Cupitt
298002c530 fix build with imagemagick 6.7.8.9
Ships with centos7, so an important version to support.

See https://github.com/libvips/libvips/issues/1479
2019-11-25 15:44:28 +00:00
John Cupitt
486b95eb7b
Merge branch 'master' into add-stream-object 2019-11-19 17:08:03 +00:00
John Cupitt
712157cd16 better support for TIFFs with many alphas
The premultiplied alpha can be in any position, and it checks if there
is more than one ASSOCALPHA.

See https://github.com/libvips/libvips/issues/1471
2019-11-18 16:48:34 +00:00
John Cupitt
6b5035c160 update changelog 2019-11-15 17:30:31 +00:00
John Cupitt
c1a027c8d7 ppm load uses streams 2019-11-14 12:57:39 +00:00
John Cupitt
cb7bc24b2a note in changelog 2019-11-12 18:05:17 +00:00
John Cupitt
55024c71ce
Merge branch 'master' into add-stream-object 2019-11-12 14:08:02 +00:00
John Cupitt
ceb2db513d Merge branch '8.8' 2019-11-11 18:05:57 +00:00
John Cupitt
b8ea3f8442 update cpp interface for stream variable rename 2019-11-11 09:24:45 +00:00
John Cupitt
b65a9d7328 oop, missing ! on tiff save
resolution-unit metadata was not being checked correctly on tiff save,
thanks @kayarre

see https://github.com/libvips/pyvips/issues/133
2019-11-10 10:26:13 +00:00
John Cupitt
f499cefb0e add iiif layout to dzsave 2019-11-09 20:40:39 +00:00
John Cupitt
edca486f19 revise buffered input
rad load works now
2019-11-06 16:35:19 +00:00
John Cupitt
8eeb415b09 Merge branch 'master' into add-stream-object 2019-10-28 05:10:11 +00:00
John Cupitt
8337e17428 add no_strip option to dzsave
it's sometimes useful to have pyramid tiles with ICC profiles

see https://github.com/libvips/libvips/issues/1451
2019-10-21 16:46:20 +01:00
John Cupitt
20cb0da247 test suite passes
with all jpegload coming via VipsStreamInput
2019-10-11 14:03:10 +01:00
John Cupitt
c9a7b92eeb version bump 2019-09-17 17:16:26 +01:00
John Cupitt
efdf33f3de add vips_error_buffer_copy()
Add vips_error_buffer_copy() to fix a race in error buffer fetch.

See https://github.com/libvips/libvips/issues/1423

Thanks @dineshkannaa
2019-09-12 09:49:49 +01:00
John Cupitt
7b2729adfa fix up nifti load/save
- use double for all floating point scalar metadata, like other loaders
- remove use of stray "n" property
2019-09-09 16:06:22 +01:00
John Cupitt
dd9eba9e26 add @format and @interpretation to rawload 2019-09-05 16:25:55 +01:00
John Cupitt
1ee54bfa80 Merge branch '8.8' 2019-09-05 12:45:08 +01:00
John Cupitt
06fdc95038 xres/yres params in tiffsave were in cm
and should have been in pixels/mm

thanks f--f

see https://github.com/libvips/libvips/issues/1421
2019-09-04 17:02:24 +01:00
John Cupitt
da8cee048f enable alpha in heifsave
Check for image alpha and enable it. There seem to be some
non-transparent tiles, curiously.

See https://github.com/libvips/libvips/issues/1411
2019-09-01 16:58:50 +01:00
John Cupitt
75b45cc2ef enable alpha handling in heic load
use RGBA decoding, when appropriate

see https://github.com/libvips/libvips/issues/1411
2019-09-01 16:37:43 +01:00
John Cupitt
4b5b982711 merge 8.8 2019-08-31 12:29:50 +01:00
John Cupitt
574be4380e revert sharpen restoring the input colourspace
icc_export can make _RGB images, so the input can be outside the set of
supported colourspace transforms.

See 46212e92b1 (r34904985)

bump version too.
2019-08-31 11:29:36 +01:00
John Cupitt
5d19bcf955 Merge branch '8.8' 2019-08-30 11:03:24 +01:00
John Cupitt
6ea76f9632 improve data_length handling in jpg load
libjpeg uses unsigned ints for data length, so we must use size_t
everywhere.
2019-08-30 11:00:25 +01:00
John Cupitt
349e76bb85 Merge branch '8.8' 2019-08-29 15:30:20 +01:00
John Cupitt
3161de3b52 verify bands/format for coded vips images
WHen loading a vips image with Coding set, make sure that Bands and
BandFmt are correct.
2019-08-29 15:28:55 +01:00
John Cupitt
9a5dca1ef8 Merge branch '8.8' 2019-08-28 10:05:12 +01:00
John Cupitt
46212e92b1 fix default sharpen
sharpen with sigma 0.5 was doing nothing, since the new int precision
rules meant that we generated a point-point convolution.

This patch increases the int precision for sharpen, so we now work with
sigma down to 0.5.

Also: restore input colourspace. Previously, the output image was always
LabS (the computation space for sharpen). Now, it transforms back to the
input space. This is more in line with how other operators work.

Thanks 2h4dl for pointing this out.

See https://github.com/libvips/pyvips/issues/123
2019-08-28 09:16:40 +01:00
John Cupitt
2f6cc1fad9 Merge branch '8.8' 2019-08-27 14:49:42 +01:00
John Cupitt
d61a85f6c9 prevent over-pre-shrink in thumbnail
We could pre-shrink so much that an axis went to 0.

See https://github.com/lovell/sharp/issues/1782#issuecomment-525249430
2019-08-27 14:47:36 +01:00
John Cupitt
d2ab993931 Merge branch '8.8' 2019-08-27 13:06:27 +01:00
John Cupitt
5cce83a294 check image bounds for GIF load
It seems giflib does no checking of image dimensions at all, not even
height == 0.
2019-08-27 13:04:28 +01:00
John Cupitt
23d0d5603d Merge branch '8.8' 2019-08-24 17:15:45 +01:00
John Cupitt
4691260540 better feof() handling in gif load
Relaxing the read error rules made looping possible .. make sure we
always stop explicitly on eof.
2019-08-24 17:14:10 +01:00
John Cupitt
77de39320a Merge branch '8.8' 2019-08-24 11:21:48 +01:00
John Cupitt
038409093f clip coding and interpretation on image read
They could be out of bounds enums. This used not to matter, but we use
them more now, so out of bounds values can cause coredumps.
2019-08-24 11:20:45 +01:00
John Cupitt
1b57c6d066 Merge branch '8.8' 2019-08-23 15:43:12 +01:00
John Cupitt
4b677fb16a make GIF parse less strict
Some GIFs don't follow the standard very closely. Let them through.

See https://github.com/libvips/libvips/issues/1404
2019-08-23 15:40:48 +01:00
John Cupitt
19a80e4efb Merge branch '8.8' 2019-08-21 17:37:16 +01:00
John Cupitt
b5e8e99746 fix a read-one-byte-beyond issue in jpeg load
libvips could harmlessly read beyond the end of a string with a crafted jpg
file
2019-08-21 17:17:54 +01:00
John Cupitt
ed2054dbbc revise arithmetic with const
there's a problem with out of bounds values, for example:

	vips relational_const k2.jpg x.v equal 1000

actually finds pixels == 255, since 1000 is saturated converted to 255
before the test starts.

This patch reworks arithmetic against const values to fix this.
2019-08-21 10:35:48 +01:00
John Cupitt
2d0c21279a add tests 2019-08-19 16:27:44 +01:00
John Cupitt
d80ce4bf15 fix a problem with shrinkv tail processing
Tail processing in shrinkv had an implicit assumption of round-down, but of
course we round to nearest. Thanks angelmixu.

see https://github.com/libvips/libvips/issues/1396
2019-08-13 11:21:01 +01:00
John Cupitt
cdee0feb93 Merge branch '8.8' 2019-08-09 10:12:55 +01:00
John Cupitt
aafc2c7948 add changelog note for profiles.c fix 2019-08-09 10:11:45 +01:00
John Cupitt
988f9594f4 Merge branch '8.8' 2019-08-08 16:11:02 +01:00
John Cupitt
ff58c67e33 add locks for pdfium load
We used to lock within documents, ie. we did not allow two threads to
work on the same file.

However pdfium is not threadsafe in any way, and this is not supported,
see:

	https://groups.google.com/forum/#!msg/pdfium/kyIdh_J4csg/K1LvfPiHDwAJ

This patch adds locks around pdfium calls.

see:

	https://github.com/libvips/libvips/issues/1380
	https://github.com/libvips/libvips/issues/1275
2019-08-08 15:54:16 +01:00
John Cupitt
7250b169d4 Merge branch '8.8' 2019-08-07 16:19:23 +01:00
John Cupitt
f36927e78d fix build against graphicsmagick
- add tests for more features missing in GM
- simplify the IM/GM configure tests
- revise the test suite to pass with GM and IM
2019-08-07 16:17:27 +01:00
John Cupitt
f0d1a5d82b note PNG comment fix 2019-08-02 10:11:16 +01:00
John Cupitt
332e97272a Merge branch '8.8' 2019-07-29 10:07:29 +01:00
John Cupitt
5e77ab948b fix loop with malformed ppm
skip_line in ppm parse was not testing for EOF, so it could get stuck
with malformed files

thanks Kyle-Kyle

see https://github.com/libvips/libvips/issues/1377
2019-07-29 10:05:55 +01:00
John Cupitt
6a75776272 Merge branch 'loader-minimise-experiment' 2019-07-28 17:23:01 +01:00
John Cupitt
0e5447e537 final cleanup 2019-07-28 17:15:54 +01:00
John Cupitt
264f41df1c Merge branch '8.8' 2019-07-24 16:07:39 +01:00
John Cupitt
3510e7abcf fetch HEIC metadata from the main image
since thumbs don't have it, see https://github.com/libvips/libvips/issues/1373
2019-07-24 16:06:49 +01:00
John Cupitt
7f3174c3e5 Merge branch 'master' into loader-minimise-experiment 2019-07-23 11:45:24 +01:00
John Cupitt
03bf5a05fa note fuzz in ChangeLog 2019-07-21 18:02:57 +01:00
John Cupitt
2c654060f9 experiment with a different early-close strategy
We close loaders early in order to save file handles, and on Windows to
make sure that files can be deleted as soon as possible.

Currently loaders do this by watching the Y coordinate of requests and
freeing the fd when the final line of the file is fetched. This is messy
and does not always work, since there are cases when the final line is
not fetched.

Instead, this patch gets loaders to listen for "minimise" on their
output and close on that. This signal is emitted on all upstream images
whenever a threadpool finishes a scan of an image and is usually used to
trim caches after computation.

See https://github.com/libvips/libvips/issues/1370
2019-07-20 16:31:30 +01:00
John Cupitt
64a6a27326 Merge branch '8.8' 2019-07-19 11:59:38 +01:00
John Cupitt
8cf6a9f9ca don't attempt to save large XMP to JPG
jpeg_write_marker() with some libjpeg versions will throw a fatal
error with large chunks.

To write >64kb XMP it you need to parse the whole XMP object,
pull out the most important fields, code just them into the main
XMP block, then write any remaining XMP objects into a set of
extended XMP markers.

http://wwwimages.adobe.com/content/dam/Adobe/en/devnet/xmp/pdfs/XMPSpecificationPart3.pdf

Instead, just warn and skip large XMP blocks.

see https://github.com/libvips/libvips/issues/1372
2019-07-19 11:37:36 +01:00
John Cupitt
044f8b74f6 Merge branch 'master' into add-tiff-webp-zstd 2019-07-11 13:50:47 +01:00
John Cupitt
c3e7504835 Merge branch '8.8' 2019-07-10 17:44:39 +01:00
John Cupitt
5e2d66d14b better early shutdown behaviour in shrinkv
read the tail of the input to force early shutdown in seq readers

does reducev need something similar?

see https://github.com/kleisauke/net-vips/issues/12
2019-07-09 16:58:30 +01:00
John Cupitt
52ee3b083f add webp and zstd support to tiffsave
needs some tests still
2019-07-08 10:39:44 +01:00
John Cupitt
c7f98ad0a5 Merge branch '8.8' 2019-07-07 13:12:51 +01:00
John Cupitt
e4cff876a8 fix make dist
we'd renamed a file
2019-07-07 11:20:28 +01:00
John Cupitt
f45f0ecef4 limit resize if shrink would drop axis <1px
vips_resize() will break the aspect ratio and limit resize on an axis if
it would result in an image of less than 1px on that axis

see https://github.com/lovell/sharp/issues/1782#issuecomment-508921306
2019-07-07 10:19:33 +01:00
John Cupitt
3871369d3e Merge branch 'master' into deftomat-master 2019-07-06 14:50:40 +01:00
John Cupitt
777c360774 safer gifload delay array init
- remove assumptions about n_pages
- minor reformatting
2019-07-06 11:34:20 +01:00
John Cupitt
80f247cfb2 Merge branch '8.8' 2019-07-03 15:33:43 +01:00
John Cupitt
8cb2b613b7 note new heifsave param in changelog
plus tiny reformatting
2019-07-03 15:04:58 +01:00
John Cupitt
26100041e7 fewer warnings on tiffload
We were setting TIFFTAG_JPEGCOLORMODE == JPEGCOLORMODE_RGB for *all*
images, but libtiff warns if you use it on an image which is not
jpg-compressed.

Only set it for jpg-compressed images.

See https://github.com/libvips/libvips/issues/1329
2019-07-02 12:23:53 +01:00
John Cupitt
e596fe5cd3 Merge branch 'master' into add-unlimited-to-svgload 2019-07-01 12:04:54 +01:00
John Cupitt
55e49831b8 add "unlimited" to svgload
By default librsvg blocks SVGs > 10MB for security. This patch adds an
"unlimited" flag to remove this check.

We have to switch to using gio to get the librsvg API for this This
needs testing on the platforms we support.

We'll also need to bump the min version of librsvg we require in
configure.ac.

See https://github.com/libvips/libvips/issues/1354
2019-06-28 13:48:18 +01:00
John Cupitt
8a354c5aec improve webp rgba handling
disable webp alpha output if all frame fill the canvas and are solid

see https://github.com/libvips/libvips/issues/1351
2019-06-27 18:44:38 +01:00
John Cupitt
72c103f95a Revert "remove no-alpha webp support"
This reverts commit d1094847a3.
2019-06-27 17:27:53 +01:00
John Cupitt
80648c2d2f text autofit could sometimes underfit
The autofit loop would terminate if either width or height fitted exactly,
but this could happen very early by chance. This patch makes it keep
looping until it finds a dpi which just fits.

See https://github.com/libvips/libvips/issues/1352
2019-06-27 17:19:53 +01:00
John Cupitt
d1094847a3 remove no-alpha webp support
We used to try to spot webp images with no alpha and load them as plain
RGB, but it turns out this is difficult to do reliably, especially
for animated images.

This patch simply removes support, so all webp images now load as RGBA.

See https://github.com/libvips/libvips/issues/1351
2019-06-27 16:37:11 +01:00
John Cupitt
2aef873fcd add vips_image_get/set_array_int() 2019-06-20 11:32:47 +01:00
John Cupitt
8a98bea063 fix vipsthumbnail for pyr tiff files
thumbnail was not testing pyramidal tiff images for pyramidness correctly.

see https://github.com/libvips/libvips/issues/1297
2019-06-19 17:56:09 +01:00
John Cupitt
75e69cc1e5 disable Orc if CET is on
If we are building with -fcf-protection (run-time checking of
indirect jumps) then Orc won't work. Make sure it's off.

Orc may support -fcf-protection in the future, but does not in June 2019.

https://gcc.gnu.org/onlinedocs/gcc/Instrumentation-Options.html#index-fcf-protection
https://gitlab.freedesktop.org/gstreamer/orc/issues/17

see https://github.com/libvips/libvips/issues/1006#issuecomment-501802550
2019-06-14 14:22:00 +01:00
John Cupitt
37a3a6322c remove 256 band limit from arithmetic.c
there was a fixed-size array in vips__bandup()

see https://github.com/libvips/libvips/issues/1335
2019-06-12 09:22:30 +01:00
John Cupitt
ad98222073 better behaviour for vips_region_fetch()
we weren't clipping the fetch area against region valid, so in some
cases we could return many more pixels than expected

see https://github.com/libvips/pyvips/issues/103
2019-06-09 20:38:13 +01: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
eb6c803481 istiff tests first dir rather than magic number
We were testing for TIFF by checking the magic number at the head of the
file. However, formats like ARW are TIFF-like without being TIFF, and
will not load with tiffload.

Instead, try reading the whole of the first directory. This is enough to
stop tiffload trying to load files where it will simply fail
immediately, and make libvips fall back to eg. imagemagick.

see https://github.com/libvips/libvips/issues/1304
2019-06-07 17:52:13 +01:00
John Cupitt
dc16f1253a fix a memleak in tiff pyr to memory
we were not freeing layers other than the top layer
2019-06-06 10:20:14 +01:00
John Cupitt
5657099223 fix composite for some combinations of blend modes
composite could get mixed up blend modes if:

- many images being composited
- some small and positioned with x/y
- at least one unskippable blend mode

phew!
2019-06-04 15:24:54 +01:00
John Cupitt
bd8a6980f5 more consistent behaviour for multi-page load
Some loaders were setting page-height even when the user was loading a
single page triggering unexpected multi-page behaviour from later
savers.

New rule: only set page-height when loading more than one page.

See https://github.com/libvips/libvips/issues/1318
2019-05-29 10:10:28 +01:00
John Cupitt
02bdb8b96c better error message for "unsupported colorspace"
we just printed the enum number before
2019-05-24 17:42:10 +01:00
John Cupitt
5855321638 improve realpath() compat on older libc
older libc didn't allow a NULL for the second param
2019-05-24 15:24:18 +01:00
John Cupitt
394f9baa5e deprecate webpload @shrink, use @scale instead
We need a fractional scale for thumbnail on webp to work well. @shrink
still works, but @scale overrides it.
2019-04-30 18:29:16 +01:00
John Cupitt
3245dd301b Merge branch 'master' into szi-associated 2019-04-25 17:25:32 +01:00
John Cupitt
0102a10b49 seems to work 2019-04-24 17:04:31 +01:00
John Cupitt
27aae32ff6 oops 2019-04-22 11:34:45 +01:00
John Cupitt
c98da89ac9 Merge branch '8.7' 2019-04-19 12:47:35 +01:00
John Cupitt
bae484ba2c remove old c++ and py interfaces
Instead, use the new(er) vips8 C++ interface, and the new(er) python
interface in pypi.

https://pypi.org/project/pyvips
2019-04-12 16:27:28 +01:00
John Cupitt
080ab87d37 Merge branch 'master' into HEAD 2019-04-11 16:18:39 +01:00
John Cupitt
91d0e7e3d0 move kill mechanism to public API
the vips_image_set_kill() system was internal. Move it to the public
API.

See eg.:

https://github.com/kleisauke/net-vips/issues/31
2019-04-06 16:53:42 +01:00
John Cupitt
1f100c0c42 better buffer sizing in tiff reader
We were not setting JPEGCOLORMODE_RGB early enough, so buffers could be
undersized in some circumstances.

Thanks omira-sch.
2019-03-31 12:55:30 +01:00
John Cupitt
da15285bf9 add support for justified text
And set xoffset/yoffset to the top line of text output.

https://github.com/libvips/libvips/issues/1258
2019-03-16 11:53:09 +00:00
John Cupitt
a663a1bb1c add vips_region_fetch() etc.
to help ML applications ... they let us generate lots of small rectangular
areas of images very quickly
2019-03-12 16:00:24 +00:00
John Cupitt
a05a2cb52d mild refactoring of threadpool
clean up and simplify after https://github.com/libvips/libvips/pull/1240
2019-02-27 14:23:43 +00:00
John Cupitt
793cbeeaa7 add note abut region_shrink to changes
somehow got dropped
2019-02-24 20:13:18 +00:00
John Cupitt
27195cc92c add vips_foreign_get_suffixes()
Add vips_foreign_get_suffixes(), get an array of all the filename suffixes that
libvips recognises.

See https://github.com/libvips/ruby-vips/issues/186
2019-02-23 13:50:10 +00:00
John Cupitt
1a83605238 Merge branch 'add-heifload' 2019-02-17 17:11:14 +00:00
John Cupitt
044abe7986 fix some tilecache issues too 2019-02-16 15:32:45 +00:00
John Cupitt
bfa1f22520 works!
tuned a bit too
2019-02-14 15:22:51 +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
8d5af9fe8a add xmp/ipct/icc etc. to magickload
ImageMagick supports binary metadata with `ResetImageProfileIterator()`
etc.

Implementing support gives us xmp / ipct / icc support, plus perhaps
some others.
2019-02-04 17:54:57 +00:00
John Cupitt
f23d0fd754 note new option_string param in changelog 2019-02-03 12:27:58 +00:00
John Cupitt
308c85c004 add support for stored heif thumbnails 2019-01-30 16:19:11 +00:00
John Cupitt
cae7838f86 heifsave seems to work 2019-01-29 16:40:34 +00:00
John Cupitt
33fd2a48f0 basic load works
no metadata, no options
2019-01-20 11:33:12 +00:00
John Cupitt
849d24472e revise changelog
had Klies' magickload fix in there twice
2019-01-18 12:52:04 +00:00
John Cupitt
dcba364efa Merge branch 'zero-mem-on-malloc' 2019-01-18 11:31:11 +00:00
John Cupitt
00622428bd zero memory on malloc
to prevent write of uninit memory under some error conditions

thanks Balint
2019-01-18 10:10:43 +00:00
John Cupitt
00982f6297 add changelog notes
and small formatting issues
2019-01-15 09:36:31 +00:00
John Cupitt
bcc76c6edb Merge branch 'master' into tiff-pyr-stop-at-1-pixel 2019-01-12 15:48:17 +00:00
John Cupitt
f768029298 make the savers use profile_load
tiff, jpeg and png save all use profile_load to attach profiles
2019-01-11 06:30:06 +00:00
John Cupitt
28999aa5b6 add vips_profile_load()
and use it in icc_transform
2019-01-10 22:48:21 +00:00
John Cupitt
960324b08a Merge branch 'master' into add-icc-fallbacks 2019-01-10 15:48:37 +00:00
John Cupitt
5bc342b9b2 revise changelog in magickload fix 2019-01-08 09:05:39 +00:00
John Cupitt
a293da4b5a Merge branch '8.7' 2019-01-04 10:36:59 +00:00
John Cupitt
63c6c7ae30 fix small magicksave error
copy-paste fail meant that IM exceptions were not inherited correctly

see 1619c8b1a1 (commitcomment-31838043)
2019-01-04 10:34:30 +00:00
John Cupitt
87062c4a4f Merge branch '8.7' 2019-01-04 09:19:04 +00: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
b8a158b69b seems to work
added some more consts as well
2019-01-03 13:34:13 +00:00
John Cupitt
020ff88f6a Merge branch 'master' into dzsave-skip-blanks 2019-01-02 11:00:42 +00:00
John Cupitt
f611845698 Merge branch 'master' into add-CMYK2XYZ 2018-12-31 14:02:51 +00:00
John Cupitt
6c72ca45b7 Merge branch '8.7' 2018-12-29 22:56:58 +00:00
John Cupitt
9d66420ad5 round to nearest in log scale
we were doing round to nearest in linear mode, but not log

see https://github.com/libvips/build-win64-mxe/issues/3
2018-12-29 20:19:38 +00:00
John Cupitt
c5d0ca8300 add cmyk2xyz and back
seems to work, still to do:

- tests
- try:

```
$ vipsthumbnail NordicsLIQUOR-SFBag_300_cmyk.JPG

(vipsthumbnail:7868): VIPS-WARNING **: 16:53:17.166: profile incompatible with image
```

see https://github.com/libvips/libvips/issues/1186
2018-12-27 17:35:35 +00:00
John Cupitt
d35343f817 stop making tiff pyr if axis drops to 1
TIFF pyramids of images with a very extreme aspect raio could see layer
width or height drop to 0 before the image fitted in a single tile. This
change stops pyramid creation when width or height drop to 1.

See https://github.com/libvips/libvips/issues/1188
2018-12-21 14:47:28 +00:00
John Cupitt
51dbf607dd add skip-blanks option to dzsave
Skip-blanks was a feature of google layout. This patch makes it into an
option you can control which defaults on in gm mode.

See https://github.com/libvips/libvips/issues/1185
2018-12-19 14:52:33 +00:00
John Cupitt
1ee5b13205 Merge branch '8.7' 2018-12-17 13:21:28 +00:00
John Cupitt
582b224125 oops revert version bump 2018-12-17 13:20:14 +00:00
John Cupitt
962cab2d0f Merge branch '8.7' 2018-12-17 13:18:58 +00:00
John Cupitt
db4fe60405 fix mapim offsets
pixels were not being offset by the stencil origin, so interpolators
like bicubic could fail

thanks @erdmann

https://github.com/libvips/libvips/issues/1180
2018-12-17 12:42:34 +00:00
John Cupitt
6bc564a1e1 turn on smalltile
2D locality helps a lot with many subimages
2018-12-07 16:43:44 +00:00
John Cupitt
58776970ec Merge branch 'master' into revise-composite 2018-12-07 14:31:56 +00:00
John Cupitt
0dccfc87b6 Merge branch '8.7' 2018-12-07 14:30:00 +00:00
John Cupitt
da31d0f31a fix autofit loop on non-scaleable fonts
see https://github.com/libvips/libvips/issues/1178
2018-12-07 12:57:44 +00:00
John Cupitt
7b19ad8dc1 composite subimage positioning almost done
--x fails though? odd

vips composite2 Gugg_coloured.jpg PNG_transparency.png x.jpg over --x 600 --y 100

--x causes the dice to clip, but not translate
2018-12-06 18:28:55 +00:00
John Cupitt
d550016610 Merge branch 'master' into revise-composite 2018-12-06 16:05:25 +00:00
John Cupitt
5fa4ae08da Merge branch '8.7' 2018-12-05 17:37:25 +00:00
John Cupitt
ac4897abee Fix up vips_text()
Fixes two issues:

1. vips_text() in autofit mode could set the wrong DPI, since it set the
DPI in its own copy of the variable, but did not do a final update on
the DPI setting that FT uses for rendering.

2. vips_text() in autofit mode allocated a new context each time, rather
than reusing the context for that call. This caused a small memory leak.

See https://github.com/libvips/libvips/issues/1174
2018-12-05 14:24:26 +00:00
John Cupitt
2c26c23163 composite in scanlines, not pixels
try compositing a scanline at a time, should improve cache locality for
deep image stacks

seems to work, needs benchmarking
2018-11-27 18:27:38 +00:00
John Cupitt
0669cf2a23 Merge branch 'master' into add-webp-animated 2018-11-23 17:41:09 +00:00
John Cupitt
cff4af34ca add vips_image_set_blob_copy()
and use it where we can
2018-11-23 16:27:39 +00:00
John Cupitt
d4815e8b7e more info output for tmpfile open
to help diagnose problems
2018-11-21 14:26:52 +00:00
John Cupitt
6b9d89b103 add pyr tiff shrink-on-load for thumbnail 2018-11-16 18:00:25 +00:00
John Cupitt
26d0e312c6 add bandand/or/eor to the cpp binding
oops, they had been dropped

thanks clcaalu

see https://github.com/libvips/libvips/issues/1165
2018-11-16 13:10:22 +00:00
John Cupitt
07d58f81b3 fix cast on uint images
we could get sign and overflow mixed up for casts on uint images

see https://github.com/libvips/nip2/issues/74
2018-11-14 17:07:49 +00:00
John Cupitt
3e070cbcdf Merge branch 'master' into add-webp-animated 2018-11-05 16:26:45 +00:00
John Cupitt
17c9856e38 add n/page support for webp read 2018-11-05 16:21:21 +00:00
John Cupitt
d6c7d86e12 Merge branch '8.7' 2018-11-05 10:41:46 +00:00
John Cupitt
0bea76d364 fix temp file open
was not auto-deleteing on windows, needs a fallback on linux

see https://github.com/libvips/libvips/pull/1155
2018-11-05 10:40:51 +00:00
John Cupitt
7c6f417e68 fix some typos ... it works!
need to add support for delay and loop still
2018-10-31 16:52:09 +00:00
John Cupitt
22ba9106b5 implement shrink-on-load for openslide thumbs
makes vipsthumbnail much quicker on openslide images, obviously

see https://github.com/libvips/libvips/issues/1149
2018-10-31 14:07:13 +00:00
John Cupitt
0b050f4046 deprecate thumbnail auto_rotate, add no_rotate
the auto_rotate option of thumbnail was default TRUE which made it
useless from the CLI, since GOption only allows --switch, not
--switch=false

deprecate auto_rotate, add no_rotate, but allow either to be used

see https://github.com/libvips/libvips/issues/1146
2018-10-31 12:30:37 +00:00
John Cupitt
6be70e6799 add xmp load/save for png
plus a test
2018-10-06 11:54:27 +01:00
John Cupitt
703498aa81 Merge branch '8.7' 2018-10-01 21:23:48 +01:00
John Cupitt
0fea113bbf fix build on older glibs
we were using g_str_to_ascii(), but it was only added in glib 2.40

see https://github.com/libvips/libvips/issues/1117
2018-10-01 20:15:34 +01:00
John Cupitt
9ac5a449f2 add low/high to smartcrop
smartcrop attention had a centre setting, but not low or high

see https://github.com/libvips/libvips/issues/1089
2018-09-22 14:47:40 +01:00
John Cupitt
b552dd0503 version bump to get ready for the vips 8.8 cycle 2018-09-21 15:10:39 +01:00
John Cupitt
f3de6a9521 update function list in docs
thanks janko-m

see https://github.com/jcupitt/libvips/issues/1097
2018-09-20 08:26:51 +01:00
Kleis Auke Wolthuizen
b5b756b817 Add vips_object_get_args
Handy for language bindings.
2018-08-19 22:42:26 +02:00
John Cupitt
f4250ab7ab scale openexr alpha up
scale alpha up to 0 - 255 to match the rest of libvips
2018-08-19 10:53:54 +01:00
John Cupitt
643e7c0ea2 mapim fix for strange float values
mapim could fail for float index images outside the int range

minor speedup too
2018-08-12 17:10:23 +01:00
John Cupitt
0b3565c04d update radiance load from upstream
thanks Greg Ward
2018-08-03 18:31:31 +01:00
John Cupitt
e89dac20bb add sniffing framework to magickload
though it only spots ICO for now

see https://github.com/jcupitt/pyvips/issues/39
2018-07-24 17:38:36 +01:00
John Cupitt
72f589764a remove the @format param to magickload 2018-07-24 17:03:38 +01:00
John Cupitt
2d94fe732a escape ASCII control chars in xml
stops some XML parse errors on corrupt metadata

see https://github.com/jcupitt/libvips/issues/1039
2018-07-23 14:55:37 +01:00
John Cupitt
3d5b0b814f merge in test suite 2018-07-20 13:58:27 +01:00
John Cupitt
3201b4373d Merge branch 'master' into add-nifti-support 2018-07-20 13:57:51 +01:00
John Cupitt
d03416d386 works!
just needs some tests

could be faster too
2018-07-19 17:45:54 +01:00
John Cupitt
d06c2fee22 use exif_tag_get_name_in_ifd() everywhere
exif tag names change with the ids they appear in, so you must always
use exif_tag_get_name_in_ifd(), not exif_tag_get_name()

see: https://github.com/jcupitt/libvips/pull/1030
2018-07-09 09:35:39 +01:00
John Cupitt
d510807e90 vmoe the test suite back into libvips 2018-07-06 15:43:20 +01:00
John Cupitt
3a9adbcea9 seems to work
could probably add some more fields
2018-07-03 16:36:39 +01:00
John Cupitt
35b4a1a3b5 fix mem leak in pngsave
and some reformatting and changelog notes
2018-06-20 14:20:22 +01:00
John Cupitt
a373d2c876 add changelog notes for region_shrink 2018-06-13 17:36:36 +01:00
John Cupitt
539cc0616c Merge branch '8.6' 2018-06-13 16:24:20 +01:00
John Cupitt
e6edcfe20d improve accuracy of vector path 2018-06-13 16:23:21 +01:00
John Cupitt
3b1e3e1841 add Mitchell kernel
see https://github.com/jcupitt/libvips/issues/966
2018-06-12 12:55:10 +01:00
John Cupitt
cc29a13cc7 revise composite position code slightly
- move x/y into composite and out of composite base, have separate x/y int
params for composite2
- upsize later for a small speed improvement
- doc comment
- note in changelog

see https://github.com/jcupitt/libvips/pull/934
2018-06-11 17:04:29 +01:00
John Cupitt
0e3cac1a72 make cpp overloads const
all overloads are declared const now, where possible

also revised cpp examples and ran them to check

see https://github.com/jcupitt/libvips/issues/983
2018-06-11 15:24:11 +01:00
John Cupitt
ca6410e1a6 make members and getters "const" in cpp api
eg. VImage::width() is now

	int VImage::width() const;

ie. it does not alter the image objects. In factr we can mark almost all
members const.

see https://github.com/jcupitt/libvips/issues/983
2018-06-11 14:30:17 +01:00
John Cupitt
87b3f17846 vips7 API defaults off 2018-06-11 12:44:28 +01:00
John Cupitt
fb64d3607a add @background option to pdfload
Add a "background" option to pdfload to help support PDFs with a
transparent background. For example:

	vips copy transparent.pdf[background=0] x.png

see https://github.com/jcupitt/libvips/issues/995
2018-06-08 10:28:00 +01:00
John Cupitt
5ec605c98c Merge branch '8.6' 2018-06-01 23:05:16 +01:00
John Cupitt
a3394dc756 fix webp metadata save with webpmux
see https://github.com/jcupitt/libvips/pull/989
2018-06-01 23:01:33 +01:00
John Cupitt
e9aaedc60a fix some compiler warnings
from the msvc patch
2018-06-01 19:44:43 +01:00
John Cupitt
86a1a0a7e2 Merge branch '8.6' 2018-05-29 19:30:46 +01:00
John Cupitt
7e95ae514d don't use ping in magickload
too unreliable, sadly
2018-05-29 19:29:11 +01:00
John Cupitt
0486218ff5 don't use Ping in magickload
it's too unreliable :-( we are forced to read every time
2018-05-29 17:20:46 +01:00
John Cupitt
d251b37d92 add vips_argument_get_id()
We had a global we incremented to allocate property ids, but of course that
won't work with DLLs. Instead, add vips_argument_get_id() and call that to
allocate new prop ids.

See:

https://github.com/jcupitt/libvips/issues/985
2018-05-29 16:49:20 +01:00
John Cupitt
4058312aee fix a TGA ping crash
see https://github.com/jcupitt/libvips/issues/980
2018-05-25 16:40:50 +01:00
John Cupitt
73a55e0322 update ChangeLog 2018-05-25 16:06:05 +01:00
John Cupitt
b085908558 remove vips7 stuff from API
You must now include vips7 support explicitly with

	#include <vips/vips7compat.h>

in your code just after including `vips.h`.

The old vips7 names, such as `Rect`, were starting to cause problems
with other packages like opencv.
2018-05-16 15:08:21 +01:00
John Cupitt
fd7b04fb9d Merge branch '8.6' 2018-05-14 18:10:13 +01:00
John Cupitt
5b132ccbdc note new config test in changelog 2018-05-14 17:19:06 +01:00
John Cupitt
e496df598b working! 2018-05-01 15:50:48 +01:00
John Cupitt
4d683559aa add a fontfile option to text
use @fontfile to give a font to load ... note that this just loads the
font, you'll need to set it with @font as well

see https://github.com/jcupitt/libvips/issues/950
2018-04-26 21:03:40 +01:00
John Cupitt
da6f4fd043 add n-pages metadata item
tiff, magick and pdf load now attach an n-pages metadata item recording
the number of pages in the orginal file

see https://github.com/jcupitt/libvips/issues/953
2018-04-26 08:55:31 +01:00
John Cupitt
4f22e8d1dc add jpeg-chroma-subsample to jpegload
The jpeg loader now sets the field jpeg-chroma-subsample to record
chroma subsample.

See https://github.com/jcupitt/libvips/issues/954
2018-04-25 16:04:20 +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
c0569d25bf final fixups
- add buffer load
- test under valgrind
- code sharing with the poppler pdf loader
2018-04-11 18:53:38 +01:00
John Cupitt
5b55dd8ed4 Merge branch '8.6' 2018-04-11 09:38:59 +01:00
John Cupitt
d1dd41a21f strict round down on jpeg shrink
libjpeg rounds up on shrink-on-load. In some cases this can leave a dark
line along the right and bottom edge, since it only contains (for
example) 1/4 of a pixel of data.

This change adds a crop after jpeg load so that only complete pixels are
output.

See https://github.com/lovell/sharp/issues/1185
2018-04-10 15:18:18 +01:00
John Cupitt
15abbbe986 set "interlaced" for jpg and png
set "interlaced" for interlaced png and jpg images
2018-04-09 17:14:38 +01:00
John Cupitt
06802e4110 use O_TMPFILE, if available
If O_TNMPFILE is available, use it. This is a linux extension that
creates an unlinked file, so it'll be closed by the system when the last
associated fd is closed.

see https://github.com/jcupitt/libvips/pull/930
2018-04-09 13:27:57 +01:00
John Cupitt
f3842dcc4b update cpp example
thanks fangqiao

see https://github.com/jcupitt/libvips/issues/932
2018-04-08 11:44:15 +01:00
John Cupitt
5f3bcd88ae Merge branch '8.6' 2018-04-04 17:11:16 +01:00
John Cupitt
632bce3c78 reduce stack use for radsave
fixes a crash on very low stack libcs like musl
2018-04-04 16:25:35 +01:00
John Cupitt
aebb8af803 create funcs always make MULTIBAND
Before, they could make B_W for one-band output. This caused problems
with (for example) two black image bandjoined: the second band then
looked like an alpha to hasalpha() and enabled premultiply/unpremultiply
for operations like affine.

Now, it's always MULTIBAND. This is the generic multiband image type, so
you don't get any unexpected alpha handling.
2018-04-04 09:22:57 +01:00
John Cupitt
0dd6b095aa more conservative hasalpha
The result of hasalpha is used to turn on things like
premultiplication, so we should be rather conservative
about when we signal this. We don't want to premultiply
things that should not be premultiplied.

Check Type as well as bands.

See: https://github.com/jcupitt/libvips/issues/918
2018-04-03 14:36:43 +01:00
John Cupitt
e686614f2c drop incompatible profiles from save
libpng has started throwing hard errors if the profile does not match
the image -- this can happen all the time with perofiles inherited from
images that have been processed.

Test profiles before save and drop them (with a warning) if they are
incompatible with the image.
2018-04-01 10:32:48 +01:00
John Cupitt
5176b4a17e better header sniffing for small files
vips__get_bytes() used to fail if the file was too small for the
allocated buffer, which was a problem for svg, since files can be extremely
small.

This change makes vips__get_bytes() return the number of bytes read, so
the is_a testers can work on files smaller than the max header size.
2018-03-22 12:08:39 +00:00
John Cupitt
5a1ab5968b move svg_ia_a into the base class
feels a bit more logical
2018-03-22 10:43:01 +00:00
John Cupitt
754a1e5419 Merge branch 'master' into add-canny 2018-03-14 14:18:39 +00:00
John Cupitt
206f158a77 Merge branch '8.6' 2018-03-12 18:12:56 +00:00
John Cupitt
878c77a035 better handling of some fonts
fonts with very large overlapping edges copuld clip in `text`, see
https://stackoverflow.com/a/49169747/894763
2018-03-12 18:11:25 +00:00
John Cupitt
08dcf29b10 add vips_rotate()
vips_similarity() was a little hatrd to discover, so add vips_rotate()
as a more obvious name for it
2018-03-10 18:45:39 +00:00
John Cupitt
5834779ac6 Merge branch 'master' into add-canny 2018-03-10 15:13:49 +00:00
John Cupitt
0a05dd4304 Merge branch '8.6' 2018-03-09 16:37:10 +00:00
John Cupitt
29e05dabaf icc_import attaches the input profile if used
icc_import can take a fallback input profile in case the embedded one is
broken or missing. If we use the fallback profile, this change attaches
it to the output image.

This means that icc_import will always output an image with the icc
profile that was used to import it. This helps to make the behaviour of
`thumbnail` more consistent.

See https://github.com/jcupitt/libvips/issues/152
2018-03-08 13:11:54 +00:00
John Cupitt
6e0e31a534 Merge branch '8.6' into add-canny 2018-03-05 15:21:30 +00:00
John Cupitt
6fae79b60d Merge branch '8.6' 2018-03-05 15:09:08 +00:00
John Cupitt
20d840e6da fix a crash with delayed load
If a delayed load failed, it could leave the pipeline only half-set up.
Sebsequent threads could then segv.

Set a load-has-failed flag and test before generate.

See https://github.com/jcupitt/libvips/issues/893
2018-03-05 14:42:09 +00:00
John Cupitt
7f5b0b94c3 Merge branch '8.6' into add-canny 2018-03-04 18:45:59 +00:00
John Cupitt
881a10380e Merge branch '8.6' 2018-03-04 18:45:51 +00:00
John Cupitt
eefb2dad98 improve rounding in convi intize
We were rounding up with ceil() when intize-ing convolution masks.
However, the vector path has a true range of (1.0, -1.0], so a mask with
1.0 as the max (for example) was actually triggering the overflow detector
and falling back to the C path.

Round up with ceil(x + 1) instead, so 1.0 (for example) will be mapped
to 0.5 and won't overflow.
2018-03-04 18:30:25 +00:00
John Cupitt
bca2418d9a Merge branch 'master' into add-canny 2018-03-04 15:31:19 +00:00
John Cupitt
e7a5a8af4a Merge branch '8.6' 2018-03-04 15:31:08 +00:00
John Cupitt
6cff74b602 vips_image_write() could crash if called twice
two writes in a row could trigger a crash in some circumstances, thanks
@dirceupj

see https://github.com/jcupitt/ruby-vips/issues/156
2018-03-04 15:14:06 +00:00
John Cupitt
4a59fa652c make vips_sobel()
cut out of vips_canny()
2018-02-26 18:33:20 +00:00
John Cupitt
a9b4aeb13a Merge branch '8.6' 2018-02-21 19:01:43 +00:00
John Cupitt
bbe42e13fa version bump 2018-02-12 12:39:53 +00:00
John Cupitt
ce1f236c4d another 2x faster on hough_line 2018-02-02 09:12:31 +00:00
John Cupitt
78db92e60e better hough_line
2x faster, better parameter space, but breaks compat :( sorry
2018-02-01 20:41:14 +00:00
John Cupitt
5a4b4e196d allow remove thumbnail from exif
if the user has removed (or set to NULL) the "jpeg-thumbnail-data" tag,
remove it from the image EXIF on save

see https://github.com/jcupitt/ruby-vips/issues/147
2018-02-01 16:15:02 +00:00
John Cupitt
749f4a902a Merge branch '8.6' 2018-01-31 20:47:01 +00:00
John Cupitt
e8958cb8ae improve changelog 2018-01-31 20:45:14 +00:00
John Cupitt
01eed391ab add sync locks to vips_sink()
vips_sink() used to just fire off threads willy nilly -- this could
cause problems with sequential images if a worker fell too far behind
the pack

copy over the area locking mechanism from vips_sink_memory(): new
threads are now stalled if an old thread has not finished
2018-01-31 16:25:06 +00:00
John Cupitt
421f659d33 allow 1 mode in composite
reused for all joins

see https://github.com/jcupitt/pyvips/issues/30
2018-01-30 10:12:03 +00:00
John Cupitt
5fd2ecf81d remove limit on n image in composite
composite was limited to a max of 64 images ... remove the limit

see https://github.com/jcupitt/pyvips/issues/30
2018-01-30 09:48:34 +00:00
John Cupitt
4865141afa szi save will write associated images
if they have been attached by openslide load
2018-01-28 16:39:13 +00:00
John Cupitt
28391dbfc7 option to attach associated images as metadata
you now see:

```
$ vipsheader -a CMU-1.svs[attach_associated] | grep ass
openslide.associated.label: 387x463 uchar, 4 bands, rgb
openslide.associated.macro: 1280x431 uchar, 4 bands, rgb
openslide.associated.thumbnail: 1024x732 uchar, 4 bands, rgb
slide-associated-images: label, macro, thumbnail
```
2018-01-27 16:43:58 +00:00
John Cupitt
de2e3e3299 add vips_image_(get|set)_image()
so images can have other images as metadata
2018-01-27 14:49:33 +00:00
John Cupitt
21e1e68771 write scan-properties.xml to szi
see https://github.com/jcupitt/libvips/issues/853
2018-01-26 17:20:58 +00:00
John Cupitt
c46f4b15e0 dzsave to szi sets extension correctly
see https://github.com/jcupitt/libvips/issues/852
2018-01-26 15:36:43 +00:00
John Cupitt
97a4ed2ca9 fix a c++ warning
see https://github.com/jcupitt/libvips/pull/864
2018-01-26 07:56:43 +00:00
John Cupitt
39406877a2 Merge branch '8.6' 2018-01-12 17:23:24 +00:00
John Cupitt
94daa18884 fix read of plane-separate, large-strip tiff
TIFFReadScanline() is too fiddly to use on plane-separate, large-strip
images ... ban it!

see https://github.com/jcupitt/libvips/issues/855
2018-01-12 17:04:47 +00:00
John Cupitt
18f530c724 Merge branch '8.6' 2018-01-12 12:02:41 +00:00
John Cupitt
24c07cfde2 revert an accidental ABI break
the new window manager code in 8.6.1 changed the prototype of an internal
function which was visible in the public API

this patch renames the function, adds it to an internal header instead,
and adds a stub for the old prototype

see https://github.com/jcupitt/libvips/issues/854
2018-01-12 11:56:17 +00:00
John Cupitt
925667f8d3 Merge branch '8.6' 2018-01-05 16:29:56 +00:00
John Cupitt
1b89d62eb5 fix a race associated with sink_screen
sink_screen was not keeping a ref to its input, so in rare conditions
it could try to make a region on a dead image
2018-01-05 16:27:44 +00:00
John Cupitt
68e0067840 note rgb->g improvement 2018-01-03 08:34:15 +00:00
John Cupitt
4c2434ab67 fix memleak in dzsave
tree elements were not being freed, thanks lovell

see https://github.com/jcupitt/libvips/issues/837
2018-01-01 11:40:04 +00:00
John Cupitt
39ab05469f Merge branch '8.6' 2017-12-31 12:57:57 +00:00
John Cupitt
9febc3ac3e seq could be set on small random images
images under the disc threshold opened in random access mode from
sequential loaders would have the seq tag set on them, causing
performance problems with vips_resize()

see https://github.com/jcupitt/libvips/issues/840
2017-12-31 12:56:11 +00:00
John Cupitt
a128149009 Merge branch '8.6' 2017-12-31 10:39:36 +00:00
John Cupitt
77287a938f fix misspelling of IPTC as IPCT
the letters have been accidentally swapped for years

add a compat macro so older code still works
2017-12-31 10:23:27 +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
eea8b61f3f tiny cleanup
make the code for error during jpeg buffer write a little cleaner --
rather than calling the jpeg term method ourselves, have a separate
destroy function for the write buffer
2017-12-19 08:56:51 +00:00
John Cupitt
424b359d33 bump wrapper script version
and add a test too

see https://github.com/jcupitt/libvips/issues/834
2017-12-17 10:50:57 +00:00
John Cupitt
19e2e2e208 add credit to changelog 2017-12-16 10:01:04 +00:00
John Cupitt
f4f9667406 remove the 64 image limit on bandary
any number of input images now

see https://github.com/jcupitt/libvips/issues/822
2017-12-15 14:21:31 +00:00
John Cupitt
3c0a2e4837 fix window cycling
we were repeatedly free-ing and new-ing input mmap windows ... this made
things like zoom out on large images in nip2 much slower than they
needed to be
2017-12-10 17:37:07 +00:00
John Cupitt
e9b7231ac0 add "extend" option to affine
so for upsizing with displacement (like resize) we can prevent dark
edges on bright images

see

https://github.com/jcupitt/php-vips/issues/61
2017-12-07 14:51:07 +00:00
John Cupitt
60bd5f6512 add composite2 to notes 2017-12-01 13:37:15 +00:00
John Cupitt
13a693c8bc Merge branch 'master' into add-extra-dzsave-tiles 2017-12-01 13:33:54 +00:00
John Cupitt
9c8790b40a setting EXIF data blocks sets other tags too
calling vips_image_set() to set the EXIF data block VIPS_META_EXIF_NAME
will automaticaly set other tags, like orientation etc.
2017-11-27 15:15:21 +00:00
John Cupitt
10eef89a7f update c++ bindings 2017-11-26 17:45:04 +00:00
John Cupitt
406e228c9b vips_resize() is always centre convention
it was corner for downsize, but should be centre to match imagemagick
2017-11-26 15:24:40 +00:00
John Cupitt
7db13412e5 deprecate centre option to resize
it's now centre on upsize, corner on downsize

see https://github.com/jcupitt/libvips/issues/705
2017-11-25 14:22:20 +00:00
John Cupitt
5664a0d9b1 dzsave outputs extra tiles along right and bottom
the deepzoom spec wants tiles to be written along the right and bottom,
even of those tiles contain no new pixels

this patch seems to work, but needs testing

see: https://github.com/jcupitt/libvips/issues/795
2017-11-24 15:54:22 +00:00
John Cupitt
6a4b249445 add dispose handling
see https://github.com/jcupitt/php-vips/issues/59
2017-11-22 17:37:31 +00:00
John Cupitt
27621733f2 add gif-comment 2017-11-22 13:10:06 +00:00
John Cupitt
e56282e1fd add gif-loop metadata
see https://github.com/rokka-io/imagine-vips/issues/3
2017-11-21 16:04:18 +00:00
John Cupitt
a4b89aa370 credit for affine fixup 2017-11-18 15:11:02 +00:00
John Cupitt
fcec6d639b fix jaggies on the edge of affine output
and add a "background" param
2017-11-17 16:30:25 +00:00
John Cupitt
4ea743f5e6 add combine mode to find_indexed 2017-11-03 16:36:09 +00:00
John Cupitt
487c112807 add VIPS_COMBINE_MIN combining mode
for vips_compass()
2017-11-02 12:34:01 +00:00
John Cupitt
55e577a2fb rename nearest as fill_nearest
avoid a clash with the nearest-neighbour interpolator
2017-11-01 15:06:37 +00:00
John Cupitt
cdc286e9d6 switch to float distance calculations
removes dithering effects along edges
2017-11-01 13:16:36 +00:00
John Cupitt
3b75b1e2ac fix gcc7 build
removed exception specs from deprecated C++ binding
2017-10-24 09:31:23 +01:00
John Cupitt
5ec1d5b72f fix vipsthumbnail --size Nx
oh dear, width but not height size specs to vipsthumbnail were not working

thanks jrochkind

see https://github.com/jcupitt/libvips/issues/781
2017-10-23 22:27:23 +01:00
John Cupitt
dd503c03c6 add vips_value_set_blob_free()
simpler for language bindings to call
2017-10-19 16:37:43 +01:00
John Cupitt
68ed42e2fa make linear and cubic adaptive 2017-10-15 22:09:44 +01:00
John Cupitt
008fd21728 all done 2017-10-14 17:03:48 +01:00
John Cupitt
135d7a4dfb Merge branch '8.5' 2017-10-11 12:57:18 +01:00
John Cupitt
b4a6e6e309 spelling 2017-10-11 11:24:43 +01:00
John Cupitt
fd1d332892 update change notes 2017-10-11 10:12:01 +01:00
John Cupitt
40f20e5e0a Merge branch 'master' into gargsms-text-autofit 2017-10-10 13:04:31 +01:00
John Cupitt
12db3e936c Merge branch '8.5' 2017-10-09 22:35:29 +01:00
John Cupitt
6f16a9df71 fix a crash with heavy use of draw
we were leaving a few bits of the original image around after
vips_image_copy_memory(), including the progress signal ... if earlier images
were freed, perhaps by a GC in a language binding, we could get a dangling
pointer

thanks Nakilon, see https://github.com/jcupitt/ruby-vips/issues/140
2017-10-09 22:27:36 +01:00
John Cupitt
3f22424d3b test for gcc4 and ban vectors
it has severe code gen problems, it seems

this seems to ban clang as well, unfortunately
2017-10-07 11:20:21 +01:00
John Cupitt
aae5babfcc Merge branch 'master' into add-composite 2017-10-01 19:37:26 +01:00
John Cupitt
560f8ac727 add goi note to changelog
see https://github.com/jcupitt/libvips/issues/741
2017-10-01 19:35:44 +01:00
John Cupitt
4b24d82e8c some cleanups, a bit quicker
it now has separate premultiplied and not-premultiplied paths
2017-09-27 17:32:05 +01:00
John Cupitt
64be1d89b5 add gravity 2017-09-20 00:43:17 +01:00
John Cupitt
b2f66a3968 add note on svgload improvement 2017-09-17 05:20:48 +01:00
John Cupitt
e346fd639e built-in python bindings default to off
we still make a typelib by default though

use the new pyvips binding instead, "pip install pyvips"
2017-09-13 18:24:32 +01:00
John Cupitt
48680dccc4 remove python test suite
it's in pyvips now
2017-09-13 17:45:29 +01:00
John Cupitt
60f212c371 credit! 2017-09-11 11:54:01 +01:00
John Cupitt
0f4feb1b73 note file create time change 2017-09-11 11:22:20 +01:00
John Cupitt
5a37d3e809 add an intent option to thumbnail
"intent" lets you set the rendering intent for any ICC conversions --
the default is the (more correct) relative, but "perceptual" can look
better

see https://github.com/jcupitt/libvips/issues/714
2017-08-30 16:34:46 +01:00
John Cupitt
820c279697 Merge branch '8.5' 2017-08-30 14:59:16 +01:00
John Cupitt
653e99ea82 don't build enumtypes so often
we were only replacing enumtypes if it had changed, but this meant that
make usually thought it was out of date compared to the source files,
and rebuilt it, which needed perl

now we always replace it, so (hopefully) perl is no longer a
compile-time dependency
2017-08-30 14:37:48 +01:00
John Cupitt
2b70348d23 Merge branch '8.5' 2017-08-29 10:33:45 +01:00
John Cupitt
e2c83fe4bd fix jpegload fail
we were only failing on libjpeg errors, but libjpeg treats very serious
things thaht we want to be able to catch (like truncated files) as warnings
... we must therefore error out if fail is set and libjpeg issues a warning

see https://github.com/lovell/sharp/issues/793
2017-08-29 09:49:38 +01:00
John Cupitt
d12f8e200a support tiffsave_buffer pyramids
add support for tiff pyramid save to memory, thanks bubba

see https://github.com/jcupitt/libvips/issues/702
2017-08-26 16:26:37 +01:00
John Cupitt
2e513eef82 enable seq mode for join
much faster for large TIFFs

see https://github.com/jcupitt/libvips/issues/717
2017-08-25 10:53:44 +01:00
John Cupitt
97997d1990 Merge branch '8.5' 2017-08-18 22:13:51 +01:00
John Cupitt
f2576003b7 fix webp upscale in thumbnail
we could try to use webp shrink on load to upscale, oops

see https://github.com/jcupitt/libvips/issues/710
2017-08-18 22:08:43 +01:00
John Cupitt
3cf33d7f32 Merge branch '8.5' 2017-08-18 12:32:12 +01:00
John Cupitt
f2c55e80fe better dzsave with zip output to a file
close down output earlier to help mark-sweep bindings
2017-08-18 12:31:24 +01:00
John Cupitt
63550280a4 Merge branch '8.5' 2017-08-04 18:31:25 +01:00
John Cupitt
47a763209a hide warnings if VIPS_WARNING is defined
If VIPS_WARNING is defined, suppress all warning messages from vips by
installing a null log handler.

Libraries should not call g_log_set_handler(), it is supposed to be for
the application layer, but this can be awkward to set up if you are using
libvips from something like Ruby.

This env var hack is a workaround.

see https://github.com/jcupitt/ruby-vips/issues/119
see https://github.com/jcupitt/libvips/issues/544
2017-08-04 18:01:19 +01:00
John Cupitt
e46a56e137 remove lcms1 support
it had bitrotted and no longer worked properly
2017-08-02 13:39:28 +01:00
John Cupitt
302f4f2517 Merge branch '8.5' 2017-08-02 11:05:39 +01:00
John Cupitt
58f9757467 fix transparency detection in merge
a typo meant we were just testing the first band for zero, not all three

thanks Haida!
2017-08-02 10:41:10 +01:00
John Cupitt
a3b226aa9b version bump 2017-08-02 10:40:17 +01:00
John Cupitt
639b0f5021 Merge branch '8.5' 2017-07-29 10:40:44 +01:00
John Cupitt
69f70a7e24 Merge branch '8.5' into tweak-smartcrop-8.5 2017-07-28 18:04:23 +01:00
John Cupitt
1e7541bfb8 add find_trim
compiles, not yet working
2017-07-25 14:52:45 +01:00
John Cupitt
a8fb38fb6a Merge branch '8.5' 2017-07-08 16:06:18 +01:00
John Cupitt
64fe910fc5 fix DPI mixup
librsvg defaulted to 90 DPI, but libvips to 72 DPI -- add a correction
factor

thanks Fosk!

see https://github.com/jcupitt/libvips/issues/688
2017-07-08 12:31:36 +01:00
John Cupitt
9a1c3f9405 rename 'disc' as 'memory'
the old 'disc' flag to open defaulted TRUE and disabled read via disc if you
set it FALSE, which was very confusing

replace it with a flag called 'memory' which defaults FALSE and forces
read via memory if set TRUE

'disc' is still there and still works, it's just tagged as deprecated

see https://github.com/jcupitt/libvips/issues/677
2017-07-07 09:45:49 +01:00
John Cupitt
91457e455a add "page-height" save property 2017-06-19 09:31:49 +01:00
John Cupitt
5383554724 Merge branch '8.5' 2017-06-12 18:23:07 +01:00
John Cupitt
4d846534b8 transform cmyk->rgb automatically
if:

- we are writing a cmyk image
- there is an embedded profile
- the saver does not support cmyk

see https://github.com/jcupitt/libvips/issues/676
2017-06-12 18:19:20 +01:00
John Cupitt
869f3dae04 revise again
seems to work on all test images now
2017-06-09 11:50:27 +01:00
John Cupitt
aeff03b951 Merge branch '8.5' 2017-05-29 10:21:02 +01:00
John Cupitt
7bcf0bb93f don't cache thumbnail
thanks tomasc! see

jcupitt/ruby-vips#109
2017-05-29 10:19:21 +01:00
John Cupitt
354921df83 Merge branch '8.5' 2017-05-28 06:34:11 +01:00
John Cupitt
6a189d068b mark vipsprofile as python2
Some distros have python3 as the default, so make vipsprofile explicitly
python2, thanks ioquatix.

See https://github.com/jcupitt/libvips/issues/667
2017-05-28 06:33:58 +01:00
John Cupitt
027b9ccc9c Merge branch '8.5' 2017-05-26 09:09:33 +01:00
John Cupitt
7b64246af2 fix a couple of issues with huge profiles
The base64 encode limit was 1MB, but some huge profiles can get over
that, so it's now 10MB.

transform_save_string_blob() was incorrectly setting a refstring not a
blob as an error fallback, potentially leaving a dangling pointer.

Thanks Jaume!

See https://github.com/jcupitt/libvips/issues/666
2017-05-26 09:04:15 +01:00
John Cupitt
5216d75b83 Merge branch '8.5' 2017-05-19 16:16:16 +01:00
John Cupitt
5df65ec6fd fix tiff read with page > 0
could break edge tiles under some circumstances
2017-05-19 16:07:36 +01:00
John Cupitt
8c8b71d935 Merge branch '8.5' 2017-05-15 11:35:47 +01:00
John Cupitt
2b0ebb0de2 fix test suite thresholds
changes in jpg encode/decode mean we must adjust test suite thresholds
2017-05-15 11:21:13 +01:00
John Cupitt
6dbdc173a2 better prefix guessing on Windows
see https://github.com/tumagonx/pygi-mingw-patches/issues/5
2017-05-13 11:11:32 +01:00
John Cupitt
82994e4c33 add vips_thumbnail_image()
thumbnail with an image source, see

https://github.com/jcupitt/libvips/issues/656
2017-05-12 18:20:37 +01:00
John Cupitt
5c6979cdcb Merge branch '8.5' 2017-05-12 17:25:01 +01:00
John Cupitt
942b0446a3 revise fail handling, again
clarify policy on file read errors and warnings:

* if the file format library reports a warning, we log it in vips, but
that's all
* if the file format library reports an error, we log it, but try to
continue
* if the file format library reports an error and fail is set, we log it
and fail

all loaders now implement this
2017-05-12 17:22:49 +01:00
John Cupitt
a10787baa3 Merge branch 'add-force-size' 2017-05-10 17:08:32 +01:00
John Cupitt
3019e5966b vips_conv*() default to float
we had INT as the default, but this will cause serious precision loss
with many masks ... instead, have float (always correct) as the default
and let people turn on int if they cn
2017-05-08 13:28:23 +01:00
John Cupitt
260180197d done! but needs some tests 2017-05-04 14:54:49 +01:00
John Cupitt
2b75a372d1 more truncated png improvements 2017-05-03 10:32:24 +01:00
John Cupitt
39ea6ce492 all done 2017-04-29 10:07:41 +01:00
John Cupitt
04353f8915 added new_from_image() to python
and tests
2017-04-28 18:27:15 +01:00
John Cupitt
7882602dfe C/C++ done
python next
2017-04-26 14:52:28 +01:00
John Cupitt
b0f8246c90 Merge branch '8.5' 2017-04-26 10:31:33 +01:00
John Cupitt
cc38097560 better handling of truncated PNG files
improve fail support, and bail out sooner

see https://github.com/jcupitt/libvips/issues/646
2017-04-26 10:25:52 +01:00
John Cupitt
4c8d83ce85 Merge branch '8.5' 2017-04-23 18:54:40 +01:00
John Cupitt
8bf0a05948 doc polishing 2017-04-23 18:52:05 +01:00
John Cupitt
757065baab Merge branch '8.5' 2017-04-23 09:58:11 +01:00
John Cupitt
a067dc4140 oop credit fix 2017-04-23 09:57:55 +01:00
John Cupitt
d8fce50284 Merge branch '8.5' 2017-04-23 09:57:02 +01:00
John Cupitt
7938903d22 don't size caches by image width
we were sizing buffers partly by image width, which could cause caches
to be too small if width changed down a pipeline

see https://github.com/jcupitt/libvips/issues/639
2017-04-23 08:31:16 +01:00
John Cupitt
4f3364a2b0 skip non-image HDUs at start of fits
some fits images have header units (HDUs) at the start with extra
metadata in ... skip over these

see https://github.com/jcupitt/libvips/issues/640
2017-04-15 13:27:45 +01:00
John Cupitt
4094070ecb version bumo for new cycle 2017-04-15 13:26:29 +01:00
John Cupitt
e01a90f7cf revise cache sizing
we had output buffers too large, input caches too small

see https://github.com/jcupitt/libvips/issues/639
2017-04-13 16:24:51 +01:00
John Cupitt
38b65478e5 bump version, doc tweaks
more sotons removed
2017-04-07 15:59:37 +01:00
John Cupitt
a5b04091ee Merge branch 'add-markdown-docs' into 8.5 2017-04-06 11:51:36 +01:00
John Cupitt
c2cb4c38fe missing ptoto for vips_tiffsave_buffer()
oop, thanks greut

see https://github.com/jcupitt/libvips/issues/632
2017-04-04 10:17:05 +01:00
John Cupitt
30829ef003 add howitworks.md 2017-03-31 10:57:04 +01:00
John Cupitt
d5a706e47e better behaviour for truncated PNG files
truncated PNG files failed with an error, even if --fail was not set ...
instead, just warn, and only error out if fail is on

see https://github.com/jcupitt/libvips/issues/629
2017-03-30 17:13:25 +01:00
John Cupitt
cd2c1324c5 version bump for release
and for the one tiny change
2017-03-25 13:57:33 +00:00
John Cupitt
0a5375b6cd Merge branch 'master' into remove-seq-stalling 2017-03-15 12:26:44 +00:00
John Cupitt
fd6006bacb Merge branch 'master' into add-smartcrop 2017-03-13 20:41:22 +00:00