I recently got a new Treo 600 Phone/PDA/Camera and found there was no good software to extract the pictures from the phone. After doing some research on the format of the files, I put together the following. Just edit the $syncdir variable at the top to point to where your files are.
#!/usr/bin/perl -w use strict; use Palm::PDB; use Palm::Raw; # Set this to the dir the ImageLib_imageDB.pdb # and ImageLib_mainDB.pdb files are in my $syncdir = "."; my %imagedata; my $imagedb = new Palm::PDB; my $maindb = new Palm::PDB; $imagedb->Load("$syncdir/ImageLib_imageDB.pdb"); $maindb->Load("$syncdir/ImageLib_mainDB.pdb"); # Gather picture data, indexed by Record ID. The phone has only 32Meg +s # of memory, so it shouldn't be restrictive to load all the data into # memory foreach my $record (@{$imagedb->{records}}) { $imagedata{$record->{id}} = $record->{data}; } # Records in the mainDB give the filename, and record number # of the start of each picture foreach my $record (@{$maindb->{records}}) { my ($file, $startpic, $startthumb, $nbrecpic, $nbrecthumb) = unpack "A32x8Lx4LSS", $record->{data}; print "$file.jpg"; open JPG, ">", "$file.jpg" or die "Couldn't open $file.jpg: $!\n"; my $nextrec = $startpic; # Write data to image file, following the Next Record pointers # until the last one is found while ($nextrec != 0) { my ($next, $data) = unpack "La*", $imagedata{$nextrec}; print JPG $data; print "."; $nextrec = $next; } print "\n"; close JPG; }

In reply to Photo Extractor for Treo 600 Phone/PDA/Camera by Paladin

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.