I am working on a Kodak CD processor utility to make some use out this mountain of images my wife has built up for me. I have around 100 CD's and I decided I had better write a Perl utility to process them into a more useful block of information. I looked on CPAN and here, but didn't really find much. I am working with some older ( year 2000) Kodak CD's so possibly the format has changed, but I am trying to make everything as generic as possible. So to that end I am seeking some wisdom on how to best provide an interface to some of the methods.

I read the INFO.CD file and get the OrderId and use that for my reference point since the CD is stamped with this it gives some point to refer to in the future if you want to know where the original was. I then get a list of the photos from the disk. This is where my first question lies. I had been saving the images to the HD for processing and archiving, but that lead to redundant archiving since the CD should be the archive. This was also eating up a lot of HD space so I just stored the list and always goes back to the source to do any modifications. Would this be useful as a configuration option, the storing of the files to HD versus going to source that is?

Once I get the list I then process each image with Image::Magick and convert the images to presently predefined sizes. Which brings me to my second question. What would be a good generic interface to this? I am presently toying with this:
sub resize_image { my ($self,$file) = @_; my($image, $x); print "Creating image " . $self->percent . "% the size of $file\n" +; $image = Image::Magick->new; $x = $image->Read($self->source_directory . "/$file"); warn "$x" if "$x"; $x = $image->Resize('geometry' => $self->percent ."%" ); warn "$x" if "$x"; $x = $image->Write($self->output_directory . "/" . $self->prefix . + "$file"); warn $x if $x; } sub make_various_sizes { my ($self,$size_list) = @_; =pod # size list example $size_list = [ { prefix => 'small_', percent => '15' }, { prefix => 'medium_', percent => '50' }, ]; =cut foreach my $size (@{$size_list}) { $self->prefix( $size->{'prefix'} ); $self->percent( $size->{'percent'} ); $self->resize_images(); } } sub resize_images { my ($self) = @_; foreach my $file (@{ $self->{'list'} }) { $self->resize_image($file); } }


It isn't flexible enough though in my opinion if I add it here in one of the code areas or upload it to CPAN. It should provide for, in my opinion, at least the following: Other methods currently store the original image names in an XML configuration file via the XML::Simple module. In the works are XML configuration files that store additional information about the images and at a higher directory level the CD itself. I have rough HTML generators, but I think I can do away with and let the user process the XML or perhaps tie in with some templating module. I don't have much familiarity with the templating modules so that would most likely be a long way off.

I am going to be adding a web interface utility to this to allow for working with existing image stores so any suggestions concerning how people would/are interact(ing) with them currently that might be good to have in here would be help. As for the web interface right now my wife has requested: What other features might be useful in the core module in general?
What might be a good name for this module?
What modules can be recommended to handle some of this as well so I don't reinvent the wheel? I looked at some of the existing ones and most of them require creation of the Caption, Titles, etc. in text files by hand is there one that allows for a web interface creation and edit process?

If what I have started above is already in a module somewhere please point me in the right direction there as well.

While working on this I also created a nice little email image (well any or all attachments really) extractor that works with mbox style mail stores. I used it to parse my wife's Win32 Netscape mail. I will be posting it here once the next release of Mail::MailboxParser since it should have some Win32 issues corrected in it. Is this something that should be included in what I described above, or should it be a seperate module (tree)?

In reply to Object Interface and Module Question by trs80

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.