Commit Graph

6388 Commits

Author SHA1 Message Date
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
John Cupitt 7732bf9981
Merge pull request #1514 from fetlife/use-default-orientation-value-if-orientation-is-incorrect
Reset orientation if exif data is incorrect
2020-01-06 11:41:48 +00:00
Andrii Dmytrenko 9609f4f1d7 Check if orientation is less than 1 2020-01-06 11:30:27 +00:00
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