Commit Graph

1683 Commits

Author SHA1 Message Date
Kleis Auke Wolthuizen 2eeeedc957 Avoid seeking on bad file descriptors 2020-12-22 11:20:03 +01:00
Kleis Auke Wolthuizen cc8f93a3ff Ensure memory source is non-null 2020-12-22 11:19:52 +01:00
John Cupitt 5f3482bff5 Merge branch '8.10' 2020-12-03 13:58:33 +00:00
John Cupitt f99da5f3e1 docs clarification
https://github.com/libvips/libvips/issues/1912
2020-12-01 18:33:40 +00:00
John Cupitt c088097b50 block deprecation warnings from libgsf
with an uglu gcc progma
2020-11-29 14:41:19 +00:00
John Cupitt deab095b3c Merge branch '8.10' 2020-11-29 14:03:22 +00:00
John Cupitt 2585565b3e better test for output to target
We used to enable write to stdout if the first character of an output filename
was ".", eg.:

	vips copy x.jpg .png

But this will also enable write to stdout for things like:

	vips copy x.jpg ./y.png

This patch also tests that the rightmost "." in a filename is also the
first character.

Thanks barryspearce

See https://github.com/libvips/libvips/issues/1906
2020-11-29 13:59:30 +00:00
John Cupitt 864075c4f4 Merge branch '8.10' 2020-11-26 10:18:27 +00:00
John Cupitt acc579cc9d force binary mode for connections on win
stdin / stdout (for example) are created in text mode by default on
win. We need to flip them to binary mode for connection read and write.

See https://stackoverflow.com/questions/65014352/pipe-libvips-cli-output-to-stdout-in-windows
2020-11-26 10:15:48 +00:00
John Cupitt f6d7af46b8 Merge branch '8.10' 2020-11-24 11:15:45 +00:00
Kleis Auke Wolthuizen 77de1c473a Determine endianness at compile time 2020-11-23 14:39:06 +01:00
Kleis Auke Wolthuizen d9dec2c027 Simplify MSB-ordered image check 2020-11-23 14:35:03 +01:00
Kleis Auke Wolthuizen 9bb86119e3 Ensure vipsload only byte swaps if necessary
Prior to this commit, MSB-ordered vips images were always byte swapped
on both little- and big endian systems. And LSB-ordered vips images
were loaded without a byte swap. This works correctly on little endian
systems, but will not work on big endian systems where the byte swap
must be done vice versa.

This commit ensures that the byte swap only takes place when needed.

See https://github.com/libvips/libvips/issues/1847.
2020-11-23 14:32:36 +01:00
John Cupitt 013e8beba7 Merge branch '8.10' 2020-11-11 10:06:22 +00:00
John Cupitt 6894159ad5 fix icc-profiles and dzsave --no-strip
We were not copying metadata down pyramid layers in dzsave, so
--no-strip didn't allow icc profiles on tiles.

Thanks altert

See https://github.com/libvips/libvips/issues/1879
2020-11-11 10:02:46 +00:00
John Cupitt 3e40f19efc Merge branch '8.10' 2020-11-10 11:07:41 +00:00
John Cupitt 1686725117 block annoying INFO messages on some older glibs
Some old glibs can display INFO messages by default. Block these
ourselves.

See https://github.com/libvips/libvips/issues/1876
2020-11-10 11:03:18 +00:00
John Cupitt 774b7fcf6f Merge branch '8.10' 2020-10-19 14:41:51 +01:00
John Cupitt 0131d4d3eb fix vips7 webp load
webp load using the vips7 interface was crashing, thanks barryspearce

see https://github.com/libvips/libvips/issues/1860
2020-10-19 14:34:02 +01:00
John Cupitt 74d399088a Merge branch '8.10' 2020-10-04 14:26:40 +01:00
John Cupitt edbe9bf8ef revise pipe sources (again)
Simplify and cleanup.
2020-10-04 14:05:53 +01:00
John Cupitt 727eb2ee39 Merge branch '8.10' 2020-10-03 18:29:23 +01:00
John Cupitt 0ee8b1e844 improve seek on pipes
There were a few issues in VipsSource around seeking on pipes. With this
patch, EOF detection is better, and pipe sources automatically turn into memory
sources when EOF is hit.

