How can one determine if iPhoto/Aperture is currently available?

3 views
Skip to first unread message

Robin

unread,
Jan 2, 2012, 5:14:25 AM1/2/12
to imedi...@googlegroups.com
Hey everyone

What is the best way to determine if iPhoto or Aperture nodes are available? I see that both parsers have an isInstalled class method, however, this only checks if the application is installed but not whether the library is actually accessible on a currently mounted volume, hence isInstalled might return YES even if iMedia can't currently load iPhoto/Aperture nodes.
The only way I have found so far is watching the libraryControllers didCreateNode delegate callback and putting a timeout in there that fires if the iPhoto/Aperture root node do not get loaded within a certain time period. Is there is any better way to detect the (temporary) unavailability of iPhoto/Aperture?

Thanks,
Robin

Peter Baumgartner

unread,
Jan 2, 2012, 11:42:28 AM1/2/12
to imedi...@googlegroups.com
Hi Robin,

you could iterate through the IMBLibraryController topLevel nodes and look for the identifier of the parsers in question. The only issue you will have to figure out, is when exactly to make this check, as the asynchronous nature of iMedia doesn't make it obvious. Hope this helps a bit...

Peter

Robin Guldener

unread,
Jan 2, 2012, 3:31:08 PM1/2/12
to imedi...@googlegroups.com
Hi Peter

Thanks for the pointer, this gave me the right idea. Turns out it is very easy actually:

NSMutableArray *parsers = [[IMBParserController sharedParserController] loadedParsersForMediaType:kIMBMediaTypeImage];

loadedParsersForMediaType will return all loaded parsers for the media type provided, however, if the libraries don't exist the parsers can't be loaded and are hence not included. Thus all I needed to do was check if there are instances of IMBApertureParser (or IMBiPhotoParser relatively) in the array parsers. This also works at any point since the parsers are loaded lazily if they haven't been loaded yet.

Best,
Robin

Robin Guldener

unread,
Jan 2, 2012, 3:33:25 PM1/2/12
to imedi...@googlegroups.com
IMBiPhotoParser *respectively* of course. Also, "in the array parsers" means "in the array name parsers". Sry, need to proofread more diligently.

Cheers, Robin

Mike Abdullah

unread,
Jan 2, 2012, 6:22:07 PM1/2/12
to imedi...@googlegroups.com

On 2 Jan 2012, at 20:31, Robin Guldener wrote:

> Hi Peter
>
> Thanks for the pointer, this gave me the right idea. Turns out it is very easy actually:
>
> NSMutableArray *parsers = [[IMBParserController sharedParserController] loadedParsersForMediaType:kIMBMediaTypeImage];

Just going to poke my nose in and point out that iMedia 2.1 overhauled this API to be -parsersForMediaType: and return a plain NSArray.

Robin Guldener

unread,
Jan 2, 2012, 6:33:21 PM1/2/12
to imedi...@googlegroups.com
HI Mike

Thanks a lot for the heads up, but the behavior hasn't changed, right?

Is the current Github Master V 2.0 and is the version noted somewhere in the source files? The info.plist in the framework folder notes "Bundle Version 1.0" but looking at the file headers I am certainly using something like 2.X but not sure which version exactly it is. iMedia.h might be a good place to put it if it isn't anywhere else yet.
Last but not least, is there a roadmap somewhere for the development of iMedia?

Thanks,
Robin

Mike Abdullah

unread,
Jan 2, 2012, 6:50:01 PM1/2/12
to imedi...@googlegroups.com

On 2 Jan 2012, at 23:33, Robin Guldener wrote:

> HI Mike
>
> Thanks a lot for the heads up, but the behavior hasn't changed, right?

Apart from the return type, the behaviour hasn't changed. Also, I posted to the mailing list a while back the full details of the change.


>
> Is the current Github Master V 2.0 and is the version noted somewhere in the source files?

The latest git tag is your best indicator of the API version.

> The info.plist in the framework folder notes "Bundle Version 1.0" but looking at the file headers I am certainly using something like 2.X but not sure which version exactly it is.

Ah, good point about the bundle version. Guys, do you think we should start incrementing the bundle version?

> iMedia.h might be a good place to put it if it isn't anywhere else yet.

Not a bad thought either, although it is then one more thing to keep updated.

> Last but not least, is there a roadmap somewhere for the development of iMedia?

Not really. We've generally just pottered along adding/tweaking the things people need/want. 2.0 was a rather deliberate change to a massive reorg of the framework. I declared 2.1 to be that because the API was no longer backwards-compatible.

Reply all
Reply to author
Forward
0 new messages