Commit Graph

6583 Commits

Author SHA1 Message Date
John Cupitt
4469afaeb0 better handling of "nearest" in resize
we now use vips_subsample() for this case
2020-06-12 12:03:15 +01:00
John Cupitt
675c72b07f
Merge pull request #1681 from libvips/remove-libheif-autorotate
deprecate heifload autorotate
2020-06-11 15:35:12 +01:00
John Cupitt
b643bd9448 guard against read zero bytes from libheif 2020-06-11 14:59:06 +01:00
John Cupitt
1e015654c3 deprecate heifload autorotate
heifload autorotate is now always on, and we always delete EXIF
orientation tags. If a HEIC image fails to rotate upright, at least it's
someone else's fault.

see https://github.com/libvips/libvips/pull/1680
2020-06-10 19:57:50 +01:00
John Cupitt
f2688ee6c1
Merge pull request #1679 from lovell/heifload-fixes-nclx-hdr
heifload: ignore nclx colour profiles, ensure assumed uchar format
2020-06-10 13:51:50 +01:00
Lovell Fuller
221ad1b9b3 heifload: ignore nclx profiles, ensure uchar format 2020-06-10 12:23:17 +01:00
John Cupitt
dbae22ab58 revise unpremultiply
We were clipping alpha very aggressively. With over- and under-shoot
ringing on edges, this could introduce extra fringes.

see https://github.com/libvips/libvips/pull/1675
2020-06-08 18:47:28 +01:00
John Cupitt
981d5c4b16 revise autorot system
- deprecate vips_autorot_get_angle() since orientation is no longer a
simple rotate
- add vips_image_get_orientation() and vips_image_get_orientation_swap()
- revise tiff and jpeg loader autorotate to just call vips_autorot(),
but only if necessary
- revise thumbnail autorotate too
2020-06-06 17:25:46 +01:00
John Cupitt
30386db775
Merge pull request #1650 from wix-playground/master
Handle mirrored orientations in autorot
2020-06-06 14:46:15 +01:00
John Cupitt
54c40249f8
Merge pull request #1673 from libvips/ome-tiff-pyramid
Support for subifd image pyramids
2020-06-05 13:35:21 +01:00
John Cupitt
d5eecac88c add note about plane separate write 2020-06-05 12:14:40 +01:00
John Cupitt
c82be3d30e read tiff metadata more carefully
we were not always fetching the root metadata
2020-06-04 05:07:34 +01:00
John Cupitt
6e1fd6136d safer directory set in tiff load 2020-06-03 16:41:29 +01:00
John Cupitt
0f57f3692b stop a compiler warning 2020-06-03 13:11:18 +01:00
John Cupitt
6d5a371147 add some tests for subifd pyramids
fix a problem with jpg-compressed tiffs too
2020-06-02 18:08:34 +01:00
John Cupitt
d74fe71764 better thumbnail behaviour for subifd pyramids 2020-06-02 14:23:14 +01:00
John Cupitt
cff84f4606 add subifd pyr support to thumbnail
thumbnail can spot subifd pyramids and load lower levels if necessary
2020-06-02 12:53:36 +01:00
John Cupitt
460e1d0bf5 set n-subifds for tiff files
says how many subifds in the first page
2020-06-01 17:22:10 +01:00
John Cupitt
d16f1e67dd fix tile clipping in toilet roll images
we were not clipping unaligned tiled correctly
2020-06-01 13:22:51 +01:00
John Cupitt
39af6c21c8 update notes 2020-06-01 00:55:19 +01:00
John Cupitt
0bdd2290a0 fix tiff directory mixup
we were not always selecting the correct read directory
2020-06-01 00:39:15 +01:00
John Cupitt
f0d4b36d7d better tiled tiff detection
for tiffs with mixed strip and tile images
2020-05-29 18:30:49 +01:00
John Cupitt
dc29f8dde6 add subifd select to tiff load 2020-05-28 12:40:31 +01:00
John Cupitt
9e4b78215e fix po 2020-05-27 16:30:04 +01:00
John Cupitt
aaebb3b346 fix thumbnail of mono image
we were using RGB as the shrink space
2020-05-27 15:24:27 +01:00
John Cupitt
474bfe3782 pytest and valgrind pass
remove some dbg code
2020-05-24 17:04:55 +01:00
John Cupitt
a2d196b736 add subifd support to the TIFF writer
A new subifd switch enables the writing of pyramids layers into subifds
(rather than the default successive pages). This switch is enabled
automatically for multi-page pyramids.

seems to work in quick tests
2020-05-24 15:21:41 +01:00
John Cupitt
6a8f128831 Merge branch 'master' into ome-tiff-pyramid 2020-05-22 16:12:00 +01:00
John Cupitt
ba0dea001d sort out premultiply rules for upsizing
vips_resize() uses vips_affine() for upsizing and vips_reduce() for
downsizing. Affine automaticaly does a vips_premultiply() for images
with an alpha channel, but reduce does not. This meant that we could
sometimes premultiply twice.

