Commit Graph

332 Commits

Author SHA1 Message Date
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
d58b3410c4 tiny perf improvement 2022-03-28 12:35:25 +01:00
Kleis Auke Wolthuizen
0337c09700
Cleanup gettext handling (#2695)
Use GLib's i18n support instead of copying and pasting that
logic into its own header. This deprecates the vips/intl.h
header in favour of glib/gi18n.h.
2022-02-27 15:27:28 +00:00
Kleis Auke Wolthuizen
50a74ceeec
Mark some functions and variables as static (#2691)
These are only used in the same file, and not exported.
2022-02-27 13:41:39 +00:00
Corentin Noël
69bf2be12b
Enhance the introspection support by fixing annotations (#2657)
Also refine the .metadata file
2022-02-15 10:54:40 +00:00
John Cupitt
362adae8c6
Revert "Enhance the introspection support by fixing annotations (#2655)" (#2656)
This reverts commit 47796dcda0.
2022-02-15 10:08:07 +00:00
Corentin Noël
47796dcda0
Enhance the introspection support by fixing annotations (#2655)
* Ensure that double asterisk characters are only used for gtk-doc comments

This triggers warnings when parsing the files with the introspection scanner
and gtk-doc

* Enhance the introspection support by fixing annotations

Also refine the .metadata file

Co-authored-by: John Cupitt <jcupitt@gmail.com>
2022-02-15 09:54:32 +00:00
Corentin Noël
02901436d4
Add meson build system (#2637)
Allows to use the Meson build system to build the project.
2022-02-08 15:19:36 +00:00
Kleis Auke Wolthuizen
5ab66e16e1
Fix UBSan errors (#1948)
* Ensure UBSan exits with a non-zero code on error

* Avoid misaligned member access in mosaic_fuzzer

* Add missing VIPS_CLIP in scRGB2sRGB/scRGB2BW

* Fix UBSan error in flatten

By using saturated casts for the int types (copied from vips_cast).

* CI: ensure fuzzer log is printed on error

* Avoid UB in heifload

* Revert flatten change

I could no longer reproduce this with clang 12 locally.

* Indentation fixes [skip ci]
2021-09-12 13:14:24 +01:00
John Cupitt
9d186c9cd4 Merge branch '8.11' 2021-08-14 18:17:11 +01:00
Kleis Auke Wolthuizen
1611afee7e
Fix a few -Wstrict-aliasing=1 warnings (#2380) 2021-08-07 18:11:36 +01:00
John Cupitt
5fff62576e more dbg output 2021-06-30 17:22:35 +01:00
John Cupitt
7e5312f626 more dbg code 2021-06-30 14:30:02 +01:00
John Cupitt
6a0e5c26db Merge branch 'master' into improve-detection-of-bad-profiles 2021-04-24 18:29:22 +01:00
John Cupitt
4abcbc7a2e try to improve the error message 2021-04-24 18:23:27 +01:00
John Cupitt
a046f26095 better falling back on profile load
This patch makes the icc operations fall back to the built-in profiles more
gracefully.
2021-04-24 17:44:25 +01:00
John Cupitt
693bc3ccbf
Merge branch 'master' into add-black-point-compensation 2021-04-19 18:53:35 +01:00
John Cupitt
db22eb4d4f add p3.icm to makefile.am
and fix make dist
2021-04-08 10:53:15 +01:00
Lovell Fuller
d56a47829b colour: add a fallback for the increasingly-common P3 profile
Uses the CC0-licensed 'magic' compatibility profile from
https://github.com/saucecontrol/Compact-ICC-Profiles#display-p3
2021-04-07 21:44:33 +01:00
John Cupitt
005360dba7 add support for lcms black point compensation
Add a --black-point-compensation flag.

See https://github.com/libvips/libvips/discussions/2169
2021-03-29 12:41:02 +01:00
John Cupitt
8cddba44ab Merge branch 'master' into improve-detection-of-bad-profiles 2021-03-06 11:47:53 +00:00
John Cupitt
b995a6d244 move the nsgif source into the tree
and remove the old giflib loader
2021-02-28 12:20:05 +00:00
Lovell Fuller
40c4b93ee5 Compress fallback profiles with zlib
Reduces binary size by 580KB, ~17% at -O2
2021-02-26 19:18:49 +00:00
John Cupitt
03dac2a2df detect bad profiles during profile load
and add some extra dbg to print profile properties

see https://github.com/libvips/libvips/issues/1956
2021-01-08 14:19:32 +00:00
Kleis Auke Wolthuizen
7cda6e5957 Switch VIPS_FCLIP to VIPS_CLIP in vips_scRGB2{BW,sRGB} 2020-12-29 13:02:08 +01:00
John Cupitt
d203a3fb89 small comment improvements 2020-07-21 18:03:45 +01:00
John Cupitt
c4d093b01f
Merge pull request #1735 from lovell/perf-scrgb-to-rgb
Performance: improve scRGB to sRGB conversion by ~8%
2020-07-21 17:58:12 +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
Lovell Fuller
3659655750 Performance: improve XYZ to LAB conversion by ~15%
- VIPS_CLIP is faster than fmin/fmax based library calls
- Cast to int to ensure the cubed root LUT is not referenced by NaN
2020-07-21 14:21:27 +01:00
John Cupitt
e82b1689c7
Revert "Performance: improve XYZ to LAB conversion by ~15%" 2020-07-21 11:00:35 +01:00
John Cupitt
ef6ad7f4bb
Merge pull request #1729 from lovell/perf-lab-clip
Performance: improve XYZ to LAB conversion by ~15%
2020-07-20 13:36:03 +01:00
Lovell Fuller
4aaa39502b Improve performance of conversion to LAB by ~15% 2020-07-19 21:20:21 +01:00
Lovell Fuller
a7357c5757 Perf: improve conversion to LCH by ~30%, avoid costly atan2 2020-07-19 15:29:03 +01:00
Kleis Auke Wolthuizen
9246094033 Fix function pointer cast issues
It is undefined behavior in C and C++ to cast a function pointer
to another type and call it that way. This does work in most native
platforms, however, despite it being UB, but in WASM it can fail.

See:
https://emscripten.org/docs/porting/guidelines/function_pointer_issues.html
2020-06-30 13:35:41 +02:00
John Cupitt
72b73e069e Merge branch 'master' of github.com:libvips/libvips 2020-06-13 10:29:58 +01:00
John Cupitt
e9b1f538db
Revert "Add BT.709 ICC profile and use for HEIF "nclx"" 2020-06-13 04:10:13 +01:00
John Cupitt
99f495a5ed Merge branch 'master' of github.com:libvips/libvips 2020-06-13 03:55:31 +01:00
John Cupitt
dfb714e8fe minor reformat 2020-06-13 03:51:40 +01:00
Lovell Fuller
fc20a7a654 Add bt709 ICC profile, use for heif 'nclx' 2020-06-12 20:20:25 +01: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
John Cupitt
ceb2db513d Merge branch '8.8' 2019-11-11 18:05:57 +00:00
John Cupitt
d4bd8c4c0b fix make dist for 8.8.3 2019-09-16 16:59:52 +01:00
John Cupitt
57d1d86885 avoid a harmless out of bounds read
in UCS table building
2019-08-29 15:42:05 +01:00
John Cupitt
f8bdc00866 void /0 in Yxy2XYZ
Now sets 0 rather than inf.
2019-08-29 14:20:30 +01:00
John Cupitt
3e89944bf9 remove a pointless optimisation from rad2float
Some old rad code could cause a read beyond end of buffer.
2019-08-27 09:23:16 +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
9cc72ea1c1 msvc dies with string literals larger than 64kb
use arrays instead of tseing literals

generates the literals, profile_load.c needs to be adjusted still
2019-08-08 11:29:39 +01:00
John Cupitt
834acad825 fix << on signed int warnings
<< on a negative number is undefined behaviour in C, and will trigger
fuzzer warnings.
2019-08-02 05:35:18 +01:00
John Cupitt
d2a9a20a78 fix thumbnail regression with cmyk in and out
56d98f3ef0 broke cmyk->cymk thumbnails
2019-04-23 17:09:20 +01:00