diff options
| author | Stefan Kangas | 2023-08-14 21:34:34 +0200 |
|---|---|---|
| committer | Stefan Kangas | 2023-08-14 21:34:34 +0200 |
| commit | 17d3b70fbfcbb392b9a3e64f1ca05168cd16d3e8 (patch) | |
| tree | c073835cc6563d23adf834b314c68d116f9dedbe /src | |
| parent | 279e3723b10a8aa8323f9094f7f1e7d52820bcec (diff) | |
| download | emacs-17d3b70fbfcbb392b9a3e64f1ca05168cd16d3e8.tar.gz emacs-17d3b70fbfcbb392b9a3e64f1ca05168cd16d3e8.zip | |
Add native WebP support on macOS (Bug#59242)
* src/image.c (syms_of_image)
[HAVE_NATIVE_IMAGE_API && HAVE_NS && NS_IMPL_COCOA]:
Add webp as an image type.
* src/nsimage.m (ns_can_use_native_image_api)
[NS_IMPL_COCOA && !HAVE_WEBP]: Add webp to list of possible image
types in the native image support lookup.
Diffstat (limited to 'src')
| -rw-r--r-- | src/image.c | 6 | ||||
| -rw-r--r-- | src/nsimage.m | 4 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/image.c b/src/image.c index f2079fab6a3..7019bbf31be 100644 --- a/src/image.c +++ b/src/image.c | |||
| @@ -12834,8 +12834,10 @@ non-numeric, there is no explicit limit on the size of images. */); | |||
| 12834 | add_image_type (Qpng); | 12834 | add_image_type (Qpng); |
| 12835 | #endif | 12835 | #endif |
| 12836 | 12836 | ||
| 12837 | #if defined (HAVE_WEBP) || (defined (HAVE_NATIVE_IMAGE_API) \ | 12837 | #if defined (HAVE_WEBP) \ |
| 12838 | && defined (HAVE_HAIKU)) | 12838 | || (defined (HAVE_NATIVE_IMAGE_API) \ |
| 12839 | && ((defined (HAVE_NS) && defined (NS_IMPL_COCOA)) \ | ||
| 12840 | || defined (HAVE_HAIKU))) | ||
| 12839 | DEFSYM (Qwebp, "webp"); | 12841 | DEFSYM (Qwebp, "webp"); |
| 12840 | DEFSYM (Qwebpdemux, "webpdemux"); | 12842 | DEFSYM (Qwebpdemux, "webpdemux"); |
| 12841 | add_image_type (Qwebp); | 12843 | add_image_type (Qwebp); |
diff --git a/src/nsimage.m b/src/nsimage.m index af8eb629989..b33124900bb 100644 --- a/src/nsimage.m +++ b/src/nsimage.m | |||
| @@ -78,6 +78,10 @@ ns_can_use_native_image_api (Lisp_Object type) | |||
| 78 | else if (EQ (type, Qsvg)) | 78 | else if (EQ (type, Qsvg)) |
| 79 | imageType = @"public.svg-image"; | 79 | imageType = @"public.svg-image"; |
| 80 | #endif | 80 | #endif |
| 81 | #ifndef HAVE_WEBP | ||
| 82 | else if (EQ (type, Qwebp)) | ||
| 83 | imageType = @"org.webmproject.webp"; | ||
| 84 | #endif | ||
| 81 | else if (EQ (type, Qheic)) | 85 | else if (EQ (type, Qheic)) |
| 82 | imageType = @"public.heic"; | 86 | imageType = @"public.heic"; |
| 83 | 87 | ||