mirror of
https://github.com/Xevion/sharex-quickzoom.git
synced 2025-12-08 06:08:22 -06:00
qt-creator init
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@@ -6,6 +6,8 @@
|
|||||||
*.jpeg
|
*.jpeg
|
||||||
*.gif
|
*.gif
|
||||||
*.dat
|
*.dat
|
||||||
|
/qt-creator/*
|
||||||
|
!/qt-creator/sharex-quickzoom/mainwindow.ui
|
||||||
|
|
||||||
# Byte-compiled / optimized / DLL files
|
# Byte-compiled / optimized / DLL files
|
||||||
__pycache__/
|
__pycache__/
|
||||||
|
|||||||
@@ -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.
|
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
|
**os** - Path managemennt
|
||||||
|
|
||||||
|
|||||||
34
main.py
34
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(' '))
|
|
||||||
34
process.py
Normal file
34
process.py
Normal file
@@ -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(' '))
|
||||||
24
qt-creator/sharex-quickzoom/mainwindow.ui
Normal file
24
qt-creator/sharex-quickzoom/mainwindow.ui
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
<ui version="4.0">
|
||||||
|
<class>MainWindow</class>
|
||||||
|
<widget class="QMainWindow" name="MainWindow" >
|
||||||
|
<property name="geometry" >
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>400</width>
|
||||||
|
<height>300</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle" >
|
||||||
|
<string>MainWindow</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QMenuBar" name="menuBar" />
|
||||||
|
<widget class="QToolBar" name="mainToolBar" />
|
||||||
|
<widget class="QWidget" name="centralWidget" />
|
||||||
|
<widget class="QStatusBar" name="statusBar" />
|
||||||
|
</widget>
|
||||||
|
<layoutDefault spacing="6" margin="11" />
|
||||||
|
<pixmapfunction></pixmapfunction>
|
||||||
|
<resources/>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
Reference in New Issue
Block a user