This patch adds a "premultiplied" flag for affine which turns automatic
premultiuplication off, vips_resize() uses this to block affine's auto
premul feature, and the resize docs are clarified to stress that the
operation does not do premultiplication for you.

See https://github.com/libvips/libvips/issues/1629
2020-05-19 14:31:34 +01:00
John Cupitt
44db1742fd tiny doc polish 2020-05-19 14:31:22 +01:00
John Cupitt
b4a9636e51
Merge pull request #1657 from lovell/improve-avif-detection
Improve compile-time libheif and runtime AVIF detection
2020-05-18 22:38:11 +01:00
Lovell Fuller
00dcfa40f1 Improve compile-time libheif and runtime AVIF detection 2020-05-18 19:43:43 +01:00
John Cupitt
951540f4fe revise text docs
To clarify the meaning of VipsAlign in this context.

See https://github.com/libvips/libvips/issues/1654#issuecomment-629671463
2020-05-16 17:57:31 +01:00
John Cupitt
63649629e0 fix doc error
Hopefully clearer, see https://github.com/libvips/libvips/issues/1654
2020-05-16 12:37:20 +01:00
John Cupitt
9cdbf3ee07 don't add fontfiles repeatedly in text
It seems fontconfig will let you add a file repeatedly. This patch adds a
table which is used to block repeated additions and prevents memory growth
and slowdown.

see https://github.com/libvips/libvips/issues/1655
2020-05-16 12:28:12 +01:00
John Cupitt
84b9d1f638 seems to make an OME pyramid correctly
```
$ vips tiffsave ../k2.jpg x.tif --tile --pyramid --subifd && tiffinfo x.tif
TIFF Directory at offset 0x900008 (9437192)
  Image Width: 1450 Image Length: 2048
  Tile Width: 128 Tile Length: 128
  Resolution: 72.009, 72.009 pixels/inch
  Bits/Sample: 8
  Sample Format: unsigned integer
  Compression Scheme: None
  Photometric Interpretation: RGB color
  Orientation: row 0 top, col 0 lhs
  Samples/Pixel: 3
  Planar Configuration: single image plane
  SubIFD Offsets: 11797898 12388230 12585130 12634526     0
```
2020-05-15 17:16:04 +01:00
John Cupitt
ffa10eb148 default JFIF res to 72dpi
We were 1ppm before. 72dpi is the EXIF default.
2020-05-13 14:34:59 +01:00
John Cupitt
7deead8911 add a subifd flag to tiffsave 2020-05-13 12:45:28 +01:00
elad laufer
c993a7ad2a - use jpeg in test target 2020-05-13 11:12:01 +03:00
elad laufer
b31523b470 Merge branch 'libvipsd-master' 2020-05-12 13:03:31 +03:00
Elad Laufer
b05cf39df8
Handle mirroring in autorot (#8)
* handle mirroring in autorot
* added tests for autorot
2020-05-12 13:01:48 +03:00
John Cupitt
5549175b5e add docs for option_string arg to thumbnail
We'd forgotten to add docs for option_string, thanks zhaohuxing.
2020-05-12 10:27:48 +01:00
John Cupitt
b9385b9d35 only warn on png save with a bad profile
Previously we failed. This is very ugly, but it seems to be the only
obvious way to fix this.

See https://github.com/libvips/libvips/issues/1578
2020-05-11 18:00:26 +01:00
John Cupitt
0c9f311f1e
Merge pull request #1647 from libvips/revise-kernel-calculation
revise kernel mask calculations
2020-05-11 13:55:24 +01:00
John Cupitt
e1835d59cd Merge remote-tracking branch 'kleis/fix-regression'
Fix regression in cast
2020-05-11 11:45:06 +01:00
John Cupitt
2265ad70a3 revise cast again
fixes saturated cast to integer
2020-05-11 11:42:12 +01:00
John Cupitt
d64385ae99 revise kernel mask calculations
We were seeing small displacements at some shrink factors because of
rounding in the mask size calcualation. This PR takes the rounding into
account when positioning the mask.

See https://github.com/libvips/libvips/pull/1592#issuecomment-626363031
2020-05-10 18:45:27 +01:00
Kleis Auke Wolthuizen
23bd5bd54c Fix regression introduced in #1619 2020-05-10 13:11:39 +02:00
John Cupitt
b9eddecca3 prevent /0 in jfif res decode 2020-05-06 20:08:36 +01:00
John Cupitt
a2cd5215f1
Merge pull request #1642 from lovell/magick7-is-a-buffer-min-len
Ensure magick7 buffer+file checks use consistent min length guard
2020-05-05 14:04:21 +01:00