[KPhotoAlbum] Patch: file types as subcategories of media type

Robert L Krawitz rlk at alum.mit.edu
Tue Jan 2 12:44:26 CET 2007


   From: Michael J Gruber <michaeljgruber+gmane+kimdaba at fastmail.fm>
   Date: Tue, 02 Jan 2007 11:54:39 +0100

   Description:
   This patch automatically lists all file types as subcategories of the
   media type.

   Example:
   -Image
   --cr2
   --jpg
   --png
   -Video
   --mov

   Purpose:
   For me it's a first step towards a better "raw workflow". With the
   patch, I can easily browse jpg+cr2 when weeding out images or just jpg
   when viewing and album or doing a slide show. Also, it's an easy way to
   get statistics about  the usage of certain file types (I never knew I
   had a png in there...). In some sense it replaces the option to "ignore
   raw files" which is an all or nothing option.

   Caveats:
   - Similar code is used for reading images from the DB and for new
   images; it might be better to put it into a new ImageInfo method
   addMediaTypeInfo().

   - As implemented, the file type is the last 3 letters of the file name,
   converted to lower case. This is consistent with what KPA does in other
   places and works with all files coming from 8+3 FAT file systems (such
   as from a camera). It doesn't cover file endings like "jpeg", "mpeg" or
   "tiff", but that's an easy fix if desired.

I think this should be done -- it's simply a matter of looking for the
rightmost `.'.  Another question is case sensitivity -- should this be
case sensitive or not?  I'd say probably not (as you've done here).

   Let me know if you want me to smooth things out (ImageInfo method, file
   types with other lengths).

This is much better than "ignore raw files" -- depending upon what I'm
doing, sometimes I'd like to use the RAW images and sometimes I'd like
to use the JPEGs.  It's not going to be very practical to use this on
large collections of images until subcategories are sped up, though.

-- 
Robert Krawitz                                     <rlk at alum.mit.edu>

Tall Clubs International  --  http://www.tall.org/ or 1-888-IM-TALL-2
Member of the League for Programming Freedom -- mail lpf at uunet.uu.net
Project lead for Gutenprint   --    http://gimp-print.sourceforge.net

"Linux doesn't dictate how I work, I dictate how Linux works."
--Eric Crampton


More information about the KPhotoAlbum mailing list