Fix bug 69723

This commit is contained in:
Oleg Korshul
2024-10-10 23:02:33 +03:00
parent cbbf650c56
commit 751a5d4d7d

View File

@ -108,7 +108,13 @@ Aggplus::CImage* ConvertMetafile(NSFonts::IApplicationFonts* pAppFonts, const st
if (NULL == pMeta || !pMeta->LoadFromFile(wsPath.c_str()))
return new Aggplus::CImage(wsPath);
if (0 < dWidth || 0 < dHeight)
bool bUseMax = false;
if (dWidth > 5000 || dHeight > 5000)
bUseMax = true;
else if (dWidth <= 0 && dHeight <= 0)
bUseMax = true;
if (!bUseMax)
pMeta->ConvertToRaster(wsTempDirectory.c_str(), _CXIMAGE_FORMAT_PNG, MM_2_PT(dWidth), MM_2_PT(dHeight));
else
MetaFile::ConvertToRasterMaxSize(pMeta, wsTempDirectory.c_str(), _CXIMAGE_FORMAT_PNG, 2000);