diff --git a/Source/General/Extras.vb b/Source/General/Extras.vb index 698555b9..5dabca0d 100644 --- a/Source/General/Extras.vb +++ b/Source/General/Extras.vb @@ -169,7 +169,7 @@ Class MTN Proc.SkipStrings = {"frame=", "size="} Proc.Encoding = Encoding.UTF8 Proc.Package = Package.MTN - Proc.AllowedExitCodes = {1} + Proc.AllowedExitCodes = {0, 1} Proc.Arguments = """" + inputFile + """" + " -c " & Col & " -r " & Rows & " -h " & SizeHeight & " -w " & SizeWidth & " -j " & PictureQuality & " -D " & PictureDepth & " -P " & " -O " & """" & DirectoryLocation & """" @@ -180,8 +180,8 @@ Class MTN Proc.Header = "Creating Thumbnail" Proc.SkipStrings = {"frame=", "size="} Proc.Encoding = Encoding.UTF8 - Proc.AllowedExitCodes = {1} Proc.Package = Package.MTN + Proc.AllowedExitCodes = {0, 1} Proc.Arguments = """" + inputFile + """" + " -c " & Col & " -r " & Rows & " -h " & SizeHeight & " -w " & SizeWidth & " -j " & PictureQuality & " -D " & PictureDepth & " -P " Proc.Start() diff --git a/Source/General/Proc.vb b/Source/General/Proc.vb index 61507c81..4a92487c 100644 --- a/Source/General/Proc.vb +++ b/Source/General/Proc.vb @@ -339,12 +339,12 @@ Public Class Proc Throw New SkipException End If - If Not AllowedExitCodes.ContainsEx(ExitCode) Then - Dim errOutput = ProcessHelp.GetConsoleOutput(Package.Err.Path, "/ntstatus.h /winerror.h " & ExitCode) + If ExitCode > 0 AndAlso Not AllowedExitCodes.ContainsEx(ExitCode) Then Dim sb = New StringBuilder() sb.Append($"{Header} returned exit code: {ExitCode} (0x{ExitCode:X})") If s.ErrorMessageExtendedByErr Then + Dim errOutput = ProcessHelp.GetConsoleOutput(Package.Err.Path, "/ntstatus.h /vfw.h /winerror.h " & ExitCode) sb.Append($"{BR2}It's unclear what this exit code means, in case it's") sb.Append($"{BR}a Windows system error then it possibly means:") sb.Append($"{BR2}{errOutput}")