From 6223fcfd7ba3e910dbec4789879c59ea39c3d0d6 Mon Sep 17 00:00:00 2001 From: Xevion Date: Sat, 3 Aug 2019 23:07:19 -0500 Subject: [PATCH] qt-creator init --- .gitignore | 2 ++ README.md | 2 +- gui.py | 0 main.py | 34 ----------------------- process.py | 34 +++++++++++++++++++++++ qt-creator/sharex-quickzoom/mainwindow.ui | 24 ++++++++++++++++ 6 files changed, 61 insertions(+), 35 deletions(-) create mode 100644 gui.py create mode 100644 process.py create mode 100644 qt-creator/sharex-quickzoom/mainwindow.ui diff --git a/.gitignore b/.gitignore index 66920e4..f031996 100644 --- a/.gitignore +++ b/.gitignore @@ -6,6 +6,8 @@ *.jpeg *.gif *.dat +/qt-creator/* +!/qt-creator/sharex-quickzoom/mainwindow.ui # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/README.md b/README.md index 244299b..1afacb3 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ The effect may reach into being just zoom for radially, depending on how far I c In case you wish to use this repo, these are the utilties you will require. -### [./main.py](./clean.py) +### [./main.py](./process.py) **os** - Path managemennt diff --git a/gui.py b/gui.py new file mode 100644 index 0000000..e69de29 diff --git a/main.py b/main.py index 63a87fa..e69de29 100644 --- a/main.py +++ b/main.py @@ -1,34 +0,0 @@ -import os, sys, argparse, subprocess - -# Simple tester for testing whether a file exists. -# StackOverflow https://stackoverflow.com/a/51212150/6912830 -def file_path(string): - if os.path.isfile(string): - return string - else: - raise NotADirectoryError(string) - -# Argparser -# parser = argparse.ArgumentParser() -# parser.add_argument('path', metavar='PATH', type=file_path, help='the full path to the file in question') -# args = parser.parse_args() - -# print(args.path) - -# Image Processing -command_args = "5x0+90+450" - -base_path = sys.path[0] -blur_map = os.path.join(base_path, 'blur_map_polar.jpg') -input_path = os.path.join(base_path, 'blur_radial.jpg') -output_path = os.path.join(base_path, 'output.jpg') - -for path in [base_path, blur_map, input_path, output_path]: - if not os.path.exists(path): - raise Exception('Invalid File Name') - - -# command = ['magick convert', input_path, blur_map, '-compose blur', '-define', 'compose:args=' + command_args, '-composite ', output_path] -command = 'magick convert {} {} -compose blur -define compose:args={} -composite {}'.format(input_path, blur_map, command_args, output_path) -print(command) -subprocess.run(command.split(' ')) \ No newline at end of file diff --git a/process.py b/process.py new file mode 100644 index 0000000..63a87fa --- /dev/null +++ b/process.py @@ -0,0 +1,34 @@ +import os, sys, argparse, subprocess + +# Simple tester for testing whether a file exists. +# StackOverflow https://stackoverflow.com/a/51212150/6912830 +def file_path(string): + if os.path.isfile(string): + return string + else: + raise NotADirectoryError(string) + +# Argparser +# parser = argparse.ArgumentParser() +# parser.add_argument('path', metavar='PATH', type=file_path, help='the full path to the file in question') +# args = parser.parse_args() + +# print(args.path) + +# Image Processing +command_args = "5x0+90+450" + +base_path = sys.path[0] +blur_map = os.path.join(base_path, 'blur_map_polar.jpg') +input_path = os.path.join(base_path, 'blur_radial.jpg') +output_path = os.path.join(base_path, 'output.jpg') + +for path in [base_path, blur_map, input_path, output_path]: + if not os.path.exists(path): + raise Exception('Invalid File Name') + + +# command = ['magick convert', input_path, blur_map, '-compose blur', '-define', 'compose:args=' + command_args, '-composite ', output_path] +command = 'magick convert {} {} -compose blur -define compose:args={} -composite {}'.format(input_path, blur_map, command_args, output_path) +print(command) +subprocess.run(command.split(' ')) \ No newline at end of file diff --git a/qt-creator/sharex-quickzoom/mainwindow.ui b/qt-creator/sharex-quickzoom/mainwindow.ui new file mode 100644 index 0000000..6050363 --- /dev/null +++ b/qt-creator/sharex-quickzoom/mainwindow.ui @@ -0,0 +1,24 @@ + + MainWindow + + + + 0 + 0 + 400 + 300 + + + + MainWindow + + + + + + + + + + +