Commit Graph

1915 Commits

Author SHA1 Message Date
John Cupitt
fcaba0e6ba add @profile to webpsave
small tiffsave fixes too
2020-07-18 14:49:37 +01:00
John Cupitt
7c2c152a74 note wasm patch in changelog 2020-07-03 02:21:16 +01:00
John Cupitt
e4d38d1d3e clip out of bounds GIF images against the canvas
Some malformed GIFs have images which lie outside or partly outside the canvas.
With this patch, these frames are clipped and rendered.

Previously, these GIFs were rejected.

See https://github.com/libvips/libvips/issues/1701
2020-07-02 16:41:37 +01:00
John Cupitt
15e44f731f add spng in there twice 2020-06-30 11:31:33 +01:00
John Cupitt
2b2fabcd3b vipsheader allows stdin as a filename
```
$ cat k2.jpg | vipsheader stdin
1450x2048 uchar, 3 bands, srgb, jpegload_source
```

See https://github.com/libvips/libvips/issues/1594
2020-06-29 12:06:34 +01:00
John Cupitt
5540fa97f4 small cleanups for disable deprecated
- move matrixinvert to mosaicing, fix a leak
- add note to changelog
- small fixes

see https://github.com/libvips/libvips/pull/1593
2020-06-28 12:14:13 +01:00
John Cupitt
90e61a816b ... note change in ChangeLog
see https://github.com/libvips/libvips/issues/1585
2020-06-28 09:53:49 +01:00
John Cupitt
d831ad34d5 add ppm load/save to a connection
plus some more tests
2020-06-27 15:23:18 +01:00
John Cupitt
4bf27acccb add 1/2/4 bit PNG save
- new @bitdepth param
- deprecate @colours param
2020-06-25 10:40:43 +01:00
John Cupitt
1f8d007d19 rename ppmsave "squash" as "bitdepth"
in line with the tiffsave change
2020-06-18 11:57:33 +01:00
John Cupitt
8b469b4516 adjust formatting of 2, 4 bit tiff load/save
To make it libvipsey. Small fixes as well.
2020-06-16 18:58:27 +01:00
John Cupitt
95406c7888
Merge pull request #1682 from libvips/libspng-experiment
Load PNGs with libspng
2020-06-12 19:11:42 +01:00
John Cupitt
8c19e07ae3 add --vips-config flag
so "vips --vips-config" now displays:

```
$ vips --vips-config
native win32: no, native OS X: no, open files in binary mode: no, ...
```
2020-06-12 17:30:57 +01:00
John Cupitt
d5fcb6baaf
Merge branch 'master' into libspng-experiment 2020-06-12 12:42:11 +01:00
John Cupitt
4ae4be7046 note resize work in ChangeLog 2020-06-12 12:40:44 +01:00
John Cupitt
61628eefdf final fixes for spng loader 2020-06-11 13:24:27 +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
a44814018d Merge branch 'master' into libspng-experiment 2020-06-07 11:56:16 +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
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
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
df4f03863e Merge branch 'master' into libspng-experiment 2020-05-13 14:37:00 +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
29d9fcb0c8 update docs for --delete deprecation
see https://github.com/libvips/libvips/pull/1564
2020-05-03 16:10:59 +01:00
John Cupitt
02327b6214 add an experimental libspng reader
it compiles, but I've not tried running it yet heh
2020-05-01 16:05:48 +01:00
John Cupitt
489810989e Merge branch '8.9' 2020-04-24 19:32:40 +01:00
John Cupitt
efd62acccd better iiif tile naming
We were clipping edge tiles against the size of the scaled up layer.
Instead, clip against the size of the top level image.

See https://github.com/libvips/libvips/issues/1621
2020-04-24 19:29:35 +01:00
John Cupitt
fada5f2a44 Merge branch '8.9' 2020-04-21 10:17:57 +01:00
John Cupitt
6f0548dc5c thumbnail could fail on HEIC in some modes
in locked UP or DOWN mode, vips_thumbnail() could incorrectly select the
thumbnail from a HEIC image even when it was not large enough to
generate the output image.

Thanks ZorinArsenij

See https://github.com/libvips/libvips/issues/1614
2020-04-21 10:15:02 +01:00
John Cupitt
681271e7b1 Merge branch '8.9' 2020-04-18 12:10:29 +01:00
John Cupitt
0897a77515 update changelog 2020-04-18 11:41:43 +01:00
John Cupitt
86bfadd101 better handling of unaligned tiff tile reads
We were not checking for alignment correctly in multi-page tiff reads.

Thanks petoor.

See: https://github.com/libvips/pyvips/issues/172
2020-04-11 14:36:44 +01:00
John Cupitt
471ec9bcc0 fix flood fill on some complex shapes
could fail to paint everything sometimes
2020-04-05 12:33:55 +01:00
John Cupitt
834234c23c add all smartcrop mode
So you can crop to fill as well as crop to fit.

