Page 1 of 2 12 LastLast
Results 1 to 10 of 11

Thread: Image collecting question

  1. #1
    iShot the Sheriff jdbnsn's Avatar
    Join Date
    Jan 2006
    Location
    Normal
    Posts
    8,241

    Default Image collecting question

    Does anyone know a good way to collect photos from many subdirectories and pool them all into a single folder? I saw something about picaso but maybe someone here knows a better way. I have a folder with hundreds of folders within and each sub folder has images that I want to collect into one folder without opening and dragging each one at a time.

  2. #2
    Administrator OvRiDe's Avatar
    Join Date
    Dec 2005
    Location
    Tulsa, OK
    Posts
    4,586

    Default Re: Image collecting question

    Probably your easiest bet is Windows Search. Go to the root of the top level folder that contains all the images/subdirs of image and search for "*.jpg". Once the Search is complete, use a "Ctrl+A" so select all the results, then "Ctrl+X" to cut those results. Go create your new folder, and "Ctrl+V" to paste it. If you have more then one image type ie. png, gif, etc etc... then just repeat the process for those file types. Voila! You should be left with a single dir with all your pics.
    Last edited by OvRiDe; 02-25-2011 at 03:23 PM.

  3. #3
    Custom Title Honors
    Join Date
    Feb 2011
    Posts
    1,078

    Default Re: Image collecting question

    that's what i was going to suggest too, but i didn't know the shortcut key for "cut".

  4. #4
    iShot the Sheriff jdbnsn's Avatar
    Join Date
    Jan 2006
    Location
    Normal
    Posts
    8,241

    Default Re: Image collecting question

    Dude, you are like the Yoda of PC knowledge! Thanks Curtis.

  5. #5
    Yuk it up Monkey Boy! Airbozo's Avatar
    Join Date
    Jun 2006
    Location
    In the Redwoods
    Posts
    5,272

    Default Re: Image collecting question

    Jon, you calling Curtis short and ugly?
    "...Dumb all over, A little ugly on the side... "...Frank Zappa...

  6. #6
    Fox Furry crenn's Avatar
    Join Date
    Apr 2005
    Location
    In the shadows behind you
    Posts
    4,067

    Default Re: Image collecting question

    Quote Originally Posted by Airbozo View Post
    Jon, you calling Curtis short and ugly?
    Hey, don't make Yoda mad!
    Antec Sonata II | Pioneer DVR-212
    Good news! You can follow my website or follow me on twitter!

  7. #7
    Will YOU be ready when the zombies rise? x88x's Avatar
    Join Date
    Oct 2008
    Location
    MD, USA
    Posts
    6,334

    Default Re: Image collecting question

    Code:
    #!python
    import os
    import sys
    import shutil
    
    srcdir = sys.argv[1]
    destdir = sys.argv[2]
    
    extensions = ['jpg','jpeg','png','gif','bmp']
    
    def copyfile(source, dest):
    	if(os.path.exists(source)):
    		shutil.copy(source,dest)
    
    def cleanpath(path):
    	if(path[-1] != "\\"):
    		path = path + "\\"
    	return path
    
    def treecopy(dir):
    	dir = dir.strip()
    	dir = cleanpath(dir)
    	srcdir = cleanpath(srcdir)
    	
    	contents = os.listdir(dir)
    	max = len(contents)
    	pos = 0
    	while(pos < max):
    		entry = contents[pos]
    		if(os.path.isfile(dir + entry)):
    			for ext in extensions:
    				if(entry[entry.rindex(".")+1:].lower().find(x.lower()) > -1):
    					source = srcdir + entry
    					copyfile(source,destdir)
    		elif(os.path.isdir(dir + entry)):
    			subdir = os.listdir(dir + entry)
    			for each in subdir:
    				each = entry + "\\" + each
    				contents.append(each)
    				max += 1
    		pos += 1
    
    treecopy(destdir)


    EDIT:
    Actually, that would have just copied all the files. Fixed to only copy specified extensions.

    EDIT2:
    BTW, if using on a unix-like system, replace the "\\" characters with "/".
    That we enjoy great advantages from the inventions of others, we should be glad of an opportunity to serve others by any invention of ours, and this we should do freely and generously.
    --Benjamin Franklin
    TBCS 5TB Club :: coilgun :: bench PSU :: mightyMite :: Zeus :: E15 Magna EV

  8. #8
    iShot the Sheriff jdbnsn's Avatar
    Join Date
    Jan 2006
    Location
    Normal
    Posts
    8,241

    Default Re: Image collecting question

    Quote Originally Posted by Airbozo View Post
    Jon, you calling Curtis short and ugly?
    no no no not at all, you misunderstood my intentions. I just meant that he a very in-depth knowledge of the computer force, a way with words, ...and a very trademark managerial style...


  9. #9
    If you can't hack it, you don't own it! Oneslowz28's Avatar
    Join Date
    Mar 2007
    Location
    Aiken, Sc
    Posts
    5,084

    Default Re: Image collecting question

    Quote Originally Posted by Airbozo View Post
    Jon, you calling Curtis short and ugly?
    Well Curtis is short and ugly.

    I do think it was wrong to insult him like that though.....











    Yoda I mean.

  10. #10
    Administrator OvRiDe's Avatar
    Join Date
    Dec 2005
    Location
    Tulsa, OK
    Posts
    4,586

    Default Re: Image collecting question

    You guys better not be calling me green.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •