add independent packaging scripts

This commit is contained in:
2023-06-04 15:43:21 +02:00
parent 0ea2d1d375
commit ab6d07d4bd
6 changed files with 103 additions and 18 deletions

View File

@@ -59,20 +59,20 @@ This App also features a CLI interface (reference out of date).
# Contributing # Contributing
If you have any suggestions or features you'd like to have implemented, you may either implement the feature yourself and open a pull request, or open an issue on this GitHub page. Both things are appreciated! If you have any suggestions or features you'd like to have implemented, you may either implement the feature yourself and open a pull request, or open an issue on this GitHub page. Both things are appreciated!
*I am looking for somebody willing to maintain the Windows version (including installer) as I am running Linux*
--> Follow the rules layed out in CONTRIBUTING.md --> Follow the rules layed out in CONTRIBUTING.md
--> We will add a linter that will then run on circleci to ensure code quality is high --> We will add a linter that will then run on circleci to ensure code quality is high
### Current Contributers ### Current Contributers
- simplePCBuilding (Maintainer) [Core (CLI), Docs, Website, Frontend, Linux packages] - simplePCBuilding (Maintainer) [Core (CLI), Docs, Website, Frontend, Linux packages]
- ThatPlasma (Testing, Packager) [Testing, Windows Package] - ThatPlasma (Testing, Packager) [Testing]
# Roadmap # Roadmap
V2.0.0: V2.0.0:
- Migrate to Electron app - Migrate to Electron app -- ✅
- Package Windows & Linux Version - Package Windows & Linux Version -- ✅
- Add packaging script for Linux & Windows version -- ✅
- Make python app CLI only -- ✅ - Make python app CLI only -- ✅
- Refactor backend to add plugin support -- ✅ - Refactor backend to add plugin support -- ✅

View File

@@ -39,6 +39,8 @@ class UpscalingHandler {
// add additional options // add additional options
// baseCommand += + ' -S ' + options.sharpening // baseCommand += + ' -S ' + options.sharpening
// baseCommand += ' -E ' + options.engine + ' -M ' + options.algorithm // baseCommand += ' -E ' + options.engine + ' -M ' + options.algorithm
console.log( 'upscaling' );
let child = child_process.spawn( baseCommand, args ); let child = child_process.spawn( baseCommand, args );
@@ -52,6 +54,7 @@ class UpscalingHandler {
} ); } );
child.on( 'error', ( error ) => { child.on( 'error', ( error ) => {
console.log( 'An error occurred' + error );
new Notification( { title: `ImageVideoUpscaler - Error whilst upscaling', body: 'Your upscaling Job encountered an error whilst upscaling. (Error message: ${ error.message }).`} ) new Notification( { title: `ImageVideoUpscaler - Error whilst upscaling', body: 'Your upscaling Job encountered an error whilst upscaling. (Error message: ${ error.message }).`} )
} ); } );

View File

