Brothers, I seek your wisdom.

Is there a perl library, script or CPAN module that talks Picture Transfer Protocol (PTP) I have searched here, google and CPAN for both "Picture Transfer Protocol" and gPhoto2 and come up empty.

libgphoto2 is the linux library that implements the protocol, and is used by a number of linux GUI applications to talk to digital cameras.

Does anyone know of a project or library out there that I am missing?

Edit: To be clear, picture transfer protocol (PTP) is different from USB mass storage. Some cameras when you connect them to a PC, become USB mass storage devices for the contents to the memory card. Others don't talk mass storage, but instead talk PTP. I have two Nikon and two Cannon cameras at home, both the Nikon cameras talk mass storage when connected to a PC, but the Canon cameras talk PTP. I would need to remove the memory card from the camera and put it in a card reader in order to use mass storage, which would be less convenient.

libgphoto2 includes a shell gphoto2 that exposes most of the same functions as are available in the library. It gives you an idea of what can be done.

The reason that I am interested in reading the picture on my camera over PTP, is that the filesystem emulation provided by Ubuntu only lets me read complete files. There is no random access to files. I would like to read the Exif information of my photos (into Image::EXIF objects) without the overhead of transferring entire files. Using the shell I can read the Exif information of 300 pictures in about 8 seconds. If Ubuntu mounts the camera as a filesystem, then in order to read the Exif information from all those pictures, the filesystem emulator would first need to copy them to the local machine, and seeing as the total size is about a Gigabyte, that would take several minutes.


In reply to CPAN module for Picture Transfer Protocol ? by chrestomanci

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.