Commit Graph

7636 Commits

Author SHA1 Message Date
John Cupitt 57a0bd82f9 small fixes
update func list in docs
add missing C decls for hyperbolic trig funcs
2021-11-15 11:17:36 +00:00
John Cupitt 09771a54ea fix typos 2021-11-14 21:47:43 +00:00
John Cupitt fef024061f layout fixes for tga sniff 2021-11-14 04:09:23 +00:00
Moggers b3ff4d9ed6
Implement Header Sniffing For Magickload Tga (#2533)
Add TGA sniffing
2021-11-14 04:04:32 +00:00
John Cupitt 01e3f1fc33
set libvips orientation on magickload (#2535)
Pick up the imagemagick / graphicsmagick orientation field for libvips.

Tested with graphicsmagick, magick6 and magick7.

see https://github.com/libvips/libvips/issues/2528
2021-11-13 14:38:30 +00:00
John Cupitt ad295b5d41 add changelog notes 2021-11-13 14:36:38 +00:00
Kleis Auke Wolthuizen 008fe2d2f5 Add unit test 2021-11-13 11:29:46 +01:00
John Cupitt 8195b67d83 better exif string value change detection
see https://github.com/libvips/libvips/pull/2518
2021-11-09 19:28:55 +00:00
John Cupitt 296fd99925 clarify doc comments for hist_find_
Say when u8 or u16 are picked.

See https://github.com/libvips/libvips/issues/2519
2021-11-07 11:14:52 +00:00
John Cupitt 6f081de0a0 add minimise to insert
This patch makes "insert" issue minimise signals for inputs in sequential
mode. This can drop memory use in some programs, for example:

```python

import sys
import random
import pyvips

image = pyvips.Image.black(20000, 20000)

for filename in sys.argv[2:]:
    tile = pyvips.Image.new_from_file(filename, access='sequential')
    x = random.randint(0, image.width - tile.width)
    y = random.randint(0, image.height - tile.height)
    image = image.insert(tile, x, y)

image.write_to_file(sys.argv[1])
```

Before this patch:

```
$ for i in {0..1000}; do cp ~/pics/k2.jpg $i.jpg; done
$ /usr/bin/time -f %M:%e ../manyjoin.py ../x.jpg *.jpg
5456256:4.34
```

With this patch:

```
$ /usr/bin/time -f %M:%e ../manyjoin.py ../x.jpg *.jpg
2475324:3.38
```
2021-11-05 12:14:50 +00:00
John Cupitt 41e92b9ada tiny arrayjoin polish 2021-11-05 10:09:16 +00:00
John Cupitt f0e89ac29b Merge branch 'master' of github.com:libvips/libvips 2021-11-04 17:19:15 +00:00
John Cupitt 778ff7fce5 wider margin for arrayjoin minimise
This patch makes arrayjoin leave a bigger margin off the end of each
input image. This can help some loaders which have large output caches.

See https://github.com/libvips/libvips/issues/2440
2021-11-04 17:17:17 +00:00
Lovell Fuller a274a2f7e6
pngsave: allow valid bitdepth of 16 (#2515) 2021-11-04 16:39:12 +00:00
John Cupitt 30fdc3df77 add jp2k load of untiled images
with this patch, untiled jp2k images are loaded in chunks, saving loads
of memory (but runs much slower)
2021-11-04 15:26:04 +00:00
John Cupitt 3488c6b410 reorder hyperbolic enums to fix an ABI break 2021-11-03 17:57:42 +00:00
John Cupitt 4b7915994f better test for hyperbolics 2021-11-02 23:03:05 +00:00
John Cupitt c6d863f9d3 fix inverse hyperbolics
oop, typo
2021-11-02 22:58:19 +00:00
Heshy Roskes d8c04011ea
Add hyperbolic functions (#2508)
* add hyperbolic functions
* add hyperbolic function tests
* changelog
* add inverse hyperbolic functions for old compilers
2021-11-02 15:05:37 +00:00
Kleis Auke Wolthuizen fc92290bb9
Try the new target API first in `VImage::write_to_buffer` (#2511)
Needed after PR #2499.
2021-11-02 13:36:27 +00:00
Kleis Auke Wolthuizen e95e8c5155
Fix typo in `magick7load` (#2512)
Introduced in commit f92069b.
2021-11-02 12:04:19 +00:00
Kleis Auke Wolthuizen f92069b035
Incorporate #2506 also in {webp,magick7}load (#2507) 2021-11-01 18:33:27 +00:00
Kleis Auke Wolthuizen 9c1003fbe6
Set page height only for multi-page images (#2506) 2021-11-01 16:55:37 +00:00
John Cupitt e412d5bdf0 fix copy/paste error in description 2021-11-01 15:45:03 +00:00
Kleis Auke Wolthuizen 31b54056db
cplusplus: only generate doc comments for non-deprecated args (#2505) 2021-11-01 15:21:06 +00:00
John Cupitt 9f37857254 note fail-on in changelog 2021-10-31 14:15:20 +00:00
John Cupitt 0c70f3dc7d
add fail-on : better control over loader error handling (#2360)
Instead of a simple fail/don't-fail boolean switch, add fail-on, an enum which sets the sensitivity of loaders to errors. 

There's a new sensitivity level which tries to detect truncated images, but ignores other types of error.
2021-10-31 14:13:18 +00:00
John Cupitt 5f101b4f2e Merge branch 'master' of github.com:libvips/libvips 2021-10-29 19:05:40 +01:00
John Cupitt ab464e7b31 add clang-tidy rule
with a few rules
2021-10-29 19:04:42 +01:00
John Cupitt 4f9ea61170 Merge branch 'cl' of https://github.com/neheb/libvips into neheb-cl 2021-10-29 18:25:50 +01:00
Kleis Auke Wolthuizen 42c8f43432
Improve doc comments (#2504)
* Fix a couple of incorrect doc comments

Helps GIR.

* Add missing doc comment for VIPS_KERNEL_MITCHELL
2021-10-29 13:37:39 +01:00
Kleis Auke Wolthuizen a5bdcd77e0
Include vips.h before checking for G_OS_WIN32 (#2502)
Since this definition originates from GLib, it is necessary to
include vips/vips.h prior to using it.
2021-10-29 11:05:21 +01:00
Kleis Auke Wolthuizen 2d6d2e7c0d
Drop the operation cache before leak checking (#2503) 2021-10-29 11:03:28 +01:00
John Cupitt 47383b5bfc
tell buffer and target savers the file format (#2499)
tell buffer and target savers the file format

Currently, buffer and target savers are not told the format they should
write.

This is usually OK (the JPEG saver already knows it should write JPEG),
but some savers can write several formats, and these currently need an
extra parameter.

For example:

```ruby
buf = x.write_to_buffer ".bmp", format: "bmp"
```

The first ".bmp" gets libvips to pick magicksave, the second
`format:` param is necessary to tell magicksave to write BMP.

This patch adds stub subclasses so that the savers know the exact format. It also improves PPM save.
2021-10-28 18:57:24 +01:00
John Cupitt 1f321d366b disable webp shrink-on-load if it will judder
Webp decode can only shrink-on-load to int boundaries. This means that frames
in an animation which only update part of the canvas can get displaced by
up to 0.5 pixels, causing juddering.

see https://github.com/libvips/libvips/issues/2379
2021-10-27 13:25:04 +01:00
John Cupitt e815e8ad95
Move the filemode ifdefs to a private header (#2498)
The filemode ifdefs had grown to 30 lines of code duplicated in four
source files. Move to a single copy in a private header (not part of the
public API).
2021-10-27 11:37:51 +01:00
Kleis Auke Wolthuizen 5d6e9851ba
Ensure newly created file descriptors are non-inheritable (#2497)
* Cleanup unused defines

* win32: do not inherit open file handles in child processes

`O_NOINHERIT` and the `N` flag of `fopen` is available in all
supported Windows versions.

* unix: ensure any open file handles are closed on exec

`O_CLOEXEC` is available since Linux 2.6.23 and is ignored on
earlier versions. `e` flag of `fopen` is available since glibc 2.7.
2021-10-26 12:20:03 +01:00
John Cupitt a16f118b0c speed up test suite
ouch we were making a huge avif image in memory
2021-10-25 20:40:42 +01:00
Kleis Auke Wolthuizen 29fb557e24
Temporarily skip `test_heifsave` on macOS (#2494) 2021-10-21 18:14:40 +01:00
John Cupitt ba3bc3099c raise single-chunk limit in jpeg save
It was 65530 for some reason. It's now 65533.

See https://github.com/libvips/libvips/issues/2493
2021-10-21 15:08:48 +01:00
John Cupitt 21567e12b8 note atan2 in changelog 2021-10-20 20:42:23 +01:00
John Cupitt de6e2fef9e add a test for atan2
and tiny formatting changes
2021-10-20 20:40:39 +01:00
John Cupitt 13285c7cfc Merge branch 'master' of https://github.com/indus/libvips into indus-master 2021-10-20 18:41:39 +01:00
John Cupitt 7855fabea3 Merge branch 'master' of github.com:libvips/libvips 2021-10-20 14:28:37 +01:00
John Cupitt 53ee983b51 oop, debug left enabled by mistake 2021-10-20 14:28:15 +01:00
Kleis Auke Wolthuizen 8a1e1eda34
Prefer g_malloc over vips_malloc in vips_blob_copy (#2489)
The use of vips_malloc is not necessary here and could potentially
be slower since it uses g_malloc0 (i.e. calloc).
2021-10-20 14:22:00 +01:00
Kleis Auke Wolthuizen a829a474e5
Remove stray declaration of im__fftproc() (#2487) 2021-10-20 13:01:07 +01:00
Kleis Auke Wolthuizen 1044dd46eb
Move vips__ink_to_vector and im__vector_to_ink to compat (#2488)
It was only used by getpoint in vips8, which is simpler to inline.
2021-10-20 13:00:01 +01:00
John Cupitt 96604dba10 turning on subifd enable pyramid mode
see https://github.com/libvips/pyvips/issues/277
2021-10-20 10:40:03 +01:00
John Cupitt cf1228b927 fix page_height arg for tiffsave
it wasn't wired up, thanks @jacopoabramo

see https://github.com/libvips/pyvips/issues/277
2021-10-20 10:18:22 +01:00