mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
x2t - ooxml flat - fix gzip image
This commit is contained in:
@ -196,11 +196,12 @@ namespace NSShapeImageGen
|
|||||||
bool result = false;
|
bool result = false;
|
||||||
CImageFileFormatChecker checker;
|
CImageFileFormatChecker checker;
|
||||||
|
|
||||||
std::wstring strFileSrc = strFileName;
|
|
||||||
std::wstring sTempUnpacked;
|
std::wstring sTempUnpacked;
|
||||||
|
std::wstring strFileSrc = strFileName;
|
||||||
|
|
||||||
COfficeUtils officeUtils(NULL);
|
COfficeUtils officeUtils(NULL);
|
||||||
if (officeUtils.IsArchive(strFileSrc))
|
|
||||||
|
while (officeUtils.IsArchive(strFileSrc))
|
||||||
{
|
{
|
||||||
sTempUnpacked = m_strTempMedia + FILE_SEPARATOR_STR + L"zip_unpacked";
|
sTempUnpacked = m_strTempMedia + FILE_SEPARATOR_STR + L"zip_unpacked";
|
||||||
NSDirectory::CreateDirectory(sTempUnpacked);
|
NSDirectory::CreateDirectory(sTempUnpacked);
|
||||||
@ -214,14 +215,14 @@ namespace NSShapeImageGen
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{//deflate
|
{//gzip
|
||||||
BYTE *pData = NULL;
|
BYTE *pData = NULL;
|
||||||
DWORD nBytesCount = 0;
|
DWORD nBytesCount = 0;
|
||||||
|
|
||||||
NSFile::CFileBinary file;
|
NSFile::CFileBinary file;
|
||||||
if (file.ReadAllBytes(strFileSrc, &pData, nBytesCount))
|
if (file.ReadAllBytes(strFileSrc, &pData, nBytesCount))
|
||||||
{
|
{
|
||||||
ULONG nBytesUncompress = nBytesCount * 3;
|
ULONG nBytesUncompress = nBytesCount * 10;
|
||||||
BYTE* pDataUncompress = new BYTE[nBytesUncompress];
|
BYTE* pDataUncompress = new BYTE[nBytesUncompress];
|
||||||
if (S_OK == officeUtils.Uncompress(pDataUncompress, &nBytesUncompress, pData, nBytesCount))
|
if (S_OK == officeUtils.Uncompress(pDataUncompress, &nBytesUncompress, pData, nBytesCount))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -661,7 +661,7 @@ int flush;
|
|||||||
}
|
}
|
||||||
NEEDBITS(16);
|
NEEDBITS(16);
|
||||||
#ifdef GUNZIP
|
#ifdef GUNZIP
|
||||||
if ((state->wrap & 2) && hold == 0x8b1f) { /* gzip header */
|
if ((state->wrap & 2 || state->wrap & 5) && hold == 0x8b1f) { /* gzip header */
|
||||||
if (state->wbits == 0)
|
if (state->wbits == 0)
|
||||||
state->wbits = 15;
|
state->wbits = 15;
|
||||||
state->check = crc32(0L, Z_NULL, 0);
|
state->check = crc32(0L, Z_NULL, 0);
|
||||||
|
|||||||
Reference in New Issue
Block a user