Re: Is CGImage... thread-safe?

2020-05-27 Thread Steve Christensen via Cocoa-dev

> On May 27, 2020, at 3:03 PM, Steve Mills via Cocoa-dev 
>  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 
,
 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 (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Is CGImage... thread-safe?

2020-05-27 Thread Steve Mills via Cocoa-dev
> 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.

Steve via iPad


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Is CGImage... thread-safe?

2020-05-27 Thread Rob Petrovec via Cocoa-dev


> On May 27, 2020, at 1:08 PM, Gabriel Zachmann via Cocoa-dev 
>  wrote:
> 
>>> 
>>> I've just had a crash in
>>> CGImageSourceCreateThumbnailAtIndex( new_image, 0, imageOpts );
>> 
>> We went through this quite a while ago in private emails. 
>> CGImageSourceCreateThumbnailAtIndex is fine to use from any thread. Are you 
>> sure the image source even has an image at index 0? Not all do. What's the 
>> crashed stack look like?
> 
> 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?
There can be valid arguments going either way.  If you think it’s 
acting inappropriately I’d suggest filing a bug with Apple.  

—Rob


___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Is CGImage... thread-safe?

2020-05-27 Thread Gabriel Zachmann via Cocoa-dev
>> 
>> I've just had a crash in
>>  CGImageSourceCreateThumbnailAtIndex( new_image, 0, imageOpts );
> 
> We went through this quite a while ago in private emails. 
> CGImageSourceCreateThumbnailAtIndex is fine to use from any thread. Are you 
> sure the image source even has an image at index 0? Not all do. What's the 
> crashed stack look like?

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?

Best regards, Gabriel




smime.p7s
Description: S/MIME cryptographic signature
___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com


Re: Is CGImage... thread-safe?

2020-05-26 Thread Steve Mills via Cocoa-dev
On May 26, 2020, at 16:10:26, Gabriel Zachmann via Cocoa-dev 
 wrote:
> 
> I've just had a crash in
>   CGImageSourceCreateThumbnailAtIndex( new_image, 0, imageOpts );

We went through this quite a while ago in private emails. 
CGImageSourceCreateThumbnailAtIndex is fine to use from any thread. Are you 
sure the image source even has an image at index 0? Not all do. What's the 
crashed stack look like?

--
Steve Mills
Drummer, Mac geek

___

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

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:
https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com