Forums

[Script] Reshade Image Enlarger

A simple tool for enlarging images at high quality

Auteur Réponses
MTres19 Vendredi 22 Mai 2015 à 2:51
MTres19Anonymous

Reshade allows you to greatly enhance the quality of an image resize with five main options: Denoise, Reduce Artifacts, Texture, Accuracy, and Control.

Quote from Reshade's website (reshade.com):

 

Reshade offers high-quality photo resizing for your computer. Enlarge images without the usual blur, jagged edges, halos, loss of sharpness or detail associated with image upscaling. Create accurate, crisp clear, and photorealistic enlargements at almost any zoom factor.

The Reshade window is titled "Pro Version," but this appears to be left over from a time when the software was not available for free. (See http://reshade.com/faq)

 

The installation did not require anything to be done outside of POL and Wine.

 

There were no errors during installation.

 

Here is the script:

#!/bin/bash
# Date : (2015-5-20 5:22 PM)
# Wine version used : 1.6.2
# Distributions used to test : Debian GNU/Linux 8.0 (x64) & Linux Mint 17.1 (x64)
# Author : MTres19

[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"

POL_System_TmpCreate "Reshade"
cd "$POL_System_TmpDir"

PREFIX="Reshade_Enlarger"
TITLE="Reshade Image Enlarger"
WINEVERSION="1.6.2"

POL_GetSetupImages "https://824c862d9a2680948fa53baa62ee056ae123af01.googledrive.com/host/0B_iE50uqUIIbSmRRRHpqdk12Ync" "https://20b94d2646f03039a75fc555605ec5587cdb9349.googledrive.com/host/0B_iE50uqUIIbTEpvenN5akZwZ3c"

POL_SetupWindow_Init
POL_Debug_Init
POL_System_SetArch "x86"

POL_SetupWindow_presentation "Reshade Image Enlarger 3.0" "Reshade Ltd." "reshade.com" "MTres19" "$PREFIX"

POL_Wine_SelectPrefix "$PREFIX"
POL_Wine_PrefixCreate "$WINEVERSION"

POL_Call POL_Install_LunaTheme

POL_SetupWindow_InstallMethod "LOCAL,DOWNLOAD"

if [ $INSTALL_METHOD = "DOWNLOAD" ]
then
  POL_Download "http://reshade.com/static/reshade-install.exe" "8786327bc7209134e9fad15f581fe0cc"
  POL_Wine "reshade-install.exe"
elif [ $INSTALL_METHOD = "LOCAL" ]
then
  POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run.')" "$TITLE"
  RESHADE_INSTALL="$APP_ANSWER"
  POL_Wine "$RESHADE_INSTALL"
fi

cd "$POL_USER_ROOT"
POL_System_TmpDelete

POL_Shortcut "reshade.exe" "Reshade"
POL_SetupWindow_message "$(eval_gettext '$TITLE has been successfully installed')" "$(eval_gettext '$TITLE - Successfully Installed!')"

POL_SetupWindow_Close
exit

 

Here is a screenshot:

Edité par MTres19

Ronin DUSETTE Vendredi 22 Mai 2015 à 3:01
Ronin DUSETTE

Personally, I would be tmp directory stuff in the if statement, to keep the logic together. Plus, as standard practice, you don't really want to run code before your variable declarations. Like this:

if [ $INSTALL_METHOD = "DOWNLOAD" ]
then
  POL_Download "http://reshade.com/static/reshade-install.exe" "8786327bc7209134e9fad15f581fe0cc"
  POL_System_TmpCreate "Reshade"
  cd "$POL_System_TmpDir"
  POL_Wine "reshade-install.exe"
  cd "$POL_USER_ROOT"
  POL_System_TmpDelete

Basically, there is no need to have the tmp folder created globally, and since it is only used in the if statement, it keeps it all in one spot, easier to read, easier to maintain if you need to change something, plus, if you wanted, you could always create and delete the tmp directory multiple times in the conditionals, whereas if it was declared globally, you cannot do that as effectively in the if statements. Not that you would want to do that, but yeah. haha. It is totally up to you, but I would, at the very least, move the TmpCreate statement below where PrefixCreate is, though I recommend the above stated change. :)

Other than that, it doesn't look bad. I am a photographer too, so I am interested in seeing a little more about this application. lol

Edité par RoninDusette


Please:
Post debug logs & full computer specs in first post
No private messages for general help, use the forums
Read the wiki, Report broken scripts
MTres19 Vendredi 22 Mai 2015 à 3:11
MTres19Anonymous

Okay, I've moved the TmpCreate & related commands into the if statement, as you suggested.

#!/bin/bash
# Date : (2015-5-20 5:22 PM)
# Wine version used : 1.6.2
# Distributions used to test : Debian GNU/Linux 8.0 & Linux Mint 17.1
# Author : MTres19

[ "$PLAYONLINUX" = "" ] && exit 0
source "$PLAYONLINUX/lib/sources"

PREFIX="Reshade_Enlarger"
TITLE="Reshade Image Enlarger"
WINEVERSION="1.6.2"

POL_GetSetupImages "https://824c862d9a2680948fa53baa62ee056ae123af01.googledrive.com/host/0B_iE50uqUIIbSmRRRHpqdk12Ync" "https://20b94d2646f03039a75fc555605ec5587cdb9349.googledrive.com/host/0B_iE50uqUIIbTEpvenN5akZwZ3c"

POL_SetupWindow_Init
POL_Debug_Init
POL_System_SetArch "x86"

POL_SetupWindow_presentation "Reshade Image Enlarger 3.0" "Reshade Ltd." "reshade.com" "MTres19" "$PREFIX"

POL_Wine_SelectPrefix "$PREFIX"
POL_Wine_PrefixCreate "$WINEVERSION"

POL_Call POL_Install_LunaTheme

POL_SetupWindow_InstallMethod "LOCAL,DOWNLOAD"

if [ $INSTALL_METHOD = "DOWNLOAD" ]
then
  POL_System_TmpCreate "Reshade"
  cd "$POL_System_TmpDir"
  POL_Download "http://reshade.com/static/reshade-install.exe" "8786327bc7209134e9fad15f581fe0cc"
  POL_Wine "reshade-install.exe"
  POL_System_TmpDelete
elif [ $INSTALL_METHOD = "LOCAL" ]
then
  POL_SetupWindow_browse "$(eval_gettext 'Please select the setup file to run.')" "$TITLE"
  RESHADE_INSTALL="$APP_ANSWER"
  POL_Wine "$RESHADE_INSTALL"
fi

cd "$POL_USER_ROOT"

POL_Shortcut "reshade.exe" "ReShade"
POL_SetupWindow_message "$(eval_gettext '$TITLE has been successfully installed')" "$(eval_gettext '$TITLE - Successfully Installed!')"

POL_SetupWindow_Close
exit

Also, here's Reshade-22x22.png:

The banner and corner images are included in the script, but I'll add them here as well.

top.png:

left.png:

 

Edité par MTres19

Ronin DUSETTE Vendredi 22 Mai 2015 à 3:21
Ronin DUSETTE

That looks much cleaner, too. :) Excellent. Great image resources, as well. Thanks a lot for your contribution. Feel free to submit it in the contribution section, that way we can get it in to the repository. 


Please:
Post debug logs & full computer specs in first post
No private messages for general help, use the forums
Read the wiki, Report broken scripts
Ronin DUSETTE Vendredi 22 Mai 2015 à 3:23
Ronin DUSETTE

Oh, one more thing. Make exit into:

exit 0

(zero, no "oh") at the end of your script. It won't break anything, but if a script completes with success, then it should throw a zero for it's exit code. Again, just good standard practice. :D

One more thing again. haha. Sorry. You can drop the "install successful" statement at the end. It is not needed. 

Edité par RoninDusette


Please:
Post debug logs & full computer specs in first post
No private messages for general help, use the forums
Read the wiki, Report broken scripts