• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: iPhoto returns a real number as a photo id
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iPhoto returns a real number as a photo id


  • Subject: Re: iPhoto returns a real number as a photo id
  • From: Rob Lewis <email@hidden>
  • Date: Mon, 14 Jun 2010 12:25:15 -0700



iPhoto's scripting dictionary says that the "id" property of a photo is an
integer. Yet when you fetch it, it's returned as a real number. What is one
supposed to do with that? Very odd IMO.

It looks like they're stored as integers that are outside AS's integer
range, and so AS coerces them to reals. Let me ask, what can't you do with
them that you could if they were integers?

Well, let's see: apart from the fact that it's damn strange to use a real number as an id number (or is it just me? In a long career, I can't recall ever seeing another instance of this), integers are much easier to read IMO, and more convenient to place in sorted lists. 

"every photo whose id is 4.943105932E+9" is just frickin' bizarre. And there's an "insecurity factor" because everyone knows that floating point numbers are very often not exact representations. 

Be honest now: if you were designing this, would you choose real as the type for your id numbers? 


Other Apple apps (e.g., Address Book) use 128-bit unique IDs, returned as a
string of 32 hex digits, in the same format used by the "uuidgen" command line
utility. These are guaranteed to be unique. I doubt that iPhoto makes any such
guarantee, or at least I can't find any mention of it.

Why would they not be unique?

I don't know whether they would or wouldn't be: that's the problem. The id's returned by uuidgen, however, are guaranteed to be spatially and temporally unique. Other Apple apps use them; why not iPhoto? It is perhaps significant that the image property is named "id" and not "unique id" (as it is in some other apps I've seen). 

When you're talking about a world in which there are trillions of images out there that are at least potentially candidates for cataloging, this stuff matters. 

-- 
Shane Stanley <email@hidden>

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: iPhoto returns a real number as a photo id
      • From: Tommy Bollman <email@hidden>
    • Re: iPhoto returns a real number as a photo id
      • From: Shane Stanley <email@hidden>
  • Prev by Date: Re: Can I map custom characters to normal uppercase equivalents?
  • Next by Date: Re: AppleScript-Users Digest, Vol 7, Issue 311
  • Previous by thread: Re: iPhoto returns a real number as a photo id
  • Next by thread: Re: iPhoto returns a real number as a photo id
  • Index(es):
    • Date
    • Thread