copyright - simplify, remove the cli arg
This commit is contained in:
@@ -49,8 +49,6 @@ def main():
|
||||
parser.add_argument('output_dir', help='output directory')
|
||||
parser.add_argument('--version', action='version',
|
||||
version="%(prog)s version " + __version__)
|
||||
parser.add_argument('-c', '--copyright',
|
||||
help="copyright message added to the images")
|
||||
parser.add_argument("-f", "--force", action='store_true',
|
||||
help="force the reprocessing of existing images")
|
||||
|
||||
@@ -63,9 +61,6 @@ def main():
|
||||
print ":: Reading settings ..."
|
||||
settings = read_settings(os.path.join(args.input_dir, _DEFAULT_CONFIG_FILE))
|
||||
|
||||
if args.copyright:
|
||||
settings['copyright'] = args.copyright
|
||||
|
||||
# create gallery
|
||||
gallery = Gallery(settings, args.input_dir)
|
||||
gallery.build(args.output_dir, force=args.force)
|
||||
|
||||
@@ -44,6 +44,7 @@ class Image:
|
||||
|
||||
def resize(self, size):
|
||||
"resize image"
|
||||
|
||||
if self.img.size[0] > self.img.size[1]:
|
||||
self.img = self.img.resize(size, PILImage.ANTIALIAS)
|
||||
else:
|
||||
@@ -51,8 +52,9 @@ class Image:
|
||||
|
||||
def add_copyright(self, text):
|
||||
"add copyright to image"
|
||||
|
||||
draw = PILImageDraw.Draw(self.img)
|
||||
draw.text((5, self.img.size[1]-15), text)
|
||||
draw.text((5, self.img.size[1]-15), '\xa9 ' + text)
|
||||
|
||||
def thumbnail(self, filename, size, square=False, quality=90):
|
||||
"create thumbnail image for img"
|
||||
@@ -103,9 +105,6 @@ class Gallery:
|
||||
print "Create output directory %s" % self.output_dir
|
||||
os.makedirs(self.output_dir)
|
||||
|
||||
if self.settings['copyright']:
|
||||
self.settings['copyright'] = '\xa9 ' + self.settings['copyright']
|
||||
|
||||
# loop on directories
|
||||
for dirpath, dirnames, imglist in self.filelist():
|
||||
print ":: %s - %i images" % (dirpath, len(imglist))
|
||||
|
||||
Reference in New Issue
Block a user