Commit Graph

408 Commits

Author SHA1 Message Date
John Cupitt
6d5a371147 add some tests for subifd pyramids
fix a problem with jpg-compressed tiffs too
2020-06-02 18:08:34 +01:00
elad laufer
c993a7ad2a - use jpeg in test target 2020-05-13 11:12:01 +03:00
Elad Laufer
b05cf39df8
Handle mirroring in autorot (#8)
* handle mirroring in autorot
* added tests for autorot
2020-05-12 13:01:48 +03:00
John Cupitt
c2094fcd7c relax thresh for jpegload
some lib jpegs have slightly different rounding behaviour
2020-04-24 19:26:17 +01:00
John Cupitt
b689235f57 missing include in test_connections
Thanks brcarp.

See https://github.com/libvips/libvips/issues/1571
2020-03-11 09:11:29 +00:00
elad laufer
8749871c71 - remove no_subsample from inner calls 2020-02-18 18:04:29 +02:00
elad laufer
22b3a0d161 - use enum string 2020-02-18 13:43:02 +02:00
elad laufer
838b5e7458 - add test case 2020-02-18 11:33:29 +02:00
elad laufer
65b1a3eac2 - add test case 2020-02-18 11:09:18 +02:00
elad laufer
494d8876eb - don't skimp on names 2020-02-17 17:15:43 +02:00
elad laufer
d2b794ec35 - use a single enum and switch that replaces no_subsample, force_subsample 2020-02-17 11:29:57 +02:00
elad laufer
c626c9de14 add force subsample argument that overrides the Q deduced subsampling directive 2020-02-16 18:37:32 +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
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
Andrii Dmytrenko
d0b69826cc Reset orientation if exif data is incorrect 2020-01-06 11:02:10 +00:00
Kleis Auke Wolthuizen
31bf0e3cb7 Update function list for stream -> source rename 2020-01-01 12:28:18 +01: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
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
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
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
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
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
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
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
ae7aaea077 doc polish 2019-12-01 15:29:28 +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
686829166d fix some more metadata updates
some more minor cases picked up by the test suite
2019-11-30 12:11:23 +00:00
Kleis Auke Wolthuizen
2499b38403 Update C++ binding and function list
The generators use the new Introspect class of pyvips.
2019-11-29 14:51:03 +01:00
John Cupitt
5c7a649001 fix test suite for metadata changes
added a few more .copy() calls
2019-11-28 15:59:09 +00:00
John Cupitt
1a2a4a41f1 remove dbg code now travis is fixed 2019-11-27 22:20:33 +00:00
John Cupitt
b08bfede5f try fixing the stream test on travis 2019-11-27 17:30:13 +00:00
John Cupitt
002b2a28e1 fix test suite
for the new jpg sample image
2019-11-27 11:48:50 +00:00
John Cupitt
48f675db45 update jpg name in variables.sh.in as well 2019-11-27 08:58:30 +00:00
John Cupitt
ec41c42a3a revise test_cli for new sample jpg 2019-11-26 09:14:40 +00:00
John Cupitt
d00573b26a remove utf-8 filename example
too tricky to make it work on both py27 and py37
2019-11-26 09:07:10 +00:00
John Cupitt
2eebcb0c07 update tests for streami renames 2019-11-25 18:39:50 +00:00
John Cupitt
99f535c57a add streams.c test
tests VipsStream*u, at a basic level at least.
2019-11-24 18:22:43 +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
55024c71ce
Merge branch 'master' into add-stream-object 2019-11-12 14:08:02 +00:00
John Cupitt
ceb2db513d Merge branch '8.8' 2019-11-11 18:05:57 +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
cefa82bacf bump version for pyvips stream test 2019-11-07 20:58:10 +00:00
John Cupitt
4804e5c299 add some basic stream tests
Only tests load and save to and from files and memory. We should test
pipes too.
2019-11-07 17:35:49 +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
cbbd4ae6dd seems to work!
just a bit more cleaning up needed ...
2019-10-27 18:19:43 +00:00
John Cupitt
c7582c79d2 remove lib wrapper from repo 2019-10-24 04:33:04 +01:00
John Cupitt
696ff2b24a fix up jpeg load
and revise descriptor test
2019-10-17 13:16:12 +01:00
John Cupitt
c01c3b9100 add minimise support to VipsStreamInput 2019-10-14 10:46:17 +01:00
John Cupitt
a8fd5602ea disable jpg descriptor test
since we don't have minimise support in stream yet
2019-10-12 17:39:10 +01:00
John Cupitt
a2d57180b1 jpg stream output passes tests 2019-10-12 13:11:22 +01:00
John Cupitt
6c1d7db31b remove old jpeg load stuff
it's just stream now

works on buffer, but seems to fail on

	vipsheader йцук.jpg

curiously
2019-10-11 09:43:12 +01:00
John Cupitt
3a2bebdffb jpegload_stream registers 2019-10-10 22:02:39 +01:00
John Cupitt
3510c515f2 oop deleted one png init too many 2019-10-07 13:30:19 +01:00
John Cupitt
fef3dae892 Revert "fix up png restart"
This reverts commit 120ba3289c.
2019-10-07 13:15:29 +01:00
John Cupitt
120ba3289c fix up png restart
hopefully ... we needed a png_init_io() as well
2019-10-07 12:11:45 +01:00
John Cupitt
2d374c3114 pngload supports restart after minimise
plus a test
2019-10-07 10:01:15 +01:00
John Cupitt
3eca1ff3ee heifload passes the new descriptor tests 2019-10-06 19:29:10 +01:00
John Cupitt
3f1eb2c7dd test pdfload in te new desc tester
and fix a couple of small issues
2019-10-06 18:27:40 +01:00
John Cupitt
09b4ce6d9b test gifload for fd leaks 2019-10-06 10:55:19 +01:00
John Cupitt
efcd31b498 add something to test the new restart system
do multiple renders from one seq iage, check fds are opened and closed
as expected

see https://github.com/libvips/libvips/issues/1370
2019-10-06 07:25:09 +01:00
John Cupitt
c1921b0ad1 add a test for file descriptors
verify new loader behaviour with minimise
2019-10-04 17:44:25 +01:00
John Cupitt
f2319da762 remove svg test from test_formats.sh
It was very unreliable -- the output of librsvg varies too much between
librsvg versions.

This is still tested by the Python test suite.
2019-09-17 16:26:23 +01:00
John Cupitt
1ee54bfa80 Merge branch '8.8' 2019-09-05 12:45:08 +01:00
John Cupitt
f80c7a1810 add tests for xres/yres in tiffsave 2019-09-05 12:39:56 +01:00
John Cupitt
81c92242d8 relax HEIC threshold
libheic versions change rounding behaviour
2019-08-21 17:42:25 +01:00
John Cupitt
8f28fa625e restore switch/case test
now that relational const is fixed up
2019-08-21 16:51:01 +01:00
John Cupitt
fd25f13a2d add a test for the fix 2019-08-21 16:47:13 +01:00
John Cupitt
0b3ece5b42 new constants code now passes all tests 2019-08-21 16:36:18 +01:00
John Cupitt
d70c431961 relax HEIC threshold
argh rounding with different lib versions
2019-08-19 16:44:32 +01:00
John Cupitt
2d0c21279a add tests 2019-08-19 16:27:44 +01:00
John Cupitt
cdee0feb93 Merge branch '8.8' 2019-08-09 10:12:55 +01:00
John Cupitt
d2d63f4ac4 revise profile_load
seems to work!
2019-08-08 13:23:28 +01:00
John Cupitt
def0e73449 Merge branch '8.8' 2019-08-07 20:29:37 +01:00
John Cupitt
675c150500 fix build with IM7 2019-08-07 20:29:19 +01:00
John Cupitt
7250b169d4 Merge branch '8.8' 2019-08-07 16:19:23 +01:00
John Cupitt
f36927e78d fix build against graphicsmagick
- add tests for more features missing in GM
- simplify the IM/GM configure tests
- revise the test suite to pass with GM and IM
2019-08-07 16:17:27 +01:00
Oscar Mira
e14a9b9221 add small images suitable for fuzzing 2019-08-06 12:29:34 +02:00
John Cupitt
9dc422cb21 relax testsuite for magicksave
it seems some magicks code gif-loop differently
2019-07-06 20:44:24 +01:00
John Cupitt
c8ca8f02ba keep magicksave delay array alive for longer
fixes a segv in magicksave_buffer ... we could try to use delay after im
had been unreffed in some circumstances
2019-07-06 17:45:41 +01:00
John Cupitt
25af46a189 add rgba -> rgb stage for webp output 2019-06-30 16:53:11 +01:00
John Cupitt
72c103f95a Revert "remove no-alpha webp support"
This reverts commit d1094847a3.
2019-06-27 17:27:53 +01:00
John Cupitt
d1094847a3 remove no-alpha webp support
We used to try to spot webp images with no alpha and load them as plain
RGB, but it turns out this is difficult to do reliably, especially
for animated images.

This patch simply removes support, so all webp images now load as RGBA.

See https://github.com/libvips/libvips/issues/1351
2019-06-27 16:37:11 +01:00
John Cupitt
b680d9f833 split heifload / heifsave tests
to allow building with the de265 decoder, but not the GPL ffmpeg x265 encoder
2019-05-08 20:42:38 +01:00
John Cupitt
ec0b7e7bdf fix pdf test
for new sizing rules
2019-04-30 16:24:36 +01:00
John Cupitt
4132623024 add test for PNG interlace handling
see https://github.com/libvips/libvips/pull/1296
2019-04-27 09:34:49 +01:00
John Cupitt
e14ae48a67 fix heifsave on ubuntu 18.04 2019-03-14 13:33:11 +00:00
John Cupitt
3010a4a865 remove autorotate from libheif
not possible to support this properly with current libheif
2019-03-05 17:26:08 +00:00
John Cupitt
f209870e7b start trying to fix autorotate for heif images 2019-03-05 15:35:58 +00:00
John Cupitt
cae57d5670 make heif load/save work with 1.3.2 2019-02-20 12:30:12 +00:00
John Cupitt
1a83605238 Merge branch 'add-heifload' 2019-02-17 17:11:14 +00:00
John Cupitt
06d71f6df3 raise magicksave threshold 2019-02-07 18:51:57 +00:00
John Cupitt
931b661d2b fix up and test with im6/im7/gm
seems to work! phew
2019-02-07 18:35:51 +00:00
John Cupitt
2ab2a90e06 add heif tests 2019-01-30 11:13:14 +00:00
John Cupitt
4cbc280c8a fix cmyk test with lcms2
we were using a dark region of the test image
2019-01-18 10:22:19 +00:00
John Cupitt
f51a93515e beef up the cmyk tests 2019-01-17 09:06:22 +00:00
John Cupitt
a7122d7a85 revise XYZ2CMYK fallback path
better epsilon detect, add a test
2019-01-16 21:02:01 +00:00
John Cupitt
074906f670 fix test suite
- CMYK2XYZ and back now support extra alpha bands
- test suite tests CMYK conversions
- a small bug fixed too
2018-12-28 20:53:25 +00:00
John Cupitt
b0c66df72c add cmyk test
fails right now, since CMYKA is not supported by CMYK2XYZ and XYZ2CMYK
(I think)
2018-12-28 15:26:08 +00:00
John Cupitt
9303e382c1 Merge branch '8.7' 2018-12-17 20:31:25 +00:00
John Cupitt
6ba4b3bfdb fix clipping with new mapim cods
we had the clip in the wrong place

see https://github.com/libvips/libvips/issues/1180
2018-12-17 20:29:31 +00:00
John Cupitt
962cab2d0f Merge branch '8.7' 2018-12-17 13:18:58 +00:00
John Cupitt
db4fe60405 fix mapim offsets
pixels were not being offset by the stencil origin, so interpolators
like bicubic could fail

thanks @erdmann

https://github.com/libvips/libvips/issues/1180
2018-12-17 12:42:34 +00:00
John Cupitt
24abbb83ab add animated webp tests 2018-11-27 13:36:28 +00:00
John Cupitt
b2325697c3 revise xmp in png
back to blob again
2018-11-23 17:20:05 +00:00
John Cupitt
6be70e6799 add xmp load/save for png
plus a test
2018-10-06 11:54:27 +01:00
Yazan Medanat
90f578a05f Change jcupitt references to libvips. 2018-09-21 09:05:47 -07:00
John Cupitt
bb23a1fe6c fix openexr alpha test 2018-08-28 11:18:21 +01:00
John Cupitt
b836749b75 close jpeg read early
The current behaviour (close input handles on unref) works for languages
like C / C++ / Python / Rust / etc. where things get unreffed automatically
when they go out of scope.

On languages like Ruby / C# / node / etc. where things are unreffed on GC,
files can stay open for a long time after you've finished with them. This
interacts in an unfortunate way with the Windows default of refusing to
remove open files.

This change closes file handles as soon as the scan of the input file
finishes, and therefore produces something closer to expected behaviour
for GCd languages on Windows.

see https://github.com/kleisauke/net-vips/issues/12
2018-08-16 15:47:48 +01:00
John Cupitt
9a5249ca20 tag unicode strings as unicode
seems to help with py2.7 anyway
2018-08-12 18:25:19 +01:00
John Cupitt
0beb5e9165 make test-suite survive make dist 2018-07-25 17:17:13 +01:00
John Cupitt
96d5008501 fix make dist 2018-07-25 16:28:23 +01:00
John Cupitt
f005e4a188 add test for new ICO sniffer 2018-07-25 15:34:31 +01:00
John Cupitt
e72ad7045d add a nifti test 2018-07-20 17:23:06 +01:00
John Cupitt
3201b4373d Merge branch 'master' into add-nifti-support 2018-07-20 13:57:51 +01:00
John Cupitt
2695916afb test region_shrink
just sets the option, does not verify accuracy :(
2018-07-07 17:07:35 +01:00
John Cupitt
43199e7b27 add tests for exif string fields
test exif string tag set/save/load
2018-07-06 17:01:38 +01:00
John Cupitt
51e7645859 fix "make check"
eited the wrong file :(
2018-07-06 16:11:02 +01:00
John Cupitt
d510807e90 vmoe the test suite back into libvips 2018-07-06 15:43:20 +01:00
Felix Bünemann
1abc5f901a Add palette flag to trigger pngsave quantisation
and tweak docstrings.
2018-06-19 22:41:40 +02:00
Felix Bünemann
1e68b3a486 Rename pngsave colors/colours, quantize/quantise 2018-06-19 21:32:44 +02:00
Felix Bünemann
d9d2f7b89a Add 8bpp PNG quantization support
This adds support for saving 8-Bit one band palette based PNG images
with palette based alpha channel (often called PNG8+Alpha).

The image is first converted to sRGBA and then quantized using
libimagequant controlled by the colors, Q and dither params.
2018-06-18 02:22:46 +02:00
John Cupitt
424b359d33 bump wrapper script version
and add a test too

see https://github.com/jcupitt/libvips/issues/834
2017-12-17 10:50:57 +00:00
John Cupitt
0ade2e972f reenable png interlace test
reenable png interlace test after the fix in

https://github.com/jcupitt/libvips/pull/821
2017-12-05 08:38:52 +00:00
John Cupitt
48680dccc4 remove python test suite
it's in pyvips now
2017-09-13 17:45:29 +01:00
John Cupitt
3cf33d7f32 Merge branch '8.5' 2017-08-18 12:32:12 +01:00
John Cupitt
279c1ef55f make test text pass if text is missing 2017-08-11 09:31:01 +01:00
John Cupitt
7134c64836 notes 2017-08-11 09:23:59 +01:00
John Cupitt
18595ca0dd find_trim works for all bg images
width/height == 0 if whole image is bg
2017-07-26 15:13:12 +01:00
John Cupitt
6359c92c01 polish, add test for find_trim 2017-07-26 10:43:28 +01:00
John Cupitt
a8fb38fb6a Merge branch '8.5' 2017-07-08 16:06:18 +01:00
John Cupitt
060bdd2cf0 fix svgload resolution again
use rsvg_handle_set_dpi() rather than cairo_scale() to avoid int
truncation on dimensions

see https://github.com/jcupitt/libvips/issues/688
2017-07-08 16:03:56 +01:00
John Cupitt
f3393fb89b try to fix cli format test
add a threshold for svgload, librsvg seems to vary a bit between
platforms
2017-07-08 15:26:48 +01:00
John Cupitt
7408c6c9b2 fix sh part of test suite 2017-07-08 15:09:35 +01:00
John Cupitt
dad4e5b709 fix svgload test 2017-07-08 12:43:03 +01:00
John Cupitt
cbd9fad040 fix a few more problems with input args
a few other operators were modifying input args and messing up caching
2017-05-29 18:58:24 +01:00
John Cupitt
8c8b71d935 Merge branch '8.5' 2017-05-15 11:35:47 +01:00
John Cupitt
2b0ebb0de2 fix test suite thresholds
changes in jpg encode/decode mean we must adjust test suite thresholds
2017-05-15 11:21:13 +01:00
John Cupitt
620e9ebf27 missing backslash in makefile 2017-05-15 10:48:09 +01:00
John Cupitt
2f6f2b93ef add more thumbnail tests
esp. the new force mode
2017-05-05 14:13:49 +01:00
John Cupitt
04353f8915 added new_from_image() to python
and tests
2017-04-28 18:27:15 +01:00
John Cupitt
4c502fcbf3 add more seq tests 2017-04-23 09:43:01 +01:00
John Cupitt
0a5375b6cd Merge branch 'master' into remove-seq-stalling 2017-03-15 12:26:44 +00:00
John Cupitt
e6bbfe4672 more centos5 fixes
can't use GRegexp if we need to support centos5 ... vipsthumbnail was
using it to parse geometry strings

new geo parser, plus some tests

see https://github.com/jcupitt/libvips/issues/622
2017-03-15 12:08:52 +00:00
John Cupitt
362c7efdfc argh reapply seq removal 2017-03-06 11:55:38 +00:00
John Cupitt
d40773515c add smartcrop 2017-03-01 15:41:26 +00:00