Skip navigation
Currently Being Moderated

Organize a total mess of several thousand jpegs into timestamped folders

Jun 24, 2012 1:17 PM

Tags: #photoshop #bridge #files #sorting

Hi!

 

Situation:

My sisters photo collection is a total mess without any rational system to it. Its just illogical structured with folders with generic keywords and thousands of files within each folder. For example, there it's a folder called "travel" where she has just dumped thousands of single files from 10 years of vacations. Not the mention the "various" and "misc" folders. You get the idea. *lol*

 

What I am trying to do:

It does seem like all the photos have the correct EXIF data on them though. So what I'm looking to do is to restructure the collection in folders (with dates taken from EXIF) in a manner similar to this:

 

"/various/filename.jpg" ---> "/2012_06_25/filename.jpg"

"/friends/filename.jpg" ---> "/2012_05_01/filename.jpg"

 

and so on.

 

At least then it gets some kind of chronological structure to it. I want to physically organize the files, not organize them through a database.

 

What is the best approach for doing something like this? I guess I could just batch rename everything from the exif data with Bridge and then organize it from there - but this will still be very tedious. There must be a better way (anyone know of any PS/Bridge scripts that can do this? The more automated the better. I use Bridge and I dont have LR - but if LR can do this it *might* be whats finally pushing me to buy it.

 

I greatly appreciate any advice as to how to go about this!

 
Replies
  • Currently Being Moderated
    Jun 24, 2012 1:39 PM   in reply to dutotone
     
    |
    Mark as:
  • Trevor.Dennis
    1,612 posts
    May 24, 2010
    Currently Being Moderated
    Jun 24, 2012 3:40 PM   in reply to station_two

    I don't know what OS you are using, but even without Bridge it would not be arduous a job. If Windows, then simply setting the folder view option to Details. Right click one of the headings and add ‘Date taken’ (if not already there), and you are in business.

     

    Windows 7 makes it easier still with its clever way to arrange open folders by using the cursor keys in conjunction with the Windows key (between Ctrl and Alt).

     

    [EDIT] I don't like Lightroom and get on well enough with Bridge, but I arrange my images in folders with Year, month, day followed by a meaningful name. i.e. '2012_06_25 meaningful name'. that ensures they display in the right order in folders. Now this is probably not the ideal method, but I actually use flickr to find a particular image. I will generally upload the best few images from a shoot to my flickr stream, and it is easy to find them with the flickr search which will give me a date take. Client folders are kept separate, and as I don't need an income, I am very selective about what client work I take on nowadays, so it is not hard to find the relevant folder. That has only ever happened once when a client lost their digital image files.

     
    |
    Mark as:
  • Trevor.Dennis
    1,612 posts
    May 24, 2010
    Currently Being Moderated
    Jun 24, 2012 8:13 PM   in reply to dutotone

    One thing that would worry me is how old, and what spec your hardware is?  Bridge can get very bogged down with even a few hundred files in a folder.  I can't remember whether this was influenced by the Photoshop/Bridge version number, or just hardware.  If your only criteia for sorting and organising ia date taken, then I would not have thought it too big a job to do manually.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 24, 2012 9:01 PM   in reply to dutotone

    This was also my position before I purchased Lightroom.Now I can view photos monthwise datewise or yearwise amongst other categorisations like name or groups. Lightroom is the best one for file management.Even you can import photos into LR structure without actually moving.Hence your old photos will remain at same place.I preferred to move all my photos in to a separate folder which again has subfolders divided into year,month, date. For a beginner it is daunting to learn,but once you come into grip you enjoy having such a control of your photos

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 25, 2012 2:34 AM   in reply to dutotone

    I think this should be possible with either Photoshop or Bridge depending on what version of Photoshop you have? It would also be useful if you mentioned what OS you are using, as this will make a difference on the choice of Photoshop/Bridge script.

    If you can give this information I will try and put something together.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 25, 2012 7:04 AM   in reply to dutotone

    Ok I will see what I can come up with and get back to you. The compensation I get is managing to achieve a good outcome

    It might be later this evening as I have to go out this afternoon.

     
    |
    Mark as:
  • Currently Being Moderated
    Jun 25, 2012 9:56 AM   in reply to dutotone

    This is a bit rough and ready but should do the job.

    Copy and paste the script into ExtendScript Toolkit, this program is installed at the same time as Photoshop.

    This can be found:- C:\Program Files (x86)\Adobe\Adobe Utilities - CS5

     

    Run the script, it will open Bridge if it was closed, it will then prompt for two folders.

    The first folder it wants is the top level folder of the pictures.

    The second folder is the top level folder where all the new folders will be created and the files moved to.

    This second folder will also contain an error log of any duplicates or files it can't process.

    There will be a folder created called noExif and files will be put there if no exif data

    Once the script is run go for a cup of coffee, the script will give an alert message once finished.

     

     

    #target bridge   
    app.bringToFront();
    main();
    function main(){
    var folders =[];
    var topLevel = Folder.selectDialog("Please select top level folder"); 
    var topLevelOut = Folder.selectDialog("Please select top level output folder"); 
    var errorLog = File(topLevelOut + "/ErrorLog.txt");
    errorLog.open("e", "TEXT", "????");
    errorLog.seek(0,2);
    $.os.search(/windows/i)  != -1 ? errorLog.lineFeed = 'windows'  : errorLog.lineFeed = 'macintosh';
    folders = FindAllFolders(topLevel, folders);
    folders.unshift(topLevel);
    for(var f in folders){
    var FileList = folders[f].getFiles(/\.(jpg|jpe|jpeg|gif|eps|dng|bmp|tif|tiff|psd|crw|cr2|rle|dib|cin|dpx|ps|pcd|pict|vda|icb|vst|wbm|sct|pbm|flm|psb|exr|pcx|pdp|nef|dcr|dc2|erf|raf|orf|tga|mrw|mos|srf|pic|pct|pxr|pdd|pef|png|x3f|raw)$/i);
    for(var z in FileList){
        var newFolder = getExifDate(FileList[z]);
        var moveToFolder = Folder(topLevelOut + "/" + newFolder);
        if(!moveToFolder.exists) moveToFolder.create();
        var testThumb = File(moveToFolder + "/" + FileList[z].name);
        if(!testThumb.exists){
        try{
        new Thumbnail(FileList[z]).moveTo(moveToFolder);
        }catch(e){errorLog.writeln("Unable to process :- " + decodeURI(FileList[z])); continue;}
        }else{
            errorLog.writeln(decodeURI(FileList[z]) + " Is a duplicate in " + decodeURI(moveToFolder));
            }
        }
    }
    errorLog.close();
    alert("Script completed");
    function getExifDate(fileName){
    if (ExternalObject.AdobeXMPScript == undefined) ExternalObject.AdobeXMPScript = new ExternalObject('lib:AdobeXMPScript');
    try{
    var xmpf = new XMPFile(File(fileName).fsName, XMPConst.FILE_UNKNOWN, XMPConst.OPEN_FOR_READ );
    }catch(e) {errorLog.writeln("Unable to process :- " + decodeURI(fileName)); return "noExif";}
    var xmp = xmpf.getXMP();
    var exifdate = xmp.getProperty(XMPConst.NS_EXIF, "DateTimeOriginal");
    xmpf.closeFile(XMPConst.CLOSE_UPDATE_SAFELY);
    try{
    return exifdate.toString().match(/^.{10}/).toString().replace(/-/g,'_');
    }catch(e){return "noExif";}
    }
    function FindAllFolders( srcFolderStr, destArray) {
     var fileFolderArray = Folder( srcFolderStr ).getFiles();
     for ( var i = 0; i < fileFolderArray.length; i++ ) {
      var fileFoldObj = fileFolderArray[i];
      if ( fileFoldObj instanceof File ) {   
      } else {
             destArray.push( Folder(fileFoldObj) );
      FindAllFolders( fileFoldObj.toString(), destArray );
      }
     }
     return destArray;
    };
    }
    
    
     
     
    |
    Mark as:
  • Currently Being Moderated
    Jun 25, 2012 1:20 PM   in reply to dutotone

    Glad it's of use, yes I have a place for a few scripts..

    http://www.scriptsrus.talktalk.net/

     

    If you want to learn Photoshop/Bridge scripting another great place is:

     

    http://www.ps-scripts.com/bb/

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (1)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points