From d5d48457dabbe71e7f6b0baf2eaea6aa0dc86736 Mon Sep 17 00:00:00 2001 From: Ryan Harrison Date: Wed, 9 May 2018 20:31:12 +0000 Subject: Do not build PNG when codec is disabled Currently all of the PNG related code is being built when support for the codec is disabled, it just isn't being utilized. Depending on the settings being used, this unneeded code may or may not get stripped during linking. This CL explicitly turns off building the PNG codec code if support for PNG is turned off. BUG=pdfium:1080 Change-Id: I9c5247145fcadbcb1bd2243aa83350304ba421ff Reviewed-on: https://pdfium-review.googlesource.com/32270 Reviewed-by: Tom Sepez Commit-Queue: Ryan Harrison --- xfa/fxfa/cxfa_ffwidget.cpp | 2 ++ xfa/fxfa/parser/cxfa_node.cpp | 2 ++ 2 files changed, 4 insertions(+) (limited to 'xfa') diff --git a/xfa/fxfa/cxfa_ffwidget.cpp b/xfa/fxfa/cxfa_ffwidget.cpp index 6fd2397670..3c5a3411a7 100644 --- a/xfa/fxfa/cxfa_ffwidget.cpp +++ b/xfa/fxfa/cxfa_ffwidget.cpp @@ -52,7 +52,9 @@ FXDIB_Format XFA_GetDIBFormat(FXCODEC_IMAGE_TYPE type, dibFormat = FXDIB_Rgb; } } break; +#ifdef PDF_ENABLE_XFA_PNG case FXCODEC_IMAGE_PNG: +#endif // PDF_ENABLE_XFA_PNG default: break; } diff --git a/xfa/fxfa/parser/cxfa_node.cpp b/xfa/fxfa/parser/cxfa_node.cpp index 674ec00d8e..7e479b1858 100644 --- a/xfa/fxfa/parser/cxfa_node.cpp +++ b/xfa/fxfa/parser/cxfa_node.cpp @@ -165,8 +165,10 @@ FXCODEC_IMAGE_TYPE XFA_GetImageType(const WideString& wsType) { wsContentType.MakeLower(); 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 if (wsContentType == L"image/gif") return FXCODEC_IMAGE_GIF; if (wsContentType == L"image/bmp") -- cgit v1.2.3