Skip to content

Commit

Permalink
*fix bugs (removing of TFileInfo structure).
Browse files Browse the repository at this point in the history
  • Loading branch information
ermig1979 committed Feb 22, 2023
1 parent 5847425 commit a75791b
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 3 deletions.
6 changes: 4 additions & 2 deletions src/AntiDupl/AntiDupl.NET.Core/CoreImageInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,8 @@ public class CoreImageInfo
public ulong id;
public string path;
public ulong size;
public ulong time;
public ulong time;
public uint hash;
public CoreDll.ImageType type;
public uint width;
public uint height;
Expand All @@ -46,7 +47,8 @@ public CoreImageInfo(ref CoreDll.adImageInfoW imageInfo)
id = (ulong)imageInfo.id;
path = imageInfo.path;
size = imageInfo.size;
time = imageInfo.time;
time = imageInfo.time;
hash = imageInfo.hash;
type = imageInfo.type;
width = imageInfo.width;
height = imageInfo.height;
Expand Down
3 changes: 2 additions & 1 deletion src/AntiDupl/AntiDupl.NET.Core/Original/CoreDll.cs
Original file line number Diff line number Diff line change
Expand Up @@ -395,7 +395,8 @@ public struct adImageInfoW
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = MAX_PATH_EX)]
public string path;
public ulong size;
public ulong time;
public ulong time;
public uint hash;
public ImageType type;
public uint width;
public uint height;
Expand Down
2 changes: 2 additions & 0 deletions src/AntiDupl/AntiDupl/AntiDupl.h
Original file line number Diff line number Diff line change
Expand Up @@ -519,6 +519,7 @@ extern "C"
adPathA path;
adUInt64 size;
adUInt64 time;
adUInt32 hash;
adImageType type;
adUInt32 width;
adUInt32 height;
Expand All @@ -535,6 +536,7 @@ extern "C"
adPathW path;
adUInt64 size;
adUInt64 time;
adUInt32 hash;
adImageType type;
adUInt32 width;
adUInt32 height;
Expand Down
3 changes: 3 additions & 0 deletions src/AntiDupl/AntiDupl/adImageInfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ namespace ad
if (GetFileAttributesEx(path_.c_str(), GetFileExInfoStandard,
&fileAttributeData))
{
path = path_;
size = TUInt64(fileAttributeData.nFileSizeLow) +
TUInt64(fileAttributeData.nFileSizeHigh) * 0x100000000;
time = *(TUInt64*)&fileAttributeData.ftLastWriteTime;
Expand Down Expand Up @@ -146,6 +147,7 @@ namespace ad
path.Original().CopyTo(pImageInfo->path, MAX_PATH);
pImageInfo->size = size;
pImageInfo->time = time;
pImageInfo->hash = hash;
pImageInfo->type = type;
pImageInfo->width = width;
pImageInfo->height = height;
Expand All @@ -165,6 +167,7 @@ namespace ad
path.Original().CopyTo(pImageInfo->path, MAX_PATH_EX);
pImageInfo->size = size;
pImageInfo->time = time;
pImageInfo->hash = hash;
pImageInfo->type = type;
pImageInfo->width = width;
pImageInfo->height = height;
Expand Down

0 comments on commit a75791b

Please sign in to comment.