mirror of
https://github.com/ONLYOFFICE/core.git
synced 2026-04-07 13:55:33 +08:00
Fix big metafiles
This commit is contained in:
@ -612,7 +612,20 @@ namespace MetaFile
|
||||
double dWidth = 25.4 * nWidth / 96;
|
||||
double dHeight = 25.4 * nHeight / 96;
|
||||
|
||||
BYTE* pBgraData = new BYTE[nWidth * nHeight * 4];
|
||||
BYTE* pBgraData = (BYTE*)malloc(nWidth * nHeight * 4);
|
||||
if (!pBgraData)
|
||||
{
|
||||
double dKoef = 2000.0 / (nWidth > nHeight ? nWidth : nHeight);
|
||||
|
||||
nWidth = (int)(dKoef * nWidth);
|
||||
nHeight = (int)(dKoef * nHeight);
|
||||
|
||||
dWidth = 25.4 * nWidth / 96;
|
||||
dHeight = 25.4 * nHeight / 96;
|
||||
|
||||
pBgraData = (BYTE*)malloc(nWidth * nHeight * 4);
|
||||
}
|
||||
|
||||
if (!pBgraData)
|
||||
return;
|
||||
|
||||
@ -637,8 +650,11 @@ namespace MetaFile
|
||||
DrawOnRenderer(pGrRenderer, 0, 0, dWidth, dHeight);
|
||||
|
||||
oFrame.SaveFile(wsOutFilePath, unFileType);
|
||||
|
||||
oFrame.put_Data(NULL);
|
||||
RELEASEINTERFACE(pFontManager);
|
||||
RELEASEINTERFACE(pGrRenderer);
|
||||
|
||||
if (pBgraData)
|
||||
free(pBgraData);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user