Commit Graph

6401 Commits

Author SHA1 Message Date
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
0897a77515 update changelog 2020-04-18 11:41:43 +01:00
John Cupitt
f24a4a273a fix regression in autorot
we were writing the wrong image to the output, thanks malomalo

see https://github.com/libvips/ruby-vips/issues/226
2020-04-18 11:40:43 +01: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
6a2fbbaed7 Revert "add more "const" decls"
This reverts commit 3dc2757330.
2020-03-05 13:40:07 +00:00
John Cupitt
3dc2757330 add more "const" decls 2020-03-05 13:09:28 +00:00
John Cupitt
ab5d511123 add fuzz corpus 2020-02-28 15:22:10 +00:00
John Cupitt
59669be592 remove some stray files 2020-02-28 14:51:21 +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
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
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
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