Re: Is CGImage... thread-safe?
Re: Is CGImage... thread-safe?
- Subject: Re: Is CGImage... thread-safe?
- From: Steve Christensen via Cocoa-dev <email@hidden>
- Date: Wed, 27 May 2020 17:48:46 -0700
> On May 27, 2020, at 3:03 PM, Steve Mills via Cocoa-dev
> <email@hidden> wrote:
>
>> I can't recall/reproduce, but it was definitely *inside*
>> CGImageSourceCreateThumbnailAtIndex().
>>
>> If there is no image a tinder 0, shouldn't it just return NULL gracefully?
>
> We don’t know that. There are many routines that throw exceptions when the
> index is out of bounds. You should be calling CGImageSourceGetCount first to
> make sure there’s an image at 0.
Right. If you look at the docs
<https://developer.apple.com/documentation/imageio/1465099-cgimagesourcecreatethumbnailatin>,
it says that the result is “A CGImage object. …”. It doesn’t say “A CGImage
object or NULL. …”. That suggests that you need to provide a valid index.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden