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.
This commit is contained in:
Stefan Kangas 2023-08-14 21:34:34 +02:00
parent 279e3723b1
commit 17d3b70fbf
2 changed files with 8 additions and 2 deletions

View file

@ -12834,8 +12834,10 @@ non-numeric, there is no explicit limit on the size of images. */);
add_image_type (Qpng);
#endif
#if defined (HAVE_WEBP) || (defined (HAVE_NATIVE_IMAGE_API) \
&& defined (HAVE_HAIKU))
#if defined (HAVE_WEBP) \
|| (defined (HAVE_NATIVE_IMAGE_API) \
&& ((defined (HAVE_NS) && defined (NS_IMPL_COCOA)) \
|| defined (HAVE_HAIKU)))
DEFSYM (Qwebp, "webp");
DEFSYM (Qwebpdemux, "webpdemux");
add_image_type (Qwebp);

View file

@ -77,6 +77,10 @@ Updated by Christian Limpach (chris@nice.ch)
#ifndef HAVE_RSVG
else if (EQ (type, Qsvg))
imageType = @"public.svg-image";
#endif
#ifndef HAVE_WEBP
else if (EQ (type, Qwebp))
imageType = @"org.webmproject.webp";
#endif
else if (EQ (type, Qheic))
imageType = @"public.heic";