Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • Is iPhoto's storage format known? I read somewhere that starting with Keynote (and following up on the preferences and stuff), Apple was to use XML as the storage format for an increasing number of its apps. Not to over-pitch XML (especially as Keynote's format could be much improved upon, notably by using SVG instead of copying it) but it would make export trivial, could be used directly in AxKit's image gallery, would allow one to search for pics using Find::File::Rule::XPath, etc.

    robin, who's to

    --

    -- Robin Berjon [berjon.com]

    • by pudge (1) on 2003.02.03 8:49 (#16650) Homepage Journal
      It looks like most, but not all, of the info I need is in AlbumData.xml, including a list of all the images, with title, date, filename, comment, and unique iPhoto ID.

      It does not include heigh/width, though, which is important for my use; however, I could get all the info from the XML and from there query iPhoto via Apple events for the dimensions. Actually, what I really need is not dimensions, but degrees of clockwise rotation. It looks like iPhoto does not store that information at all, or at least not in any way I can retrieve it via the XML or Apple events. Grrr. If I only need dimensions, I could get those via Apple events, or with a combination of thumbnail path (also in the XML) and Image::Size.

      Ugh, and Date is messed up. In the XML, there is Date, which is the date of import, and ModificationDate which is the last time the photo was modified, either the date of the photo on disk (not sure if it uses the filesystem or EXIF data ... I think it is the former), or the date you last modified the picture, but it is not updated when you modify any part of it, just some parts of it. There is no way to get the assigned Date except via Apple events, and no way to get the Modification Date (which would be useful for synching if it were more comprehensive) except by XML. My head hurts.

      Also, the Date in the XML is not the Date of the image, but the Date of import. Unuseful to me. I could make use of ModifiedDate for the purpose of synchronizing metadata between iPhoto libraries, though.
      • Is there any chance that the rotation would be in the EXIF data? There's a field for orientation [perl.org] so there could well be more info.

        For my needs I don't mind throwing in a small SAX filter to add the dimensions, it's cool to know that it's XML so that I can think about building drop in apps for AxKit and that kind of stuff I use. Thanks for the info, hopefully I'll have my iBook soon enough to play with that kind of stuff :)

        --

        -- Robin Berjon [berjon.com]

        • A good idea, but apparently not.

          $ exifdump ./iPhoto\ Library/2001/07/23/Originals/DSCN0357.JPG | grep Orientation
          Orientation -> top_left
          $ exifdump ./iPhoto\ Library/2001/07/23/DSCN0357.JPG | grep Orientation
          Orientation -> [top_left,top_left]
          $ exifdump ./iPhoto\ Library/2001/07/23/Thumbs/10.jpg | grep Orientation

          So even in iPhoto's copy of this image, which was flipped upside down in iPhoto, the orientation remains unchanged in the EXIF data (for some value of "unchanged" ... it rewrites the EXIF dat