summaryrefslogtreecommitdiff
path: root/xfa
diff options
context:
space:
mode:
Diffstat (limited to 'xfa')
-rw-r--r--xfa/fxfa/cxfa_ffwidget.cpp2
-rw-r--r--xfa/fxfa/parser/cxfa_node.cpp20
2 files changed, 16 insertions, 6 deletions
diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp
index 3c5a3411a7..c9bb072cb9 100644
--- a/xfa/fxfa/cxfa_ffwidget.cpp
+++ b/xfa/fxfa/cxfa_ffwidget.cpp
@@ -40,7 +40,9 @@ FXDIB_Format XFA_GetDIBFormat(FXCODEC_IMAGE_TYPE type,
int32_t iBitsPerComponent) {
FXDIB_Format dibFormat = FXDIB_Argb;
switch (type) {
+#ifdef PDF_ENABLE_XFA_BMP
case FXCODEC_IMAGE_BMP:
+#endif // PDF_ENABLE_XFA_BMP
case FXCODEC_IMAGE_JPG:
#ifdef PDF_ENABLE_XFA_TIFF
case FXCODEC_IMAGE_TIFF:
diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp
index f178bd92a9..af3ad63f72 100644
--- a/xfa/fxfa/parser/cxfa_node.cpp
+++ b/xfa/fxfa/parser/cxfa_node.cpp
@@ -163,22 +163,30 @@ int32_t XFA_Base64Decode(const char* pStr, uint8_t* pOutBuffer) {
FXCODEC_IMAGE_TYPE XFA_GetImageType(const WideString& wsType) {
WideString wsContentType(wsType);
wsContentType.MakeLower();
+
+#ifdef PDF_ENABLE_XFA_BMP
+ if (wsContentType == L"image/bmp")
+ return FXCODEC_IMAGE_BMP;
+#endif // PDF_ENABLE_XFA_BMP
+
+#ifdef PDF_ENABLE_XFA_GIF
+ if (wsContentType == L"image/gif")
+ return FXCODEC_IMAGE_GIF;
+#endif // PDF_ENABLE_XFA_GIF
+
if (wsContentType == L"image/jpg")
return FXCODEC_IMAGE_JPG;
+
#ifdef PDF_ENABLE_XFA_PNG
if (wsContentType == L"image/png")
return FXCODEC_IMAGE_PNG;
#endif // PDF_ENABLE_XFA_PNG
-#ifdef PDF_ENABLE_XFA_GIF
- if (wsContentType == L"image/gif")
- return FXCODEC_IMAGE_GIF;
-#endif // PDF_ENABLE_XFA_GIF
- if (wsContentType == L"image/bmp")
- return FXCODEC_IMAGE_BMP;
+
#ifdef PDF_ENABLE_XFA_TIFF
if (wsContentType == L"image/tif")
return FXCODEC_IMAGE_TIFF;
#endif // PDF_ENABLE_XFA_TIFF
+
return FXCODEC_IMAGE_UNKNOWN;
}