@@ -12,11 +12,15 @@
<option v-for="engine in engines[ upscaleSettings.engine ][ 'modes' ]" :key="engine.id" :value="engine.id">{{ engine.displayName }}</option> <option v-for="engine in engines[ upscaleSettings.engine ][ 'modes' ]" :key="engine.id" :value="engine.id">{{ engine.displayName }}</option>
</select><br> </select><br>
<label for="scale" v-if="engines[ upscaleSettings.engine ][ 'supports' ].includes( 'upscaling' )">Scale factor</label><br> <div v-if="engines[ upscaleSettings.engine ][ 'supports' ].includes( 'upscaling' )">
<input type="number" name="scale" id="scale" v-model="upscaleSettings.scale" min="2" max="4" onkeydown="return false">x<br> <label for="scale">Scale factor</label><br>
<input type="number" name="scale" id="scale" v-model="upscaleSettings.scale" min="2" max="4" onkeydown="return false">x<br>
</div>
<label for="sharpening" v-if="engines[ upscaleSettings.engine ][ 'supports' ].includes( 'sharpening' )">Sharpening factor</label><br> <div v-if="engines[ upscaleSettings.engine ][ 'supports' ].includes( 'sharpening' )">
<input type="number" step="0.01" name="scale" id="scale" v-model="upscaleSettings.sharpening" min="0" max="1"><br> <label for="sharpening">Sharpening factor</label><br>
<input type="number" step="0.01" name="scale" id="scale" v-model="upscaleSettings.sharpening" min="0" max="1"><br>
</div>
<button @click="runCommand( 'InputFile' )">Input file</button><br> <button @click="runCommand( 'InputFile' )">Input file</button><br>
<button @click="runCommand( 'OutputFile' )">Output file</button><br> <button @click="runCommand( 'OutputFile' )">Output file</button><br>
@@ -68,7 +72,7 @@ export default {
data() { data() {
return { return {
upscaleSettings: { 'engine': 'ffc', 'algorithm': 'fsr', 'scale': 2, 'sharpening': 0, 'InputFile': [ '/home/janis/projects/myevent/assets/logo.png' ], 'OutputFile': '/home/janis/Downloads/test.png' }, upscaleSettings: { 'engine': 'ffc', 'algorithm': 'fsr', 'scale': 2, 'sharpening': 0, 'InputFile': [ '/home/janis/projects/myevent/assets/logo.png' ], 'OutputFile': '/home/janis/Downloads/test.png' },
engines: { 'ffc':{ 'displayName': 'FidelityFX CLI', 'id': 'ffc', 'modes': { 'fsr': { 'displayName': 'FidelityFX Super Resolution', 'id': 'fsr' } }, 'supports': [ 'upscaling', 'sharpening' ] }, 'ss':{ 'displayName': 'REAL-ESGRAN', 'id': 'ss' } }, engines: { 'ffc':{ 'displayName': 'FidelityFX CLI', 'id': 'ffc', 'modes': { 'fsr': { 'displayName': 'FidelityFX Super Resolution', 'id': 'fsr' }, 'c': { 'displayName': 'Cubic', 'id': 'c' }, 'hqc': { 'displayName': 'High Quality Cubic', 'id': 'hqc' } }, 'supports': [ 'upscaling', 'sharpening' ] }, 'ss':{ 'displayName': 'REAL-ESRGAN', 'id': 'ss', 'modes': { 'av3': { 'displayName': 'realesr-animevideov3', 'id': 'av3' }, 'x4plus': { 'displayName': 'realesrgan-x4plus-anime', 'id': 'x4plus' } }, 'supports': [ 'upscaling' ] } },
fixed: false, fixed: false,
output: '', output: '',
} }

View File

@@ -4,15 +4,15 @@ cd ..
# Compile for Linux # Compile for Linux
pyinstaller imagevideoupscaler.spec pyinstaller imagevideoupscaler.spec
cp -r ./dist/imagevideoupscaler/* ./frontend/ cp -rv ./dist/imagevideoupscaler/* ./frontend/
# Copy python files # Copy python files
cp -r ./bin ./frontend/ cp -rv ./bin ./frontend/
cp -r ./config ./frontend/ cp -rv ./config ./frontend/
cp ./imagevideoupscaler-cli.py ./frontend/ cp -v ./imagevideoupscaler-cli.py ./frontend/
cp ./LICENSE ./frontend/ cp -v ./LICENSE ./frontend/
cp ./logo.png ./frontend/ cp -v ./logo.png ./frontend/
# package for Linux (includes GUI & CLI) # package for Linux (includes GUI & CLI)
@@ -34,8 +34,8 @@ printf '\n\n==> Finished Linux packaging, preparing Windows\n\n'
# Compile for Windows # Compile for Windows
wine python -m PyInstaller imagevideoupscaler.spec wine python -m PyInstaller imagevideoupscaler.spec
cp -r ./dist/imagevideoupscaler/* ./frontend/ cp -rv ./dist/imagevideoupscaler/* ./frontend/
cp -v ./imagevideoupscaler-cli.py ./frontend/
# package for Windows (includes GUI & CLI) # package for Windows (includes GUI & CLI)
cd frontend cd frontend
@@ -46,7 +46,11 @@ rm -rf ./config
rm -rf ./lib-dynload rm -rf ./lib-dynload
rm ./image* rm ./image*
rm ./_* rm ./_*
rm ./imagevideoupscaler-cli.py rm ./py*
rm ./lib*
rm ./base_library.zip
rm ./*.pyd
rm ./*.dll
rm ./LICENSE rm ./LICENSE
cd .. cd ..

37
packaging/packageLinux.sh Executable file
View File

@@ -0,0 +1,37 @@
#! /bin/bash
cd ..
# Compile for Linux
pyinstaller imagevideoupscaler.spec
cp -r ./dist/imagevideoupscaler/* ./frontend/
# Copy python files
cp -r ./bin ./frontend/
cp -r ./config ./frontend/
cp ./imagevideoupscaler-cli.py ./frontend/
cp ./LICENSE ./frontend/
cp ./logo.png ./frontend/
# package for Linux (includes GUI & CLI)
cd frontend
npm run electron:build -- --linux deb rpm
rm -rf ./bin
rm -rf ./config
rm -rf ./libdynload
rm ./image*
rm ./lib*
rm ./ld*
rm ./base_library.zip
rm ./imagevideoupscaler-cli.py
rm ./LICENSE
cd ..
rm -rf ./build
rm -rf ./dist
printf '\n\n==> DONE\n\n'

37
packaging/packageWindows.sh Executable file
View File

@@ -0,0 +1,37 @@
#! /bin/bash
cd ..
# Compile for Windows
wine python -m PyInstaller imagevideoupscaler.spec
cp -r ./dist/imagevideoupscaler/* ./frontend/
# Copy python files
cp -rv ./bin ./frontend/
cp -rv ./config ./frontend/
cp -v ./imagevideoupscaler-cli.py ./frontend/
cp -v ./LICENSE ./frontend/
cp -v ./logo.png ./frontend/
# package for Windows (includes GUI & CLI)
cd frontend
npm run electron:build -- --win nsis
rm -rf ./bin
rm -rf ./config
rm -rf ./lib-dynload
rm ./image*
rm ./_*
rm ./py*
rm ./lib*
rm ./base_library.zip
rm ./*.pyd
rm ./*.dll
rm ./LICENSE
cd ..
rm -rf ./build
rm -rf ./dist
printf '\n\n==> DONE\n\n'