Commit Graph

5841 Commits

Author SHA1 Message Date
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 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 01a92679b5 oop left some DEBUG turned on 2019-06-27 17:34:07 +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 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 65c41ef7a5 fix a couple of clang compiler warnings 2019-06-15 17:35:46 +01:00
John Cupitt 631383026b revise README again 2019-06-15 13:21:43 +01:00
John Cupitt aa9164713d note HEIC support in README 2019-06-15 13:14:26 +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 db36e19ffa note PNG XMP support in docs 2019-06-13 09:26:09 +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 eaaa203f0a better compat with older IM
in the ismagick() test
2019-06-08 17:32:04 +01:00
John Cupitt dc8555201d use our sniffer as well is ismagick()
We need to check files for magickload with our sniffer as well as the
imagemagick one.
2019-06-08 17:13:49 +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 bddbecffaf
Merge pull request #1331 from lovell/webp-lossless-quality
Ensure WebP quality option is set for lossless
2019-06-06 06:39:30 +01:00
Lovell Fuller 8d0a42efe2 Ensure WebP quality option is set for lossless 2019-06-05 23:01:06 +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 81861baee9 add note to docs in vips_init() 2019-05-30 19:46:05 +01:00
John Cupitt 675c6361eb revise page-height rules again
Only set `page-height` if `n` is set as an argument. This means you only
get a multi-page image if you specifically ask for it.
2019-05-29 14:18:46 +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 c7e213a9fa LinearGRAYColorspace is rather recent, it seems 2019-05-24 17:47:50 +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 da402cee23 faster and more accurate bilinear
go to fixed point earlier in calculation of interpolation coefficients
2019-05-14 13:10:45 +01:00
John Cupitt 29d9673fd8 update comment 2019-05-14 08:20:30 +01:00
John Cupitt 44afdbc314 more accurate bicubic of int16 images
use float path for int16 -- the fixed-point path can miss by a small
amount

see https://github.com/libvips/libvips/issues/1309
2019-05-13 22:05:41 +01:00
John Cupitt c9ba0915c1 more accurate bilinear for int16 pixels
fixed-point interpolation could give small errors

see https://github.com/libvips/libvips/issues/1309

need a similar change for bicubic etc.
2019-05-13 18:32:48 +01:00
John Cupitt a02229245e tidy up conditionals a bit 2019-05-10 16:43:17 +01:00
John Cupitt b2ad9f9df8 better compat with older libheif
We were looking for "yes" from the builtin_h265_decoder variable to
enable heifload, but this variable was only added in libheif 1.3, so we
failed to turn on heifload correctly.

We now look for not "no", ie. default on.

See https://github.com/libvips/build-win64/pull/26#issuecomment-490854408
2019-05-10 12:59:24 +01:00
John Cupitt 3e60e816ed split heifload / heifsave
test for libheif supporting decode and encode, and turn heifload and
heifsave on and off
2019-05-08 21:13:00 +01:00
John Cupitt b680d9f833 split heifload / heifsave tests
to allow building with the de265 decoder, but not the GPL ffmpeg x265 encoder
2019-05-08 20:42:38 +01:00
John Cupitt d5ca1ddfd4 all tested and working
revised formula for in/out/dest-in/dest-out, for vector and scalar paths

see https://github.com/libvips/libvips/issues/1301
2019-05-08 18:16:40 +01:00
John Cupitt 447e0f3ea2 Merge branch 'master' into revise-composite 2019-05-08 16:14:01 +01:00
John Cupitt 3921e63561 fix vips image writes of more than 2gb
With very wide images and huge numbers of threads, it was possible to
trigger an int overflow in write_vips().

Thanks @erdmann

See https://github.com/libvips/libvips/issues/1306
2019-05-07 13:56:52 +01:00
John Cupitt bcdaeca578 fix anim webp load for some sizes
rounding on resize for each frame needs to match resize for whole image
2019-05-01 16:34:58 +01:00
John Cupitt b1c995b2d9 more animated webp load fixes
webpload scale on load works for animated images
2019-05-01 16:25:13 +01:00
John Cupitt 37865e34f8 oop silly webp jpg mixup in last commit 2019-04-30 20:07:08 +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 ec0b7e7bdf fix pdf test
for new sizing rules
2019-04-30 16:24:36 +01:00
John Cupitt 29d29533d4 better pdfload page size rounding
We were doing simple round down for page size with @scale param. But
this makes it very sensitive to rounding errors, so do rint() instead.

vips-resize() does rint() on the output size as well for the same
reason.

See https://github.com/libvips/libvips/issues/1297#issuecomment-487682785
2019-04-30 16:08:26 +01:00
John Cupitt 7326a409c6 reenable webp shrink-on-load in thumbnail
the breakage is in animated webp load with preshrink rather than
thumbnail
2019-04-29 17:30:34 +01: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 522ddc1430 better thumbnailing of multipage docs
shrink-on-load should now work for multipage PDF thumbnailing

see https://github.com/libvips/libvips/issues/1297
2019-04-29 17:05:19 +01:00
John Cupitt 8482aa3ff1 tiny cleanup
some left-over pyramid detection code in tiff2vips
2019-04-29 12:52:47 +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 b100f5a025 start revising composite again
we can get ugly sparkles in transparent areas in some cases ... start
reworking some modes

see https://github.com/libvips/libvips/issues/1301
2019-04-29 07:43:14 +01:00