Skip to content

Commit

Permalink
2.1.0.2
Browse files Browse the repository at this point in the history
* Corrected :
- Time out on the new experimental function (Hash with SSH command
directly on the PI)
- Add a \ before space and ' when Hash from the PI
* Added :
- 7za.exe instead of standard windows dll.
- Experimental Option to Hash from the PI in General option.
- New MIX Template in repository (thank you Brandoskey)
  • Loading branch information
Universal-Rom-Tools committed Jan 4, 2017
1 parent f808496 commit c5fb6eb
Show file tree
Hide file tree
Showing 17 changed files with 258 additions and 66 deletions.
131 changes: 99 additions & 32 deletions Include/_MyFunction.au3
@@ -1,5 +1,44 @@
#Region MISC Function

; #FUNCTION# ===================================================================================================
; Name...........: _Unzip
; Description ...: Unzip with 7za
; Syntax.........: _Unzip($iPathZip , $iPathTarget)
; Parameters ....: $iPathZip - Zip Path
;~ $iPathTarget - Target folder path
; Return values .: Success - Return the target folder path
; Failure - -1
; Author ........: Screech inspiration : wakillon
; Modified.......:
; Remarks .......:
; Related .......:
; Link ..........;
; Example .......; https://www.autoitscript.com/forum/topic/122168-tinypicsharer-v-1034-new-version-08-june-2013/
Func _Unzip($iPathZip, $iPathTarget)
Local $sRun, $iPid, $_StderrRead
Local $sDrive, $sDir, $sFileName, $iExtension, $iPath_Temp
_PathSplit($iPathZip, $sDrive, $sDir, $sFileName, $iExtension)
If StringLower($iExtension) <> ".zip" Then
_LOG("Not a ZIP file : " & $iPathZip, 2, $iLOGPath)
Return -1
EndIf
$sRun = '"' & $iScriptPath & '\Ressources\7za.exe" e "' & $iPathZip & '" -o"' & $iPathTarget & '"'
_LOG("7za command: " & $sRun, 1, $iLOGPath)
$iPid = Run($sRun, '', @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
While ProcessExists($iPid)
$_StderrRead = StderrRead($iPid)
If Not @error And $_StderrRead <> '' Then
If StringInStr($_StderrRead, 'ERRORS') And Not StringInStr($_StderrRead, 'Everything is Ok') Then
_LOG("Error while unziping " & $iPathZip, 2, $iLOGPath)
Return -2
EndIf
EndIf
WEnd
_LOG("Unziped : " & $iPathZip & " to " & $iPathTarget, 0, $iLOGPath)
Return $iPathTarget
EndFunc ;==>_Unzip


; #FUNCTION# ===================================================================================================
; Name...........: _URIEncode
; Description ...: Create a valid URL
Expand All @@ -13,22 +52,22 @@
; Link ..........; https://www.autoitscript.com/forum/topic/95850-url-encoding/
; Example .......; No
Func _URIEncode($sData)
Local $aData = StringSplit(BinaryToString(StringToBinary($sData,4),1),"")
Local $nChar
$sData=""
For $i = 1 To $aData[0]
$nChar = Asc($aData[$i])
Switch $nChar
Case 45, 46, 48-57, 65 To 90, 95, 97 To 122, 126
$sData &= $aData[$i]
Case 32
$sData &= "+"
Case Else
$sData &= "%" & Hex($nChar,2)
EndSwitch
Next
Return $sData
EndFunc
Local $aData = StringSplit(BinaryToString(StringToBinary($sData, 4), 1), "")
Local $nChar
$sData = ""
For $I = 1 To $aData[0]
$nChar = Asc($aData[$I])
Switch $nChar
Case 45, 46, 48 - 57, 65 To 90, 95, 97 To 122, 126
$sData &= $aData[$I]
Case 32
$sData &= "+"
Case Else
$sData &= "%" & Hex($nChar, 2)
EndSwitch
Next
Return $sData
EndFunc ;==>_URIEncode

; #FUNCTION# ===================================================================================================
; Name...........: _LOG_Ceation
Expand Down Expand Up @@ -351,8 +390,8 @@ Func _SelectGUI($aSelectionItem, $default = -1, $vText = "standard", $vLanguageS
Local $_Selector_gui_Label = GUICtrlCreateLabel(_MultiLang_GetText("win_sel_" & $vText & "_text"), 8, 8, 212, 33)

;Create List of available Items
For $i = 0 To UBound($aSelectionItem) - 1
GUICtrlSetData($_Selector_gui_Combo, $aSelectionItem[$i][0], "(" & _MultiLang_GetText("win_sel_" & $vText & "_Title") & ")")
For $I = 0 To UBound($aSelectionItem) - 1
GUICtrlSetData($_Selector_gui_Combo, $aSelectionItem[$I][0], "(" & _MultiLang_GetText("win_sel_" & $vText & "_Title") & ")")
Next

GUISetState(@SW_SHOW)
Expand All @@ -369,14 +408,14 @@ Func _SelectGUI($aSelectionItem, $default = -1, $vText = "standard", $vLanguageS
;~ MsgBox(0,"$_selected",$_selected)
;~ _ArrayDisplay($aSelectionItem,"$aSelectionItem")

For $i = 0 To UBound($aSelectionItem) - 1
If $aSelectionItem[$i][0] = $_selected Then
For $I = 0 To UBound($aSelectionItem) - 1
If $aSelectionItem[$I][0] = $_selected Then
If $vLanguageSelector = 1 Then
_LOG("Value selected : " & StringLeft($aSelectionItem[$i][2], 4), 1, $iLOGPath)
Return StringLeft($aSelectionItem[$i][2], 4)
_LOG("Value selected : " & StringLeft($aSelectionItem[$I][2], 4), 1, $iLOGPath)
Return StringLeft($aSelectionItem[$I][2], 4)
Else
_LOG("Value selected : " & $aSelectionItem[$i][2], 1, $iLOGPath)
Return $aSelectionItem[$i][2]
_LOG("Value selected : " & $aSelectionItem[$I][2], 1, $iLOGPath)
Return $aSelectionItem[$I][2]
EndIf
EndIf
Next
Expand Down Expand Up @@ -529,7 +568,7 @@ Func _Compression($iPath, $isoft = 'pngquant.exe', $iParamater = '--force --verb
Return -1
EndIf
$vPathSize = _ByteSuffix(FileGetSize($iPath))
$sRun = '"' & $iScriptPath & '\Ressources\pngquant.exe" ' & $iParamater & ' "' & $iPath &'"'
$sRun = '"' & $iScriptPath & '\Ressources\pngquant.exe" ' & $iParamater & ' "' & $iPath & '"'
_LOG("PNGQuant command: " & $sRun, 1, $iLOGPath)
$iPid = Run($sRun, '', @SW_HIDE, $STDERR_CHILD + $STDOUT_CHILD)
While ProcessExists($iPid)
Expand Down Expand Up @@ -598,7 +637,7 @@ Func _GDIPlus_ResizeMax($iPath, $iMAX_Width, $iMAX_Height)
If $iWidth_New > $iMAX_Width Then
$iWidth_New = $iMAX_Width
$iHeight_New = $iWidth_New * $iRatio
_LOG("$iWidth_New too BIG $iSize_New " & $iWidth_New & " x " & $iHeight_New &"("&$iHeight_New/$iWidth_New&")", 2, $iLOGPath)
_LOG("$iWidth_New too BIG $iSize_New " & $iWidth_New & " x " & $iHeight_New & "(" & $iHeight_New / $iWidth_New & ")", 2, $iLOGPath)
EndIf
$iWidth_New = Int($iWidth_New)
$iHeight_New = Int($iHeight_New)
Expand Down Expand Up @@ -1092,6 +1131,8 @@ Func _GDIPlus_Imaging($iPath, $aPicParameters, $vTarget_Width, $vTarget_Height)
Local $Image_C2Y = _GDIPlus_RelativePos($aPicParameters[5], $vTarget_Height)
Local $Image_C3X = _GDIPlus_RelativePos($aPicParameters[6], $vTarget_Width)
Local $Image_C3Y = _GDIPlus_RelativePos($aPicParameters[7], $vTarget_Height)
Local $Image_C4X = _GDIPlus_RelativePos($aPicParameters[11], $vTarget_Width)
Local $Image_C4Y = _GDIPlus_RelativePos($aPicParameters[12], $vTarget_Height)
Switch $Image_C2X
Case 'CENTER'
$Image_C2X = Int(($vTarget_Width / 2) + ($iWidth / 2))
Expand Down Expand Up @@ -1132,15 +1173,43 @@ Func _GDIPlus_Imaging($iPath, $aPicParameters, $vTarget_Width, $vTarget_Height)
Case ''
$Image_C3Y = $Image_C1Y + $iHeight
EndSwitch
Switch $Image_C4X
Case 'CENTER'
$Image_C4X = Int(($vTarget_Width / 2) + ($iWidth / 2))
Case 'LEFT'
$Image_C4X = $iWidth
Case 'RIGHT'
$Image_C4X = $vTarget_Width
Case ''
$vNo4thPoint = 1
$Image_C4X = $Image_C1X + $iWidth
EndSwitch
Switch $Image_C4Y
Case 'CENTER'
$Image_C4Y = Int(($vTarget_Height / 2) + ($iHeight / 2))
Case 'UP'
$Image_C4Y = 0 + $iHeight
Case 'DOWN'
$Image_C4Y = $vTarget_Height
Case ''
$vNo4thPoint = 1
$Image_C4Y = $Image_C1Y + $iHeight
EndSwitch

$Image_C1X = $Image_C1X + _GDIPlus_RelativePos($aPicParameters[9], $vTarget_Width)
$Image_C1Y = $Image_C1Y + _GDIPlus_RelativePos($aPicParameters[10], $vTarget_Width)
$Image_C1Y = $Image_C1Y + _GDIPlus_RelativePos($aPicParameters[10], $vTarget_Height)
$Image_C2X = $Image_C2X + _GDIPlus_RelativePos($aPicParameters[9], $vTarget_Width)
$Image_C2Y = $Image_C2Y + _GDIPlus_RelativePos($aPicParameters[10], $vTarget_Width)
$Image_C2Y = $Image_C2Y + _GDIPlus_RelativePos($aPicParameters[10], $vTarget_Height)
$Image_C3X = $Image_C3X + _GDIPlus_RelativePos($aPicParameters[9], $vTarget_Width)
$Image_C3Y = $Image_C3Y + _GDIPlus_RelativePos($aPicParameters[10], $vTarget_Width)
$Image_C3Y = $Image_C3Y + _GDIPlus_RelativePos($aPicParameters[10], $vTarget_Height)
$Image_C4X = $Image_C4X + _GDIPlus_RelativePos($aPicParameters[9], $vTarget_Width)
$Image_C4Y = $Image_C4Y + _GDIPlus_RelativePos($aPicParameters[10], $vTarget_Height)

_GDIPlus_DrawImagePoints($hGraphic, $hImage, $Image_C1X, $Image_C1Y, $Image_C2X, $Image_C2Y, $Image_C3X, $Image_C3Y)
If $vNo4thPoint = 1 Then
_GDIPlus_DrawImagePoints($hGraphic, $hImage, $Image_C1X, $Image_C1Y, $Image_C2X, $Image_C2Y, $Image_C3X, $Image_C3Y)
Else
_GDIPlus_GraphicsDrawImage_4Points($hGraphic, $hImage, $Image_C1X, $Image_C1Y, $Image_C2X, $Image_C2Y, $Image_C3X, $Image_C3Y, $Image_C4X, $Image_C4Y)
EndIf
_GDIPlus_ImageSaveToFile($hBMPBuff, $iPath)
_GDIPlus_GraphicsDispose($hGraphic)
_GDIPlus_BitmapDispose($hBMPBuff)
Expand Down Expand Up @@ -1273,8 +1342,6 @@ Func _GDIPlus_GraphicsDrawImage_4Points($hGraphics, $hImage, $X1, $Y1, $X2, $Y2,
_GDIPlus_GraphicsDrawImage($hGraphics, $hBitmap, 0, 0)
_GDIPlus_BitmapDispose($hBitmap)
EndFunc ;==>_GDIPlus_GraphicsDrawImage_4Points


#EndRegion GDI Function

#Region XML Function
Expand Down
3 changes: 3 additions & 0 deletions MIX Repository/Preview/Standard (2img)/Description.txt
@@ -0,0 +1,3 @@
Author : Brandoskey
Description :
2 images assembled : Screenshot and Wheel
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions MIX Repository/_MIXList.txt
Expand Up @@ -5,5 +5,6 @@ Arcade Zoomed (moon)
Arcade Zoomed (moon)-RecalBox
Arcade Zoomed (moon)-Retropie
Full Back
Standard (2img)
Standard (3img)
Standard (4img)
Binary file added Ressources/7za.exe
Binary file not shown.
31 changes: 31 additions & 0 deletions Ressources/Licences/LICENSE 7za.txt
@@ -0,0 +1,31 @@
7-Zip Extra
~~~~~~~~~~~
License for use and distribution
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Copyright (C) 1999-2016 Igor Pavlov.

7-Zip Extra files are under the GNU LGPL license.


Notes:
You can use 7-Zip Extra on any computer, including a computer in a commercial
organization. You don't need to register or pay for 7-Zip.


GNU LGPL information
--------------------

This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.

This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.

You can receive a copy of the GNU Lesser General Public License from
http://www.gnu.org/

File renamed without changes.
File renamed without changes.
File renamed without changes.
6 changes: 4 additions & 2 deletions Scraper.au3
Expand Up @@ -5,7 +5,7 @@
#AutoIt3Wrapper_Compile_Both=y
#AutoIt3Wrapper_UseX64=y
#AutoIt3Wrapper_Res_Description=Scraper
#AutoIt3Wrapper_Res_Fileversion=1.1.0.1
#AutoIt3Wrapper_Res_Fileversion=1.1.0.2
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=p
#AutoIt3Wrapper_Res_LegalCopyright=LEGRAS David
#AutoIt3Wrapper_Res_Language=1036
Expand Down Expand Up @@ -515,7 +515,7 @@ Func _MIX_Engine($aRomList, $vBoucle, $aConfig, $oXMLProfil)
EndFunc ;==>_MIX_Engine

Func _MIX_Engine_Dim($vWhile, $oMixConfig)
Dim $aPicParameters[11]
Dim $aPicParameters[13]
$aPicParameters[0] = _XML_Read("/Profil/Element[" & $vWhile & "]/Target_Width", 0, "", $oMixConfig)
$aPicParameters[1] = _XML_Read("/Profil/Element[" & $vWhile & "]/Target_Height", 0, "", $oMixConfig)
$aPicParameters[2] = _XML_Read("/Profil/Element[" & $vWhile & "]/Target_TopLeftX", 0, "", $oMixConfig)
Expand All @@ -527,6 +527,8 @@ Func _MIX_Engine_Dim($vWhile, $oMixConfig)
$aPicParameters[8] = _XML_Read("/Profil/Element[" & $vWhile & "]/Target_Maximize", 0, "", $oMixConfig)
$aPicParameters[9] = _XML_Read("/Profil/Element[" & $vWhile & "]/Target_OriginX", 0, "", $oMixConfig)
$aPicParameters[10] = _XML_Read("/Profil/Element[" & $vWhile & "]/Target_OriginY", 0, "", $oMixConfig)
$aPicParameters[11] = _XML_Read("/Profil/Element[" & $vWhile & "]/Target_BottomRightX", 0, "", $oMixConfig)
$aPicParameters[12] = _XML_Read("/Profil/Element[" & $vWhile & "]/Target_BottomRightY", 0, "", $oMixConfig)
Return $aPicParameters
EndFunc ;==>_MIX_Engine_Dim

Expand Down
Binary file modified Scraper.exe
Binary file not shown.
Binary file modified Scraper64.exe
Binary file not shown.
2 changes: 1 addition & 1 deletion UXS-config.ini
@@ -1,4 +1,4 @@
[GENERAL]
$verINI='2.1.0.1'
$verINI='2.1.0.2'
$vVerbose=2
[LAST_USE]

0 comments on commit c5fb6eb

Please sign in to comment.