Commit Graph

6671 Commits

Author SHA1 Message Date
Andrii Dmytrenko
d0b69826cc Reset orientation if exif data is incorrect 2020-01-06 11:02:10 +00:00
John Cupitt
5ee0623182 revise doc comment for resample
We can now do high-quality reduce for any scale factor, though it'll be
slow for very large reductions.

Thanks homm, see https://github.com/libvips/pyvips/issues/148
2020-01-03 08:59:50 +00:00
John Cupitt
ecb22cdecc free png write on end of write, not image dispose
We were freeing the PNG write struct on image dispose, not at the end of
write.

Thanks homm. See https://github.com/libvips/pyvips/issues/147
2020-01-02 15:51:42 +00:00
John Cupitt
3b2c77dd35 free shrinkv resources earlier
Free the shrinkv line buffer and struct at the end of eval, not on image
dispose. This helps keep mem use down in some long-running operations.

Thank you homm, see https://github.com/libvips/pyvips/issues/147
2020-01-02 15:32:43 +00:00
John Cupitt
be3775e868 fix up i18n
POTFILES etc. needed updating for the recent class renames.
2020-01-01 18:24:13 +00:00
John Cupitt
b2334d8d62 Merge branch 'rename-stream' 2020-01-01 12:06:22 +00:00
Kleis Auke Wolthuizen
31bf0e3cb7 Update function list for stream -> source rename 2020-01-01 12:28:18 +01:00
John Cupitt
95444d0849 rename stuff in the C++ API for stream -> source 2019-12-30 17:49:41 +00:00
John Cupitt
4169e1a0fd
Merge pull request #1510 from ledeuns/patch-1
Fix crash on backward memcpy()
2019-12-30 17:40:55 +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
252996e3ff make check passes after stream -> source rename 2019-12-30 12:48:20 +00:00
John Cupitt
119dd2cb72 pytest passes again after stream -> source/target 2019-12-29 23:08:33 +00:00
John Cupitt
06b52da52a update ChangeLog for stream rename 2019-12-29 21:48:14 +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
664796acab relax text test render threshold
so we pass on win as well, see 981ffe752b (r36581177)
2019-12-26 14:11:15 +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
f2f2ab200d revise webpload for improved loader pattern 2019-12-24 13:49:53 +00:00
John Cupitt
5e35827a41 revise tiffload to match the new loader pattern
should be simpler and safer
2019-12-24 09:55:08 +00:00
John Cupitt
96079202ef rework jpegload class
to match the radload pattern
2019-12-24 09:21:22 +00:00
John Cupitt
561f410f0a rework pngload
To match the new radload pattern.
2019-12-24 07:55:06 +00:00
John Cupitt
548aa30414 remove stray debg code 2019-12-23 17:24:09 +00:00
John Cupitt
861f6d1ef4 radload was not setting priority correctly
We used to have separate subclasses for file, buffer and stream load,
but only set ->priority in one of them.

Rework radload as a base class plus a set of implementations.
2019-12-23 17:22:15 +00:00
John Cupitt
f43d6c4cf7 add note in test_desc about ppm loader
and why we can't test_destriptots on that
2019-12-23 14:58:22 +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
c84a43f277 fix memleak in vips_text()
We were not unreffing PangoLayout. Thank you uint128!

See https://github.com/libvips/libvips/issues/1508
2019-12-21 12:56:09 +00:00
John Cupitt
981ffe752b add test for text autofit 2019-12-21 05:38:39 +00:00
John Cupitt
1e2ca2e0bf fix refleak in webpsave_buffer
And add teardown to the test-suite so we can spot refleaks more easily.
2019-12-21 05:13:54 +00:00
John Cupitt
4b0c2924ab fix refleak in dzsave 2019-12-21 04:46:16 +00:00
John Cupitt
9d05251f7e revise formatting 2019-12-20 15:23:06 +00:00
John Cupitt
ff2b934244
Merge pull request #1504 from deftomat/webp-delay-fix
fix: do not try to use "undefined" delay during WEBP animation save
2019-12-20 15:21:01 +00:00
John Cupitt
76dd2d3910 fix profile removal
we had a possible shared image
2019-12-20 14:12:25 +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
501fc38130
Merge pull request #1362 from deftomat/master
fix: make gif-loop consistent between GIF and WEBP
2019-12-18 17:55:28 +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
e1baf66f19 "squash" to tiffsave now does lab as well
The "squash" option to tiffsave now also squashes 32-bit 3-band float
CIELAB images down to 8 bits.

See https://github.com/libvips/libvips/issues/1499
2019-12-18 17:29:34 +00:00
John Cupitt
6c038f5ca8 add a test for tuncated image files 2019-12-18 14:48:59 +00:00
John Cupitt
6b02c22457 add a test with VIPS_STALL
stresses the caching and locality systems
2019-12-18 14:41:35 +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