see https://github.com/libvips/libvips/issues/1829
2020-10-03 18:25:24 +01:00
John Cupitt c27c471e28 Merge branch '8.10' 2020-09-28 12:33:32 +01:00
John Cupitt e3181e0579 get docs building with goi 1.66+
It builds now, but some doc sections are missing. Fix this properly in
8.11.

See https://github.com/libvips/libvips/issues/1836
2020-09-28 12:32:06 +01:00
John Cupitt fd0a0905ff note VImage::new_from_memory_steal() in ChangeLog
plus doxy commnets etc., see https://github.com/libvips/libvips/pull/1758/
2020-09-24 10:44:49 +01:00
John Cupitt 25bd6cce6f
Merge branch 'master' into master 2020-09-24 10:31:01 +01:00
John Cupitt 801111a2fa better dint rules
We had some special cases coded for dhint inheritance, but they could
fail in some edge cases. Revert to something simpler and more
predictable.

see https://github.com/libvips/libvips/issues/1810
2020-09-08 13:50:14 +01:00
John Cupitt 99423649b9 start sinkscreen thread on first use
we were starting the sinkscreen background thread during vips_init() --
instead, start it on first use

see https://github.com/libvips/libvips/issues/1792
2020-08-28 17:46:23 +01:00
Kyle Schwarz b372fde637 Add parameter name for unused image 2020-08-02 11:04:10 -04:00
Kyle Schwarz 292dc9da4b Remove redundant part of comment 2020-08-02 10:20:44 -04:00
Kyle Schwarz 81920963b1 Remove cast in free() call 2020-08-02 10:19:47 -04:00
Kyle Schwarz fe815ff587 Add C++ bindings for new_from_memory_steal()
new_from_memory_steal() will create a new image with the input
buffer and will "move" the data into the image. The buffer is then
managed by the image, and will be freed when it goes out of scope.
2020-08-01 21:58:14 -04:00
John Cupitt 58b6d73a70 deprecate vips_popen()
it didn't work well on win, and we no longer use it anyway
2020-07-27 15:21:59 +01:00
John Cupitt e44b781971 revise gifnsload.c for source API 2020-07-07 15:50:44 +01:00
Kleis Auke Wolthuizen b84e87b6d2 Improve --vips-config output 2020-07-07 13:57:25 +02:00
Kleis Auke Wolthuizen e91997052b Out-of-source support for autogen.sh 2020-07-07 12:16:43 +02:00
Kleis Auke Wolthuizen fb61f0fa44 Define ENABLE_DEPRECATED in config.h
Do not check for VIPS_ENABLE_DEPRECATED as it could
come from an earlier version of libvips.
2020-07-07 12:16:43 +02:00
John Cupitt 5117c1a980 remove mode_t from headers
it seems to fail with MSVC.