see https://github.com/libvips/libvips/issues/1583
2020-03-19 18:57:40 +00:00
John Cupitt
3b57e13452 move heifsave to new target API
and add heifsave_target
2020-03-15 18:17:08 +00:00
John Cupitt
0badb7c603 add heifload_source 2020-03-15 11:45:56 +00:00
John Cupitt
764b196d50 move pdfload on top of source API
and add pdfload_source

see https://github.com/libvips/libvips/issues/1541
2020-03-11 18:15:15 +00:00
John Cupitt
03399b4d7e tiff write sets page number
tiffsave sets `PAGENUMBER` and `FILETYPE_PAGE`, thanks jclavoie-jive

see https://github.com/libvips/libvips/issues/1565
2020-03-08 11:06:19 +00:00
John Cupitt
a592d99bb2 add dir detector
useful for blocking open for read of directories
2020-03-06 18:05:16 +00:00
John Cupitt
68f766b482 Merge branch '8.9' 2020-03-05 15:03:00 +00:00
John Cupitt
b3a7929247 detect read errors in sniff correctly
we has a signed/unsigned mixup :(
2020-03-05 15:02:16 +00:00
John Cupitt
7d3a7e9c29 Merge branch '8.9' 2020-02-28 15:23:31 +00:00
John Cupitt
ab5d511123 add fuzz corpus 2020-02-28 15:22:10 +00:00
John Cupitt
1a0e61510b rewrite matrixsave
uses new target API
2020-02-22 17:55:04 +00:00
John Cupitt
ce240b1ca2 revise matrixload for source API 2020-02-22 15:02:12 +00:00
John Cupitt
d68e02a3c4 Merge branch 'revise-csvload' 2020-02-21 18:23:13 +00:00
John Cupitt
bab3486aca fix lines param to csvload
we had lines and skip mixed up
2020-02-21 18:22:39 +00:00
John Cupitt
0a23bf3578 revise formatting, add docs
fix up some formatting from https://github.com/libvips/libvips/pull/1552

plus some other small changes
2020-02-18 17:37:56 +00:00
John Cupitt
d8ee83e35e Merge branch 'master' of https://github.com/wix-playground/libvips into wix-playground-master 2020-02-07 16:30:26 +00:00
alon-ne
f88dab9ccd
Fix gif dispose handling for DISPOSE_BACKGROUND and DISPOSE_PREVIOUS
- Add 'scratch' field to gif that holds temporary 'scratch buffer' used for rendering frames
- For DISPOSE_BACKGROUND: Set background color to transparent instead of 0
- For DISPOSE_BACKGROUND: Write background pixels into scratch after rendering current frame, so it will be used in next frame
- For DISPOSE_PREVIOUS: Save frames that are not disposed into 'previous' field in gif, when DISPOSE_PREVIOUS is specified start with that previous frame. see http://webreference.com/content/studio/disposal.html
- Add "ANIMEXTS1.0" to Application Extension parser
- Graphic Control Extension parser refactor
- Compare file contents to expected images for animated gifs in foreign tests
2020-02-06 17:36:13 +02:00
John Cupitt
862e1ae214 add VIPS_LEAK env var 2020-02-03 17:01:57 +00:00
John Cupitt
559ae542ac revise flags for vipsthumbnail
The --rotate flag no longer did anything, so add a new --no-rotate flag
connected to the new no-rotate property. --rotate is still there, but
hidden and does nothing.

-o was much easier to remember than -f, so flip back to -o. -f still
works, but is a hidden synonym.

--iprofile, --eprofile were hard to remember. Add --import-profile and
--export-profile synonyms. iprofile / eprofile are still there and still
work, but are hidden.
2020-02-03 14:49:21 +00:00
John Cupitt
05a45c3418 Merge branch '8.9' 2020-02-02 11:15:09 +00:00
John Cupitt
bb20556b6d ban ppm max_value < 0
Not allowed by spec, since pixels should be unsigned.
2020-02-02 11:13:41 +00:00
John Cupitt
46da95f30f Merge branch '8.9' 2020-01-31 16:00:22 +00:00
John Cupitt
8a21f6ea52 fix gif rendering for "waterfall.gif"
This GIF has dispose set to DISPOSAL_UNSPECIFIED and seems to mean
transparent.

This patch makes gifload use DISPOSAL_UNSPECIFIED as well as _DO_NOT to
mean reuse previous frame.

Thanks DarthSim.

See https://github.com/libvips/libvips/issues/1543
2020-01-31 15:51:44 +00:00
John Cupitt
e4db74746a fix a deadlock with --vips-leak
We were usingh a global lock for metadata changes, but some functions
triggered from callbacks in the metadata hash table could also attempt
to acquire the same mutex, leading to deadlock.

This patch gives metadata change it's own lock. Thanks DarthSim.

See https://github.com/libvips/libvips/issues/1542
2020-01-31 15:25:05 +00:00
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