コード例 #1
0
ファイル: dnd.py プロジェクト: hgdeoro/GarnishMyPic
    def OnDropFiles(self, x, y, filenames):
        """
        When files are dropped, write where they were dropped and then
        the file paths themselves
        """
        self.window.SetInsertionPointEnd()
        self.window.clearText()
        for filepath in filenames:
            self.window.updateText(filepath + '\n')

            self.window.updateText(" + Procesing " + os.path.normpath(os.path.abspath(filepath)) + "...")
            self.window.refreshWindow()
            exit_status = do_garnish(filepath, GMP_OUTPUT_DIR,
                author=GMP_AUTHOR,
                overwrite=True,
                font_file=GMP_FONT,
                font_size=GMP_DEFAULT_FONT_SIZE,
                output_quality=GMP_OUTPUT_QUALITY,
                border_size=GMP_BORDER,
                border_color=GMP_COLOR,
                border_size_bottom=BORDER_SIZE_BOTTOM,
                max_size=[int(x) for x in GMP_DEFAULT_MAX_SIZE.split('x')],
                title=GMP_TITLE,
                title_img=GMP_TITLE_IMAGE,
                year=datetime.date.today().year,
                technical_info=True,
                exif_copyright=GMP_EXIF_COPYRIGHT,
                rotate=0,
            )
            self.window.updateText(" OK\n")
            self.window.refreshWindow()

        self.window.updateText("\nFinished!\n")
コード例 #2
0
ファイル: garnish.py プロジェクト: hgdeoro/GarnishMyPic
    try:
        max_size = [int(size) for size in args.max_size.split('x')]
    except KeyError:
        parser.error("Wrong --max-size: must specify in the form WIDTHxHEIGHT (ej: 800x800)")
    except ValueError:
        parser.error("Wrong --max-size: must specify in the form WIDTHxHEIGHT (ej: 800x800)")

    if len(max_size) != 2:
        parser.error("Wrong --max-size: must specify in the form WIDTHxHEIGHT (ej: 800x800)")

    for input_file in args.input_files:
        exit_status = do_garnish(input_file, args.output_dir,
            author=args.author,
            overwrite=args.overwrite,
            font_file=args.font,
            font_size=args.font_size,
            output_quality=args.output_quality,
            border_size=args.border_size,
            border_color=args.border_color,
            border_size_bottom=BORDER_SIZE_BOTTOM,
            max_size=max_size,
            title=args.title,
            title_img=args.title_img,
            year=args.year,
            technical_info=args.technical_info,
            exif_copyright=args.exif_copyright,
            rotate=args.rotate,
        )

    sys.exit(exit_status)