Commit Graph

6423 Commits

Author SHA1 Message Date
elad laufer c626c9de14 add force subsample argument that overrides the Q deduced subsampling directive 2020-02-16 18:37:32 +02:00
Elad Laufer 71e9071769
Merge pull request #3 from libvips/master
Merge master
2020-02-16 13:37:29 +02:00
John Cupitt 54ff9dabf7 trim README a little 2020-02-11 15:20:12 +00:00
John Cupitt 3ad3c30ab4 better handling of GIFs with out of bounds frames
The recent reworking of gifload did not check for out of bounds frames
before setting DISPOSE_BACKGROUND.
2020-02-10 17:34:45 +00:00
Elad Laufer 2b6cc4229e Merge pull request #2 from libvips/master
Merge from main
2020-02-10 11:59:40 +02:00
John Cupitt 3285ef152a
Merge pull request #1550 from libvips/wix-playground-master
revise gifload to improve dispose handling
2020-02-09 14:39:48 +00:00
John Cupitt 9e6df7e0a6 revise png comments 2020-02-07 17:53:42 +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 f866799474 move pipe read limit to gint64
We had a mix of size_t and gint64. Just use gint64 everywhere.
2020-02-05 14:42:03 +00:00
John Cupitt 862e1ae214 add VIPS_LEAK env var 2020-02-03 17:01:57 +00:00
John Cupitt cf5cad2b3e make pipe read limit configurable
We had a 1gb limit on the amount of data we would read from a pipe
before giving up.

This patch adds vips_pipe_read_limit_set() and makes this limit
configurable.

See: https://github.com/libvips/libvips/issues/1540
2020-02-03 16:57:10 +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 63b755e73e fix pytest 2020-01-30 21:46:31 +00:00
John Cupitt e60030b6e8 start reworking gifload for VipsSource 2020-01-30 17:21:10 +00:00
John Cupitt 4aeedd9711 add "nearest" region shrink 2020-01-30 16:53:18 +00:00
John Cupitt 979422886b revise tiff load/save doc comments 2020-01-29 18:26:16 +00:00
John Cupitt 81fa983121 oop, dropped an "else" 2020-01-29 18:12:37 +00:00
John Cupitt a158b15b97 add LOGLUV TIFF support
libvips XYZ images load and save as libtiff LOGLUV

see https://github.com/libvips/libvips/issues/1506
2020-01-29 17:47:08 +00:00
John Cupitt 2e3eca7e29 another missing copy operation
The --page-height arg to savers needs a copy as well.
2020-01-29 15:44:55 +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 eebc6e5636 remove some dead code 2020-01-21 08:27:17 +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 6605029bc3 revise svg detection
We weren't checking svgz files as far in.
2020-01-15 09:01:38 +00:00
John Cupitt a762601564 revise jpegsave auto no-chroma
IM actually uses Q >= 90, not > 90, to disable chroma subsampling.
Adjust libvips to match.

Thanks @csnover
2020-01-15 08:32:08 +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 70e8c6a61f revise vipsthumbnail tutorial
Some of the args have changed slightly.
2020-01-14 17:10:31 +00:00
John Cupitt 285f6c7418 add casts for tiff seek
To make our meaning clearer.

libtiff uses uint64 for toff_t, with -1 cast to uint64 for an error
indication, see:

https://gitlab.com/libtiff/libtiff/blob/master/libtiff/tif_unix.c#L123

See also:

https://github.com/kleisauke/net-vips/issues/53
2020-01-14 14:50:46 +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 2e9d89b6d4 enable connection tests now pyvips is updated
pyvips should now support connections, so always enable the tests
2020-01-12 14:15:23 +00:00
John Cupitt 3862b636e4 remove some dbg code
accidentally left in, thanks Kleis
2020-01-10 05:03:48 +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 1338def535 fix some autorot issues
and a problem with vipsthumbnail of tif

see https://github.com/libvips/libvips/issues/1515
2020-01-07 09:00:14 +00:00
John Cupitt 5b09845bd5 don't set page-height in thumbnail unless we must
We were always setting page-height in thumbnail, even on single-frame
images. This could cause problems if the image height was later
increased by a factor of the height -- non-animated images could
accidentally turn into animated images.

https://github.com/libvips/libvips/issues/1469
2020-01-06 17:04:01 +00:00
John Cupitt 0cdf00a9ba remove stray declaration of vips_mapimage()
We declared vips_mapimage() in histogram.h. This became
vips_case() later in development, but this old decl was left behind in
error.

Thanks @remicollet

See https://github.com/libvips/libvips/issues/1513
2020-01-06 15:06:33 +00:00
John Cupitt c583e5ebc9 missing copy in autorot
autorot was missing a copy, causing a warning about metadata removal in
a shared image.

Thanks chregu

See https://github.com/libvips/libvips/issues/1515
2020-01-06 14:22:58 +00:00