Does UIImage on WatchOS Support WebP?

I am able to create a UIImage from webP data using UIImage(data: data) on iOS and iPadOS. When I try to do this same thing on watchOS 10, it fails. Is there a workaround to displaying webp images on watch os if this isn't expected to work?

Accepted Reply

UIKit supports all image formats that ImageIO supports. If you call CGImageSourceCopyTypeIdentifiers() you can see the list (you can do this in the debugger as po CGImageSourceCopyTypeIdentifiers() ).

When I do so, I get this list:

public.jpeg,
public.png,
com.compuserve.gif,
public.tiff,
public.jpeg-2000,
com.apple.atx,
org.khronos.astc,
org.khronos.ktx,
public.heic,
public.heics,
public.heif,
com.microsoft.ico,
com.microsoft.bmp,
com.microsoft.cur,
com.truevision.tga-image,
com.ilm.openexr-image,
public.pbm,
public.mpo-image,
public.pvr

Which unfortunately does not appear to include WebP. Feel free to file a feature request for support.

Replies

UIKit supports all image formats that ImageIO supports. If you call CGImageSourceCopyTypeIdentifiers() you can see the list (you can do this in the debugger as po CGImageSourceCopyTypeIdentifiers() ).

When I do so, I get this list:

public.jpeg,
public.png,
com.compuserve.gif,
public.tiff,
public.jpeg-2000,
com.apple.atx,
org.khronos.astc,
org.khronos.ktx,
public.heic,
public.heics,
public.heif,
com.microsoft.ico,
com.microsoft.bmp,
com.microsoft.cur,
com.truevision.tga-image,
com.ilm.openexr-image,
public.pbm,
public.mpo-image,
public.pvr

Which unfortunately does not appear to include WebP. Feel free to file a feature request for support.