Adding a new descriptor template

This commit is contained in:
ville rantanen
2013-01-06 13:14:14 +02:00
parent 513650c663
commit b039f42c96
2 changed files with 11 additions and 7 deletions

View File

@@ -39,15 +39,18 @@ def createdesc(path,list,options):
nsum=len(list) nsum=len(list)
for i in list: for i in list:
inpath=os.path.join(path,i) inpath=os.path.join(path,i)
desc=create_description(inpath,options.format) desc=create_description(inpath,options.format).rstrip().replace('\n','<br/>')
outfile.write(i+"\t"+desc) outfile.write(i+"\t"+desc+'\n')
outfile.flush() outfile.flush()
print('('+str(n)+'/'+str(nsum)+') '+i+"\t"+desc[0:-1]) print('('+str(n)+'/'+str(nsum)+') '+i+"\t"+desc)
n+=1 n+=1
return return
def create_description(infile,format): def create_description(infile,format):
idargs=['identify','-format',format,infile+'[0]'] if format=='AbsolutelyEverything':
idargs=['identify','-verbose',infile+'[0]']
else:
idargs=['identify','-format',format,infile+'[0]']
idp=subprocess.Popen(idargs,stdout=subprocess.PIPE) idp=subprocess.Popen(idargs,stdout=subprocess.PIPE)
output = idp.stdout.read() output = idp.stdout.read()
return output return output
@@ -87,7 +90,8 @@ def execute():
presets=[ presets=[
'%f: %[EXIF:DateTimeOriginal]', '%f: %[EXIF:DateTimeOriginal]',
'%f: %wx%h %[size]', '%f: %wx%h %[size]',
'%f<br/><i>%[EXIF:DateTimeOriginal] %[EXIF:ExposureTime]s F%[EXIF:FNumber]</i>'] '%f<br/><i>%[EXIF:DateTimeOriginal] %[EXIF:ExposureTime]s F%[EXIF:FNumber]</i>',
'AbsolutelyEverything']
if options.preset<1: if options.preset<1:
print "Presets:" print "Presets:"
for row in range(len(presets)): for row in range(len(presets)):
@@ -95,7 +99,7 @@ def execute():
sys.exit(0) sys.exit(0)
if options.format=="": if options.format=="":
if options.preset>len(presets): if options.preset>len(presets):
parse.error("No such preset") parser.error("No such preset, list with -p 0")
options.format=presets[options.preset-1] options.format=presets[options.preset-1]
traverse(options.startpath,options) traverse(options.startpath,options)

View File

@@ -993,7 +993,7 @@ function showbigimage(i) {
$('#imagesingle').css('height',height); $('#imagesingle').css('height',height);
} else { // is image } else { // is image
$('#imagecontainer').html('<div id="imagebig">'+linkToBig+ $('#imagecontainer').html('<div id="imagebig">'+linkToBig+
'<img id="imagesingle" src="'+mediumstr+'"></a></div>'); '<img id="imagesingle" src="'+mediumstr+'" title="'+titlestring(imagedesc[i])+'"></a></div>');
$('#imagesingle').css('max-width',width); $('#imagesingle').css('max-width',width);
$('#imagesingle').css('max-height',height); $('#imagesingle').css('max-height',height);
if ($.browser.msie) { // IE does not work with max* if ($.browser.msie) { // IE does not work with max*