int works fine, and is what g_open() uses.
2020-07-04 18:28:44 +01:00
John Cupitt d6c4d23d6c Merge branch 'master' into add-libnsgif 2020-07-03 02:24:09 +01:00
John Cupitt e728e5638d
Merge pull request #1697 from kleisauke/wasm-function-pointers
Support for use in WASM environments (#192)
2020-07-03 02:09:39 +01:00
John Cupitt 207d40f640 better leak test output 2020-07-02 14:15:58 +01:00
Kleis Auke Wolthuizen 9246094033 Fix function pointer cast issues
It is undefined behavior in C and C++ to cast a function pointer
to another type and call it that way. This does work in most native
platforms, however, despite it being UB, but in WASM it can fail.

See:
https://emscripten.org/docs/porting/guidelines/function_pointer_issues.html
2020-06-30 13:35:41 +02:00
John Cupitt 345fee4917 Merge branch 'master' into add-libnsgif 2020-06-29 23:07:13 +01:00
John Cupitt e3a500204a
Merge pull request #1593 from kleisauke/disable-deprecated
Fix for --disable-deprecated (#1273)
2020-06-28 11:07:56 +01:00
John Cupitt aba15122d5 reduce default cache size
Now 100 operations by default.
2020-06-28 09:52:58 +01:00
Kleis Auke Wolthuizen 8abcae3abc Avoid using vips7 symbols 2020-06-18 14:21:43 +02:00
Kleis Auke Wolthuizen 230d2acfea Disable IM_* environment variables when --disable-deprecated 2020-06-18 14:15:37 +02: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 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 383be359e8
Merge pull request #1626 from kleisauke/remove-varargs-open
Remove use of varargs in vips_*_open
2020-04-30 14:02:37 +01:00
Kleis Auke Wolthuizen cdf0269871 Ensure vips__temp_name creates unique filenames
There was a possible chance that vips__temp_name could generate the
same filename twice if it is called concurrently.

This commit ensures that the serial increment is an atomic operation,
similar to #1211.
2020-04-27 15:27:33 +02:00
Kleis Auke Wolthuizen 6fc2015783 Remove use of varargs in vips_*_open
This matches the declaration of g_open and helps tools (such as ASan) when
running on non-native platforms.
2020-04-27 11:56:32 +02:00
John Cupitt 9ea91810bb revise docs for _inplace
We call vips_image_inplace() automatically now, so there's no need for
clients to use this.

see https://github.com/libvips/libvips/issues/1610
2020-04-16 12:09:07 +01:00
John Cupitt 168db157bf more dbg output 2020-04-15 17:21:41 +01:00
John Cupitt 8ba31844d6 fix a race in startup
We were creating a background thread before creating the semaphore that held
the thread. This could sometimes segv under a debugger.
2020-04-15 16:53:58 +01:00
John Cupitt 8840bc8a14 better render init stops a race
when running inside some versions of gdb
2020-04-02 14:23:06 +01:00
Lovell Fuller 3ca21ee2e8 Increase minimum glib-2.0 dependency to v2.15 (released March 2012) 2020-03-26 19:13:21 +00:00
John Cupitt e9c47200dc
Merge pull request #1591 from kleisauke/get-language-names
Only call g_get_language_names when GLib < 2.48.1
2020-03-24 17:05:49 +00:00
Kleis Auke Wolthuizen ceacd0bab9 s/count/af_count/
Thanks lovell!
2020-03-24 12:55:07 +01:00
Kleis Auke Wolthuizen 4911928412 Only call g_get_language_names when GLib < 2.48.1
The thread-safety problem was fixed in GLib 2.48.1.

See: https://bugzilla.gnome.org/show_bug.cgi?id=748474
2020-03-24 11:14:47 +01:00
Kleis Auke Wolthuizen af21838fab Use g_get_num_processors() when GLib >= 2.48.1
Also backport the patch from https://bugzilla.gnome.org/show_bug.cgi?id=748530
2020-03-24 11:11:46 +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 d4f12a9999 move VipsGInputStream to public API
Since we will need it for pdfload as well.
2020-03-11 17:17:45 +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 d13c0a69fd Merge branch 'master' of github.com:libvips/libvips 2020-03-06 13:05:38 +00:00
John Cupitt 6117310c18 improve file open error handling
better behaviour if you try to open a directory as an image
2020-03-05 15:30:37 +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 9ef8b55218 better handling of short files in vips7 compat
the sniffer could read beyond the end of the file sometimes
2020-03-04 17:38:41 +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 71c15958ed new csvload seems to work 2020-02-21 16:04:29 +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
elad laufer d2b794ec35 - use a single enum and switch that replaces no_subsample, force_subsample 2020-02-17 11:29:57 +02: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 46da95f30f Merge branch '8.9' 2020-01-31 16:00:22 +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 4aeedd9711 add "nearest" region shrink 2020-01-30 16:53:18 +00:00
John Cupitt 165a3a3855 Merge branch '8.9' 2020-01-28 13:36:46 +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 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 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 b2334d8d62 Merge branch 'rename-stream' 2020-01-01 12:06:22 +00:00
Denis Fondras 837ca2e044
Fix crash on backward memcpy()
In some environment, building fails because of backward memcpy().
2019-12-30 18:29:36 +01:00
John Cupitt 3847f71c54 rename bufis as well 2019-12-30 16:57:19 +00:00
John Cupitt 96cdc5ef01 revise docs for source / target 2019-12-30 16:28:39 +00:00
John Cupitt 63d54e5df2 final code cleanups after stream -> source rename 2019-12-30 14:23:51 +00:00
John Cupitt 119dd2cb72 pytest passes again after stream -> source/target 2019-12-29 23:08:33 +00:00
John Cupitt 4c5873809f experiment with renaming stream
rename as VipsConnection, VipsSource, VipsTarget etc.

see https://github.com/libvips/libvips/issues/1494#issuecomment-569498619

renamed with this script:

```

set -e

edit() {
        sed -i -E "$1" rename
}

for i in $*; do
        cp $i rename

        edit s/VIPS_STREAMOU/VIPS_TARGET_CUSTOM/g
        edit s/VIPS_STREAMO/VIPS_TARGET/g
        edit s/VIPS_STREAMIU/VIPS_SOURCE_CUSTOM/g
        edit s/VIPS_STREAMI/VIPS_SOURCE/g
        edit s/VIPS_STREAM/VIPS_CONNECTION/g

        edit s/vips_streamou/vips_target_custom/g
        edit s/vips_streamo/vips_target/g
        edit s/vips_streamiu/vips_source_custom/g
        edit s/vips_streami/vips_source/g
        edit s/vips_stream/vips_connection/g

        edit s/VipsStreamou/VipsTargetCustom/g
        edit s/VipsStreamo/VipsTarget/g
        edit s/VipsStreamiu/VipsSourceCustom/g
        edit s/VipsStreami/VipsSource/g
        edit s/VipsStream/VipsConnection/g

        # eg. VIPS_TYPE_STREAM or VIPS_IS_STREAM
        edit "s/VIPS_([A-Z]+)_STREAMOU/VIPS_\1_TARGET_CUSTOM/g"
        edit "s/VIPS_([A-Z]+)_STREAMO/VIPS_\1_TARGET/g"
        edit "s/VIPS_([A-Z]+)_STREAMIU/VIPS_\1_SOURCE_CUSTOM/g"
        edit "s/VIPS_([A-Z]+)_STREAMI/VIPS_\1_SOURCE/g"
        edit "s/VIPS_([A-Z]+)_STREAM/VIPS_\1_CONNECTION/g"

        edit s/streamou/target_custom/g
        edit s/streamo/target/g
        edit s/streamiu/source_custom/g
        edit s/streami/source/g

        # various identifiers which also change
        edit s/is_a_stream/is_a_source/g
        edit s/find_load_stream/find_load_source/g
        edit s/find_save_stream/find_save_target/g
        edit s/new_from_stream/new_from_source/g
        edit s/write_to_stream/write_to_target/g
        edit s/vips_thumbnail_stream/vips_thumbnail_source/g

        # eg. vips_webpload_stream
        edit "s/vips_([a-z]+)load_stream/vips_\1load_source/g"

        # eg. vips_webpsave_stream
        edit "s/vips_([a-z]+)save_stream/vips_\1save_target/g"

        mv rename $i
done
```
2019-12-29 21:40:21 +00:00
John Cupitt c65e399c48 win32 patches
see https://github.com/libvips/libvips/issues/1494#issuecomment-569495472
2019-12-29 12:19:58 +00:00
John Cupitt 9c6bfc7462 better error handling in vips__seek
Now that we are using the poxis API on win32, we don't need to check
GetLastError()
2019-12-28 12:54:44 +00:00
John Cupitt 32d3ba2a50 fix vips__ftruncate
We'd forgotton to update this for the new vips__seek return.

See https://github.com/libvips/libvips/issues/1494#issuecomment-569413267
2019-12-28 12:47:50 +00:00
John Cupitt d89df1661a revise doc comments in bufis 2019-12-26 12:25:19 +00:00
John Cupitt e43cba116a swap recursion for iteration in skip_whitespace
and avoid a stack overflow, see

https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=19701
2019-12-26 11:22:33 +00:00
John Cupitt 0c217efdf3 fix compiler warning 2019-12-22 15:04:07 +00:00
John Cupitt 0429a0080e swap ssize_t for gint64 where possible
Some versions of the Windows headers define ssize_t as unsigned. This
patch removes (where possible) use of ssize_t inside libvips, esp. in
the new stream API.

See https://github.com/libvips/libvips/issues/1494#issuecomment-568254731
2019-12-22 13:45:45 +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 b964deb482 fix SANITY checks in streami.c
they had bitrotted a bit
2019-12-21 14:12:59 +00:00
John Cupitt 8030d7b926 fix map of custom seekable streams
We failed for seekable custom streams.

See https://github.com/libvips/libvips/issues/1494#issuecomment-567190830
2019-12-20 12:44:56 +00:00
John Cupitt 53dac98b55 larger seq cache
Make the seq cache 50% larger to allow for rounding with some image
widths, tile sizes and thread numbers.

See https://github.com/libvips/libvips/issues/1494#issuecomment-567190830
2019-12-19 15:26:10 +00:00
John Cupitt 4616cf1f5c small changes to the gif-loop fix
see https://github.com/libvips/libvips/pull/1362
2019-12-18 18:09:30 +00:00
John Cupitt 7906c128cd better error messages on save
The stream savers were polluting the error log.
2019-12-18 17:50:19 +00:00
John Cupitt c0c07ea003 fix invalidate tagging
The new tagging system was unreffing the wrong operation.

See https://github.com/libvips/libvips/issues/1494#issuecomment-565200939
2019-12-18 14:32:30 +00:00
John Cupitt 1fd3b478e1 always check memory area length
vips_image_new_from_memory() allowed you to use length == 0 to mean
"don't check memory length". This was part of some very old vips7
compatibility.

The ppm loader could pass length == 0 if header size was equal to file
size, bypassing the length check.
2019-12-14 05:13:44 +00:00
John Cupitt e236f19f97 add fallbacks to new_from_stream
If the stream-based loaders fail, vips_image_new_from_stream() now falls
back to the old file and buffer loaders.

The file and buffer loaders already try the stream loaders first.
2019-12-10 17:19:12 +00:00
John Cupitt 56090c6fa7 fix another compiler warning 2019-12-08 14:16:52 +00:00
John Cupitt dd4b2e9c23 fix some clang warnings 2019-12-08 13:08:38 +00:00
John Cupitt d10c870a32 fix for no seek handler defined
We need to use the emitv signal emit function to be able to set a default value.
2019-12-06 16:58:01 +00:00
John Cupitt a50405c1f7 fix some run-time errors from clang
Travis is now running with some amount of run-time checking enabled and
it spotted a couple of harmless things.
2019-12-05 14:14:27 +00:00
John Cupitt a382359e65 don't test features in unminimise
This was circular: test features needed an unminimised stream, but
unminimise used to test features.
2019-12-05 10:35:15 +00:00
John Cupitt 4dbbc2d415 more dbg code 2019-12-04 17:40:49 +00:00
John Cupitt ec7aa1d6b6 delay testing stream properties until we have to
This makes stream object creation simpler: you don't need to have
everything set up before build occurs, so you can attach signal handlers
for read and seek later.
2019-12-04 16:46:00 +00:00
John Cupitt ae7aaea077 doc polish 2019-12-01 15:29:28 +00:00
John Cupitt 43fff7b10d fix map of input streams
The logic was a bit wonky. Thanks Kleis.

See https://github.com/kleisauke/net-vips/issues/33#issuecomment-559971456
2019-11-30 19:13:26 +00:00
John Cupitt 163b0165d7
Merge pull request #1483 from libvips/check-metadata-changes
block metadata changes on shared images
2019-11-30 17:37:20 +00:00
John Cupitt d88ce970b7 make operation cache invalidation advisory
This patch makes operation cache invalidate advisory rather than
immediate. Operations set a mark on cache entries meaning "this entry is
no longer valid", then the entry is removed next time the operation
is looked up.

This breaks the loop (now the cache can remove operations, but operations
can't remove cache entries), so it should be safer (I think). Everything
is inside a mutex, at least.

see https://github.com/libvips/libvips/issues/1484
2019-11-28 17:41:35 +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 20cee5d041 block metadata changes on shared images
If images are shared (ref count > 1), block changes to the set of
metadata items on the image. These can cause crashes in highly threaded
programs.

See https://github.com/lovell/sharp/issues/1986
2019-11-28 09:59:30 +00:00
John Cupitt 1a2a4a41f1 remove dbg code now travis is fixed 2019-11-27 22:20:33 +00:00
John Cupitt 5d25e2d850 more travis tweaks 2019-11-27 20:27:40 +00:00
John Cupitt 9f6ea7b799 more dbg code to help travis 2019-11-27 20:09:04 +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 14859f9862 polish comments 2019-11-25 20:50:27 +00:00
John Cupitt 3d770f8ec9 add a little more debugging 2019-11-24 06:46:08 +00:00
John Cupitt 562da3e5ab rename new_from_filename as new_from_file
So VipsStreami matches VipsImage. Same for new_to_filename.
2019-11-22 17:13:20 +00:00
John Cupitt 91b0703921 add VipsStreamou
An output stream subclass you can easily connect to other destinations.
2019-11-21 17:54:10 +00:00
John Cupitt 6423721951 set defaut values for streamiu signals
In case no user signals are attached. Remove some dbg code.
2019-11-21 16:32:36 +00:00
John Cupitt 857aafc8c2 add VipsStreamiu
a streami subclass (u for user?) with actions signals you can connect to
to provide implementations of read and seek
2019-11-21 16:22:43 +00:00
John Cupitt 73985463fd more dbuf->streamo conversion 2019-11-19 13:20:05 +00:00
John Cupitt a129cef9dd add streamo_steal
and start converting some old dbuf code
2019-11-19 06:47:24 +00:00
John Cupitt 73dd7eebe5 move streamiw inside svgload
since that's the only place it is used
2019-11-18 15:07:37 +00:00
John Cupitt 09325600ee rename VipsStreamib as VipsBufis
The VipsStreamib (stream input buffered) was misleading -- it was
implemented on top of VipsStreami, but was not a subclass.

Rename as VipsBufis (buffered input stream). It's a silly name, but
easy to remember and reflects the purpose better,
2019-11-18 13:09:04 +00:00
John Cupitt 9a3842919a add mmap ppm input 2019-11-15 15:56:28 +00:00
John Cupitt 5f4b995551 make ppm load sequential
it used to load the entire image, or mmap it
2019-11-15 15:15:25 +00:00
John Cupitt 17b994419b move ppm save into the class
no separate save function now
2019-11-15 10:23:45 +00:00
John Cupitt c1a027c8d7 ppm load uses streams 2019-11-14 12:57:39 +00:00
John Cupitt 3bbadc0198 revise streamo, ppm save uses it
streamo is simpler, and has a fast putc.
2019-11-13 17:50:02 +00:00
John Cupitt 7aec350f1c old load/save funcs now use stream API
new_from_file / new_from_buffer and write_to_file / write_to_buffer
use the stream API if they can.
2019-11-13 16:39:47 +00:00
John Cupitt 55024c71ce
Merge branch 'master' into add-stream-object 2019-11-12 14:08:02 +00:00
John Cupitt 3ba0b285d4 switch to GDateTime 2019-11-11 15:14:04 +00:00
John Cupitt f5a4f41edf rename VipsStream* variables
The convention is now:

	VipStreami *streami;

We had `input` in many places, a left-over from the old VipStreamInput
name.
2019-11-11 09:09:34 +00:00
John Cupitt 998b5eea45 fix svgload sniff
by adding vips_streami_sniff_at_most()
2019-11-11 07:53:36 +00:00
John Cupitt 441f61f3ff svgload from a stream 2019-11-10 17:23:28 +00:00
Kleis Auke Wolthuizen 41c08b0ffb Add svgload_stream to the descriptors test
Seems to work!
2019-11-10 12:32:18 +01:00
John Cupitt f499cefb0e add iiif layout to dzsave 2019-11-09 20:40:39 +00:00
Kleis Auke Wolthuizen 609fdb4fb6 WiP: Add svgload_stream
TODO: Should we `#ifdef HAVE_RSVG` the VipsStreamiw class?
2019-11-09 18:19:54 +01:00
John Cupitt ce4729c92b fix radload from pipe 2019-11-08 17:39:25 +00:00
John Cupitt 53f73881f7 rename streamo constructors
Was vips_streamo_new_from_filename(), renamed as
vips_streamo_new_to_filename(). Same for descriptor and memory.
2019-11-07 16:20:12 +00:00
John Cupitt 4cf8246312 remove some dbg code 2019-11-07 07:29:44 +00:00
John Cupitt 04280fd837 test for orc 0.4.31
the version that should start working again, hopefully
2019-11-06 23:22:17 +00:00
John Cupitt c383614c28 more cleaning up 2019-11-06 21:34:42 +00:00
John Cupitt ca5816a62c fix webp new from buffer 2019-11-06 20:37:23 +00:00
John Cupitt d992f09dfa fix webp from pipe 2019-11-06 18:23:28 +00:00
John Cupitt 3d344b4b5f add Kleis's patches
and add minimise support to radiance load
2019-11-06 17:04:13 +00:00
John Cupitt edca486f19 revise buffered input
rad load works now
2019-11-06 16:35:19 +00:00
John Cupitt de94a725aa fix up streamib a bit more
radiance load is almost working
2019-11-04 17:52:43 +00:00
John Cupitt 6d3b53174d reworking rad load 2019-11-04 10:21:31 +00:00
John Cupitt 35d661c307 make streamib a wrapper rather than a subclass
makes integration with the rest of foreign simpler
2019-11-02 16:50:59 +00:00
John Cupitt 37049af140 buffered input compiles 2019-11-01 23:24:48 +00:00
John Cupitt 805da46670 more buffered input tweaking 2019-11-01 12:57:48 +00:00
John Cupitt ca5d75f7ec start coding buffered input 2019-10-31 20:38:21 +00:00
John Cupitt 1ea58f6edb start adding buffered input 2019-10-30 17:34:04 +00:00
John Cupitt 855c420a9c add a sanity limit to pipes
so unbounded pipes can't fill memory
2019-10-30 03:25:29 +00:00
John Cupitt 7321927361 update to GDateTime 2019-10-29 20:31:43 +00:00
John Cupitt 23663e8a88 add formatted output streams
you can printf() to output streams, implemented radiance stream write as
a test
2019-10-29 17:43:51 +00:00
John Cupitt 40d679f299 fix lseek() wrapper error handling 2019-10-28 13:02:36 +00:00
John Cupitt ed6b26fcb1 paste in various fixes from Kleis 2019-10-28 08:51:47 +00:00
John Cupitt ba0100eb13 revise decode/unminimise use 2019-10-28 05:04:04 +00:00
John Cupitt cbbd4ae6dd seems to work!
just a bit more cleaning up needed ...
2019-10-27 18:19:43 +00:00
John Cupitt b7ad0da20c more reworking 2019-10-24 14:14:52 +01:00
John Cupitt 0e29e1c41e start reworking again 2019-10-24 10:57:52 +01:00
John Cupitt af8a3bfee7 fix stream buffer load 2019-10-23 18:47:57 +01:00
John Cupitt bdb5e39efa just the test suite now 2019-10-23 14:51:29 +01:00
John Cupitt a9a0dfee0f mostly works now
but

	cat k2.jpg | vips copy stdin x.jpg

still fails
2019-10-23 13:01:09 +01:00
John Cupitt e27d6448b1 fix debug build 2019-10-22 23:07:17 +01:00
John Cupitt 60ce52512c builds
now needs testing
2019-10-22 17:37:05 +01:00
John Cupitt ee3270f8e9 more refactoring 2019-10-22 11:08:54 +01:00
John Cupitt 72cbaa9ea3 more revision 2019-10-21 15:04:30 +01:00
John Cupitt d49e816641 start cleaning up 2019-10-21 10:57:20 +01:00
John Cupitt 4a311a5cdd Revert "start splitting up stream class"
This reverts commit 7756b8da71.
2019-10-18 18:00:23 +01:00
John Cupitt 7756b8da71 start splitting up stream class 2019-10-18 15:33:26 +01:00
John Cupitt f99f3d3f57 revise seek() behaviour
fuzz tests fail though ... we need to split StreamInput up
2019-10-17 17:18:45 +01:00
John Cupitt 696ff2b24a fix up jpeg load
and revise descriptor test
2019-10-17 13:16:12 +01:00
John Cupitt fb2ab23e26 start adding TIFF stream load
streams now have a seek() vfunc
2019-10-16 18:28:46 +01:00
John Cupitt 98410042ac add webpload stream
webp uses the new VipsStreamInput mmap interface
2019-10-15 15:46:37 +01:00
John Cupitt 5a788b89cf add mmap input sources
falls back to read() if no mmap
2019-10-15 14:04:47 +01:00
John Cupitt 28daeb1a8a start adding mmap input to stream 2019-10-15 10:09:24 +01:00
John Cupitt 88aa1bca86 polish png read 2019-10-15 08:33:48 +01:00
John Cupitt 1bdadeed61 add png stream load 2019-10-14 18:03:45 +01:00
John Cupitt f6d247627f incorporate revision comments from @kleisauke
Thanks!
2019-10-14 12:18:40 +01:00
John Cupitt 9ea5e902b6 test descriptor properties 2019-10-14 12:02:59 +01:00
John Cupitt c01c3b9100 add minimise support to VipsStreamInput 2019-10-14 10:46:17 +01:00