Commit Graph

83 Commits

Author SHA1 Message Date
Lovell Fuller 7eba4ee43f
Introduce support for target_clones attribute (#3280)
This requires GLIBC 2.23+, plus either gcc 6+ or clang 14+.

- Provides build-time feature detection
- Use with (un)premultiply for ~10% perf gain on AVX CPUs
- Slightly increases binary size, so best to use sparingly
2023-01-16 10:45:37 +01:00
John Cupitt 5569022dbd use G_GNUC_* attribute system
Instead of our own compiler attr thing.

see https://github.com/libvips/libvips/issues/2871
2022-09-23 14:37:35 +01:00
Kleis Auke Wolthuizen 07edfe37b1
Improve symbol visibility (#2688)
* Improve symbol visibility

* Decorate required internal symbols with VIPS_API

* Remove a couple of stray header decls

* Incorporate review comment

- Ensure symbol visibility is also set on static libraries.
- Prefer to use `cc.has_function_attribute('visibility:hidden')`.

* Don't export internal deprecated symbols

* Move deprecated symbols to vips7compat.h

* `IM_FORMAT_H` -> `VIPS_FORMAT_H`

* Move `vips_window_ref` compat stub to `vips7compat.c`

* Disable deprecation warnings internally

* `vips_image_get_kill` -> `vips_image_iskilled`

* Ensure API compatibility

* Add missing include directives

* Move `vips__init` decl to vips7compat

* Move `vips__get_sizeof_vipsobject` to vips7compat

* Fix introspection build

* Fix 2 introspection warnings

* Ensure compatibility with vipsdisp

/usr/bin/ld: tilesource.o: in function `tile_source_new_from_source':
vipsdisp/tilesource.c:1627: undefined reference to `vips__region_no_ownership'
2022-04-16 10:58:55 +01:00
John Cupitt 7d69f6bc84 small fix to openexr load 2021-03-18 12:47:03 +00:00
John Cupitt 58b6d73a70 deprecate vips_popen()
it didn't work well on win, and we no longer use it anyway
2020-07-27 15:21:59 +01:00
Lovell Fuller e508ea6511 Performance: improve scRGB to sRGB conversion by ~8%
- Remove unnecessary isinf checks as values are clipped
- Remove any ignored out-of-gamut tracking
2020-07-21 14:36:57 +01:00
John Cupitt 5117c1a980 remove mode_t from headers
it seems to fail with MSVC.

int works fine, and is what g_open() uses.
2020-07-04 18:28:44 +01:00
Kleis Auke Wolthuizen 6fc2015783 Remove use of varargs in vips_*_open
This matches the declaration of g_open and helps tools (such as ASan) when
running on non-native platforms.
2020-04-27 11:56:32 +02:00
John Cupitt a592d99bb2 add dir detector
useful for blocking open for read of directories
2020-03-06 18:05:16 +00:00
John Cupitt 9ef8b55218 better handling of short files in vips7 compat
the sniffer could read beyond the end of the file sometimes
2020-03-04 17:38:41 +00:00
John Cupitt ce240b1ca2 revise matrixload for source API 2020-02-22 15:02:12 +00:00
John Cupitt 17b994419b move ppm save into the class
no separate save function now
2019-11-15 10:23:45 +00:00
John Cupitt c383614c28 more cleaning up 2019-11-06 21:34:42 +00:00
John Cupitt 0e29e1c41e start reworking again 2019-10-24 10:57:52 +01:00
John Cupitt bdb5e39efa just the test suite now 2019-10-23 14:51:29 +01:00
John Cupitt f99f3d3f57 revise seek() behaviour
fuzz tests fail though ... we need to split StreamInput up
2019-10-17 17:18:45 +01:00
Angel Sánchez 256cf494a3 use VIPS_PI instead of M_PI as the former is already defined, added missing includes with their macro protection 2018-05-31 13:50:50 +02:00
John Cupitt 5176b4a17e better header sniffing for small files
vips__get_bytes() used to fail if the file was too small for the
allocated buffer, which was a problem for svg, since files can be extremely
small.

This change makes vips__get_bytes() return the number of bytes read, so
the is_a testers can work on files smaller than the max header size.
2018-03-22 12:08:39 +00:00
John Cupitt f9f717a843 add VIPS_ONCE and use it everywhere
Lovell's idea: save the function call in the most common case
2017-11-23 08:43:08 +00:00
John Cupitt 6dbdc173a2 better prefix guessing on Windows
see https://github.com/tumagonx/pygi-mingw-patches/issues/5
2017-05-13 11:11:32 +01:00
John Cupitt 689b632702 better locale guess for win32
see
https://github.com/tumagonx/pygi-mingw-patches/blob/master/gst-plugins-base-1.4.x.patch

also

https://github.com/tumagonx/pygi-mingw-patches/issues/5
2017-05-11 19:49:29 +01:00
John Cupitt ba129fceb3 better win32 compatibility
try to fold the patches @tumagonx maintains into libvips master, see:

https://github.com/tumagonx/pygi-mingw-patches/blob/master/vips-8.4.x.patch

still missing the bindtextdomain() patch though
2017-05-11 17:08:10 +01:00
John Cupitt 36761bcfd7 make vips_gaussnoise() pixels reproducible
previously, pixel values were regenerated on every calculation, so they
changed on recomputation

pixel values are now generated from the pixel (x, y) coordinate plus a per-call
seed

thanks MvGulik, see

https://github.com/jcupitt/nip2/issues/60

https://github.com/jcupitt/libvips/issues/583
2017-01-24 09:36:25 +00:00
John Cupitt 0c4a40e82f oop missed a merge conflict 2017-01-04 10:18:54 +00:00
John Cupitt 262d5a10f7 Merge branch 'master' into glib-logging 2017-01-04 10:13:06 +00:00
John Cupitt 07e6ac1994 support --vips-info
now turns on glib g_info() output
2017-01-04 07:23:50 +00:00
John Cupitt e7a6ea3d0c oops! revert previous 2017-01-03 17:12:42 +00:00
John Cupitt 0d97c78f02 compat macro for early glibs 2017-01-03 17:06:50 +00:00
John Cupitt 57e1423d57 Merge branch 'master' into windows-unicode 2016-09-05 13:12:06 +01:00
John Cupitt c4a1ac6310 fix ROUND_UP, add a test for felix's corner case 2016-08-20 13:18:25 +01:00
John Cupitt 271d8656e9 use round() rather than rint() where appropriate
rint() rounds to nearest even, rather than nearest ... in some cases,
like geometry transforms, we want strict nearest
2016-08-20 12:59:41 +01:00
John Cupitt 578764b582 gifload does unicode on win
sigh again
2016-08-17 14:37:15 +01:00
John Cupitt feca00958c seems to be sort-of working! 2016-08-16 18:33:48 +01:00
John Cupitt e439c5f78f add .svg.gz suffix
allow .x.y suffixes
2016-08-01 14:57:33 +01:00
John Cupitt db11d3b973 allow nested [] in CLI args
this now works:

	vips copy x y.dz[suffix=.jpg[Q=90]]
2016-05-16 11:09:47 +01:00
John Cupitt 840c3f2e63 oops typo
thanks Lovell
2016-02-22 14:08:36 +00:00
John Cupitt adfd25a5ed byteswap popplerload
and better path absoluteization
2016-02-08 16:37:47 +00:00
John Cupitt 4d18300560 add VIPS_FABS/MAX/MIN/CLIP
macros which use the gcc __builtin_fabs() etc. functions when they can
2016-01-26 12:26:21 +00:00
John Cupitt a7d889df06 use builtin floor / ceil
get rid of FAST_PSEUDO_FLOOR, add VIPS_FLOOR and VIPS_CEIL, use them
everywhere

see https://github.com/jcupitt/libvips/pull/372
2016-01-23 09:50:57 +00:00
Lovell Fuller 90c1fb9a94 Use gcc/clang isnan and isinf builtin functions where available.
These are used heavily in the building of look-up tables at
start-up time and therefore improve vipsthumbnail perf by ~4%.
2016-01-20 19:02:14 +00:00
John Cupitt 5cb2239d7d try to support DOS ppm/csv files on linux
swap \r\n for \n in vips__fgetc()
2015-06-04 12:58:30 +01:00
John Cupitt 620bff2d78 allow symbolic names for flags
you can now use numbers or names for GFlags values, eg.:

$ vips copy 50020484-00001.png x.png[filter=avg]
$ vips copy 50020484-00001.png x.png[filter=64]

was numbers only before
2014-10-27 11:40:43 +00:00
John Cupitt 1e6cd1b1a5 clean up length return
read file to mem was using uint for length for historical reasons
2014-09-18 10:19:24 +01:00
John Cupitt d9affe1c2a rearrange tree after dz save to fs for compat
rearrange the directory tree after dzsave for compatibility with
earlier libvips
2014-05-08 14:57:33 +01:00
John Cupitt 1a3c62851e move some junk to deprecated/ 2014-05-06 22:01:20 +01:00
John Cupitt c81a12ee00 vips_system() now uses g_spawn_command_line_sync()
helps stop stray command windows appearing on Windows, better error msg
too
2014-05-03 18:04:25 +01:00
John Cupitt b806659fd5 fix up filename options
all done in vips_foreign_load() / vips_foreign_save() now

added vips__filename_split8()
2014-04-26 11:21:04 +01:00
John Cupitt d7037618fc use a define for PATH_MAX
add VIPS_PATH_MAX, a long-enough-for-almost-any-path buffer size

we ought to switch to dynamic paths really ... do this when we fix
filename encoding
2013-12-01 12:18:16 +00:00
John Cupitt 55bfa92725 add a vips7 interface to the deepzoom writer 2013-06-11 12:32:46 +01:00
Benjamin Gilbert 8cc76a6ba3 Update address for Free Software Foundation
Also update LGPLv2.1 license text from the copy currently on the GNU
website.
2013-03-07 00:40:19 -05:00