BITMAPCOREHEADER bitmaps cannot be top-down bitmaps
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@7116 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
79056544b0
commit
7100afa549
2 changed files with 6 additions and 4 deletions
|
@ -455,7 +455,8 @@ DWORD GetDIBHeaderInfo(const void*pData, size_t DataSize, GENERICIMAGEINFO&Info)
|
||||||
DWORD size = LE2HE32(p32[0]);
|
DWORD size = LE2HE32(p32[0]);
|
||||||
if (size == 12) // BITMAPCOREHEADER
|
if (size == 12) // BITMAPCOREHEADER
|
||||||
{
|
{
|
||||||
Info.Width = LE2HE16(p16[2]), Info.Height = (INT32) (SHORT) LE2HE16(p16[3]);
|
Info.Width = LE2HE16(p16[2]), Info.RawHeight = (INT32) (SHORT) LE2HE16(p16[3]);
|
||||||
|
Info.Height = Info.RawHeight; // BITMAPCOREHEADER bitmaps cannot be top-down bitmaps (docs.microsoft.com/en-us/windows/win32/gdi/bitmap-header-types)
|
||||||
Info.Planes = LE2HE16(p16[4]), Info.BPP = LE2HE16(p16[5]);
|
Info.Planes = LE2HE16(p16[4]), Info.BPP = LE2HE16(p16[5]);
|
||||||
return size;
|
return size;
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,11 +27,12 @@ bool GetTLBVersion(const TCHAR *filepath, DWORD &high, DWORD &low);
|
||||||
|
|
||||||
bool GetDLLVersion(const TCHAR *filepath, DWORD &high, DWORD &low);
|
bool GetDLLVersion(const TCHAR *filepath, DWORD &high, DWORD &low);
|
||||||
|
|
||||||
typedef struct {
|
typedef struct GENERICIMAGEINFO {
|
||||||
UINT32 Width, Height;
|
UINT32 Width, Height;
|
||||||
INT32 RawHeight;
|
INT32 RawHeight;
|
||||||
WORD BPP, Planes;
|
WORD BPP, Planes;
|
||||||
bool IsTopDownBitmap() const { return Height != (UINT32) RawHeight; }
|
GENERICIMAGEINFO() : RawHeight(0) {}
|
||||||
|
bool IsTopDownBitmap() const { return Height != (UINT32) RawHeight && RawHeight; }
|
||||||
} GENERICIMAGEINFO;
|
} GENERICIMAGEINFO;
|
||||||
|
|
||||||
DWORD GetDIBHeaderInfo(const void*pData, size_t DataSize, GENERICIMAGEINFO&Info);
|
DWORD GetDIBHeaderInfo(const void*pData, size_t DataSize, GENERICIMAGEINFO&Info);
|
||||||
|
@ -47,7 +48,7 @@ inline WORD IsICOCURFile(const void*pData)
|
||||||
}
|
}
|
||||||
inline WORD IsICOCURFile(const void*pData, size_t DataSize)
|
inline WORD IsICOCURFile(const void*pData, size_t DataSize)
|
||||||
{
|
{
|
||||||
return DataSize >= 6 ? IsICOCURFile(pData) : 0;
|
return DataSize > 6 ? IsICOCURFile(pData) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif //~ NSIS_BININTEROP_H
|
#endif //~ NSIS_BININTEROP_H
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue