mirror of
https://github.com/wabbajack-tools/wabbajack.git
synced 2024-08-30 18:42:17 +00:00
Check for a DDS signature before attempting to analyze textures
This commit is contained in:
parent
9422b571b1
commit
631ccba553
@ -1,5 +1,8 @@
|
||||
### Changelog
|
||||
|
||||
#### Version - 2.5.1.5 - 7/17/2021
|
||||
* HOTFIX - Don't attempt to analyze files that have .dds extensions but are not DDS files internally
|
||||
|
||||
#### Version - 2.5.1.4 - 7/17/2021
|
||||
* Fix some broken VFS caching (that's existed for awhile)
|
||||
* Enable perceptual hashing for files inside BSA file
|
||||
|
@ -6,8 +6,8 @@
|
||||
<AssemblyName>wabbajack-cli</AssemblyName>
|
||||
<Company>Wabbajack</Company>
|
||||
<Platforms>x64</Platforms>
|
||||
<AssemblyVersion>2.5.1.4</AssemblyVersion>
|
||||
<FileVersion>2.5.1.4</FileVersion>
|
||||
<AssemblyVersion>2.5.1.5</AssemblyVersion>
|
||||
<FileVersion>2.5.1.5</FileVersion>
|
||||
<Copyright>Copyright © 2019-2021</Copyright>
|
||||
<Description>An automated ModList installer</Description>
|
||||
<PublishReadyToRun>true</PublishReadyToRun>
|
||||
|
@ -84,6 +84,8 @@ namespace Wabbajack.ImageHashing
|
||||
}
|
||||
|
||||
public static async Task<ImageState> GetState(AbsolutePath path)
|
||||
{
|
||||
try
|
||||
{
|
||||
var ph = new ProcessHelper
|
||||
{
|
||||
@ -113,5 +115,10 @@ namespace Wabbajack.ImageHashing
|
||||
PerceptualHash = await GetPHash(path)
|
||||
};
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
throw;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -4,8 +4,8 @@
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net5.0-windows</TargetFramework>
|
||||
<UseWPF>true</UseWPF>
|
||||
<AssemblyVersion>2.5.1.4</AssemblyVersion>
|
||||
<FileVersion>2.5.1.4</FileVersion>
|
||||
<AssemblyVersion>2.5.1.5</AssemblyVersion>
|
||||
<FileVersion>2.5.1.5</FileVersion>
|
||||
<Copyright>Copyright © 2019-2020</Copyright>
|
||||
<Description>Wabbajack Application Launcher</Description>
|
||||
<PublishReadyToRun>true</PublishReadyToRun>
|
||||
|
@ -3,8 +3,8 @@
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net5.0-windows</TargetFramework>
|
||||
<AssemblyVersion>2.5.1.4</AssemblyVersion>
|
||||
<FileVersion>2.5.1.4</FileVersion>
|
||||
<AssemblyVersion>2.5.1.5</AssemblyVersion>
|
||||
<FileVersion>2.5.1.5</FileVersion>
|
||||
<Copyright>Copyright © 2019-2021</Copyright>
|
||||
<Description>Wabbajack Server</Description>
|
||||
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
|
||||
|
@ -7,6 +7,7 @@ using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
using Compression.BSA;
|
||||
using ICSharpCode.SharpZipLib.Zip.Compression.Streams;
|
||||
using K4os.Hash.Crc;
|
||||
using Wabbajack.Common;
|
||||
@ -190,7 +191,7 @@ namespace Wabbajack.VirtualFileSystem
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
private static SignatureChecker DDSSig = new(Definitions.FileType.DSS);
|
||||
public static async Task<VirtualFile> Analyze(Context context, VirtualFile parent, IStreamFactory extractedFile,
|
||||
IPath relPath, int depth = 0)
|
||||
{
|
||||
@ -226,11 +227,19 @@ namespace Wabbajack.VirtualFileSystem
|
||||
Hash = hash,
|
||||
};
|
||||
|
||||
if (Consts.TextureExtensions.Contains(relPath.FileName.Extension))
|
||||
if (Consts.TextureExtensions.Contains(relPath.FileName.Extension) && (await DDSSig.MatchesAsync(stream)) != null)
|
||||
{
|
||||
try
|
||||
{
|
||||
self.ImageState = await ImageState.FromImageStream(stream, relPath.FileName.Extension, false);
|
||||
stream.Position = 0;
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
Utils.Log($"Unable to perform perceptual hashing on {relPath.FileName} in {parent.FullPath}");
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
self.FillFullPath(depth);
|
||||
|
||||
|
@ -6,8 +6,8 @@
|
||||
<UseWPF>true</UseWPF>
|
||||
<Platforms>x64</Platforms>
|
||||
<RuntimeIdentifier>win10-x64</RuntimeIdentifier>
|
||||
<AssemblyVersion>2.5.1.4</AssemblyVersion>
|
||||
<FileVersion>2.5.1.4</FileVersion>
|
||||
<AssemblyVersion>2.5.1.5</AssemblyVersion>
|
||||
<FileVersion>2.5.1.5</FileVersion>
|
||||
<Copyright>Copyright © 2019-2021</Copyright>
|
||||
<Description>An automated ModList installer</Description>
|
||||
<PublishReadyToRun>true</PublishReadyToRun>
|
||||
|
Loading…
Reference in New Issue
Block a user