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.
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.
Re: Image collecting question
that's what i was going to suggest too, but i didn't know the shortcut key for "cut".
Re: Image collecting question
Dude, you are like the Yoda of PC knowledge! Thanks Curtis.
Re: Image collecting question
Jon, you calling Curtis short and ugly?
Re: Image collecting question
Quote:
Originally Posted by
Airbozo
Jon, you calling Curtis short and ugly?
Hey, don't make Yoda mad!
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)
:whistler:
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 "/".
Re: Image collecting question
Quote:
Originally Posted by
Airbozo
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...
Re: Image collecting question
Quote:
Originally Posted by
Airbozo
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.
Re: Image collecting question
You guys better not be calling me green.:evil: