From 1a65242d46bc7b026575ed8088722102d59a8c31 Mon Sep 17 00:00:00 2001 From: Svetlana Kulikova Date: Wed, 27 Aug 2025 12:04:48 +0300 Subject: [PATCH] Fix build --- DesktopEditor/cximage/CxImage/ximacfg.h | 3 ++- DesktopEditor/graphics/pro/js/drawingfile.json | 2 +- DesktopEditor/raster/ImageFileFormatChecker.cpp | 10 ++++++++++ 3 files changed, 13 insertions(+), 2 deletions(-) diff --git a/DesktopEditor/cximage/CxImage/ximacfg.h b/DesktopEditor/cximage/CxImage/ximacfg.h index 2d3ee55be5..c134fc24c1 100644 --- a/DesktopEditor/cximage/CxImage/ximacfg.h +++ b/DesktopEditor/cximage/CxImage/ximacfg.h @@ -38,7 +38,6 @@ #define CXIMAGE_SUPPORT_PNM 1 #define CXIMAGE_SUPPORT_RAS 1 #define CXIMAGE_SUPPORT_PIC 1 -#define CXIMAGE_SUPPORT_HEIF 1 #define CXIMAGE_SUPPORT_JBG 0 // GPL'd see ../jbig/copying.txt & ../jbig/patents.htm @@ -47,8 +46,10 @@ #define CXIMAGE_SUPPORT_PSD 1 #ifndef BUILDING_WASM_MODULE +#define CXIMAGE_SUPPORT_HEIF 1 #define CXIMAGE_SUPPORT_RAW 1 #else +#define CXIMAGE_SUPPORT_HEIF 0 #define CXIMAGE_SUPPORT_RAW 0 #endif diff --git a/DesktopEditor/graphics/pro/js/drawingfile.json b/DesktopEditor/graphics/pro/js/drawingfile.json index 13c7d2c00d..e536805b1f 100644 --- a/DesktopEditor/graphics/pro/js/drawingfile.json +++ b/DesktopEditor/graphics/pro/js/drawingfile.json @@ -163,7 +163,7 @@ }, { "folder": "../../../../Common/3dParty/icu/icu/source/common/", - "files": ["ucnv.c", "ustr_wcs.cpp", "ucnv_err.c", "ucnv_bld.cpp", "ustrtrns.cpp", "ucnv_cb.c", "udata.cpp", "ucnv_io.cpp", "uhash.c", "udatamem.c", "cmemory.c", "ustring.cpp", "umutex.cpp", "putil.cpp", "ustr_cnv.cpp", "ucnvmbcs.cpp", "ucnvlat1.c", "ucnv_u16.c", "ucnv_u8.c", "ucnv_u32.c", "ucnv_u7.c", "ucln_cmn.cpp", "ucnv2022.cpp", "ucnv_lmb.c", "ucnvhz.c", "ucnvscsu.c", "ucnvisci.c", "ucnvbocu.cpp", "ucnv_ct.c", "ucnv_cnv.c", "stringpiece.cpp", "charstr.cpp", "umapfile.c", "ucmndata.c", "ucnv_ext.cpp", "uobject.cpp", "umath.c", "ubidi_props.c", "uchar.c", "uinvchar.c", "usprep.cpp", "unistr.cpp", "uniset_props.cpp", "loadednormalizer2impl.cpp", "filterednormalizer2.cpp", "utrie2.cpp", "normalizer2.cpp", "normalizer2impl.cpp", "utrie.cpp", "ucase.cpp", "uniset.cpp", "ruleiter.cpp", "parsepos.cpp", "util.cpp", "uprops.cpp", "uvector.cpp", "unames.cpp", "propname.cpp", "utrie2_builder.cpp", "unifunct.cpp", "bmpset.cpp", "unisetspan.cpp", "unifilt.cpp", "patternprops.cpp", "utf_impl.c", "ustrcase.cpp", "cstring.c", "bytestrie.cpp"] + "files": ["ustr_wcs.cpp", "ustrtrns.cpp", "udata.cpp", "ucnv_io.cpp", "ustring.cpp", "umutex.cpp", "putil.cpp", "ustr_cnv.cpp", "ucnvmbcs.cpp", "ucln_cmn.cpp", "ucnv2022.cpp", "ucnvbocu.cpp", "stringpiece.cpp", "charstr.cpp", "ucnv_ext.cpp", "uobject.cpp", "usprep.cpp", "unistr.cpp", "uniset_props.cpp", "loadednormalizer2impl.cpp", "filterednormalizer2.cpp", "utrie2.cpp", "normalizer2.cpp", "normalizer2impl.cpp", "utrie.cpp", "ucase.cpp", "uniset.cpp", "ruleiter.cpp", "parsepos.cpp", "util.cpp", "uprops.cpp", "uvector.cpp", "unames.cpp", "propname.cpp", "utrie2_builder.cpp", "unifunct.cpp", "bmpset.cpp", "unisetspan.cpp", "unifilt.cpp", "patternprops.cpp", "ustrcase.cpp", "bytestrie.cpp", "utf_impl.cpp", "cmemory.cpp", "uhash.cpp", "udatamem.cpp", "umapfile.cpp", "uinvchar.cpp", "uchar.cpp", "ubidi_props.cpp", "characterproperties.cpp", "ucptrie.cpp", "edits.cpp", "umutablecptrie.cpp", "bytesinkutil.cpp", "emojiprops.cpp", "cstring.cpp", "ucmndata.cpp", "ucnv.cpp", "ucnv_u7.cpp", "ucnv_u8.cpp", "ucnv_u16.cpp", "ucnv_u32.cpp", "ucnv_err.cpp", "ucnv_cnv.cpp", "ucnv_lmb.cpp", "ucnv_cb.cpp", "ucnv_ct.cpp", "ucharstrieiterator.cpp", "ucnvlat1.cpp", "uvectr32.cpp", "ucnvhz.cpp", "ucnvscsu.cpp", "ucnv_bld.cpp", "ucnvisci.cpp"] }, { "folder": "../../../../Common/3dParty/cryptopp/", diff --git a/DesktopEditor/raster/ImageFileFormatChecker.cpp b/DesktopEditor/raster/ImageFileFormatChecker.cpp index ba6cca7861..89d045b83f 100644 --- a/DesktopEditor/raster/ImageFileFormatChecker.cpp +++ b/DesktopEditor/raster/ImageFileFormatChecker.cpp @@ -32,7 +32,9 @@ #include "ImageFileFormatChecker.h" #include "../common/File.h" #include "../cximage/CxImage/ximacfg.h" +#if CXIMAGE_SUPPORT_HEIF #include "heif/heif.h" +#endif #ifndef IMAGE_CHECKER_DISABLE_XML #include "../xml/include/xmlutils.h" @@ -436,7 +438,11 @@ bool CImageFileFormatChecker::isPicFile(BYTE *pBuffer, DWORD dwBytes) bool CImageFileFormatChecker::isHeifFile(BYTE* pBuffer, DWORD dwBytes) { +#if CXIMAGE_SUPPORT_HEIF return NSHeif::CHeifFile::isHeif(pBuffer, dwBytes); +#else + return false; +#endif } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////// bool CImageFileFormatChecker::isImageFile(const std::wstring& fileName) @@ -802,7 +808,11 @@ bool CImageFileFormatChecker::isSvgFile(const std::wstring& fileName) } bool CImageFileFormatChecker::isHeifFile(const std::wstring& fileName) { +#if CXIMAGE_SUPPORT_HEIF return NSHeif::CHeifFile::isHeif(fileName); +#else + return false; +#endif } std::wstring CImageFileFormatChecker::DetectFormatByData(BYTE *Data, int DataSize)