[Gdcm-hackers] gdcm-git:Grassroots DICOM branch release updated. be7d49cf3d13eafffdba801ba30e1c9820
Cross-platform DICOM implementation
Brought to you by:
malat
|
From: Mathieu M. <ma...@us...> - 2020-04-27 14:22:32
|
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Grassroots DICOM".
The branch, release has been updated
via be7d49cf3d13eafffdba801ba30e1c98202843a8 (commit)
from 572741198fa09ec2656353314d9cce8d63f90c23 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
https://sourceforge.net/p/gdcm/gdcm/ci/be7d49cf3d13eafffdba801ba30e1c98202843a8/
commit be7d49cf3d13eafffdba801ba30e1c98202843a8
Author: Mathieu Malaterre <mat...@gm...>
Date: Mon Apr 27 14:07:15 2020 +0000
Update gdcminfo for new poppler. Fixes #500
- Add LIBPOPPLER_UNICODEMAP_HAS_CONSTMAPUNICODE
- Add LIBPOPPLER_GLOBALPARAMS_HAS_RESET
Thanks to Darcy (hot123tea123-users.sourceforge.net) for inspiration. Turns out the original patch is from Even Rouault :
* https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=cafa6007bf77dd0cd210ed9aeecd9e47053a9223
diff --git a/Applications/Cxx/CMakeLists.txt b/Applications/Cxx/CMakeLists.txt
index af799930b..820745295 100644
--- a/Applications/Cxx/CMakeLists.txt
+++ b/Applications/Cxx/CMakeLists.txt
@@ -72,6 +72,13 @@ if(GDCM_USE_SYSTEM_POPPLER)
if(LIBPOPPLER_GLOBALPARAMS_CSTOR_HAS_PARAM)
list(APPEND libpoppler_flags -DLIBPOPPLER_GLOBALPARAMS_CSTOR_HAS_PARAM)
endif()
+ CHECK_CXX_SOURCE_COMPILES(
+ "\#include <poppler/GlobalParams.h>\nint main() { globalParams.reset( new GlobalParams()); return 0;}"
+ LIBPOPPLER_GLOBALPARAMS_HAS_RESET)
+ set(libpoppler_flags)
+ if(LIBPOPPLER_GLOBALPARAMS_HAS_RESET)
+ list(APPEND libpoppler_flags -DLIBPOPPLER_GLOBALPARAMS_HAS_RESET)
+ endif()
CHECK_CXX_SOURCE_COMPILES(
"\#include <poppler/PDFDoc.h>\nint main() { PDFDoc d((GooString*)NULL,(GooString*)NULL,(GooString*)NULL); d.getPDFVersion(); return 0;}"
LIBPOPPLER_PDFDOC_HAS_PDFVERSION)
@@ -102,6 +109,12 @@ if(GDCM_USE_SYSTEM_POPPLER)
if(LIBPOPPLER_GOOSTRING_HAS_GETCSTRING)
list(APPEND libpoppler_flags -DLIBPOPPLER_GOOSTRING_HAS_GETCSTRING)
endif()
+ CHECK_CXX_SOURCE_COMPILES(
+ "\#include <poppler/UnicodeMap.h>\nint main() { Unicode u; char buf[8]; const UnicodeMap *uMap; uMap->mapUnicode(u, buf, sizeof(buf)); return 0; }"
+ LIBPOPPLER_UNICODEMAP_HAS_CONSTMAPUNICODE)
+ if(LIBPOPPLER_UNICODEMAP_HAS_CONSTMAPUNICODE)
+ list(APPEND libpoppler_flags -DLIBPOPPLER_UNICODEMAP_HAS_CONSTMAPUNICODE)
+ endif()
if(libpoppler_flags)
string(REPLACE ";" " " libpoppler_flags_string "${libpoppler_flags}")
set_source_files_properties(
diff --git a/Applications/Cxx/gdcminfo.cxx b/Applications/Cxx/gdcminfo.cxx
index bef80248e..a134e9487 100644
--- a/Applications/Cxx/gdcminfo.cxx
+++ b/Applications/Cxx/gdcminfo.cxx
@@ -258,7 +258,11 @@ static std::string getInfoDate(Dict *infoDict, const char *key)
return out;
}
+#ifdef LIBPOPPLER_UNICODEMAP_HAS_CONSTMAPUNICODE
+static std::string getInfoString(Dict *infoDict, const char *key, const UnicodeMap *uMap)
+#else
static std::string getInfoString(Dict *infoDict, const char *key, UnicodeMap *uMap)
+#endif
{
Object obj;
#ifdef LIBPOPPLER_GOOSTRING_HAS_CONSTGETCHAR
@@ -509,11 +513,19 @@ static int ProcessOneFile( std::string const & filename, gdcm::Defs const & defs
std::string creationdate;
std::string moddate;
+#ifdef LIBPOPPLER_UNICODEMAP_HAS_CONSTMAPUNICODE
+ const UnicodeMap *uMap;
+#else
UnicodeMap *uMap;
+#endif
#ifdef LIBPOPPLER_GLOBALPARAMS_CSTOR_HAS_PARAM
globalParams = new GlobalParams(0);
+#else
+#ifdef LIBPOPPLER_GLOBALPARAMS_HAS_RESET
+ globalParams.reset(new GlobalParams());
#else
globalParams = new GlobalParams();
+#endif
#endif
uMap = globalParams->getTextEncoding();
diff --git a/Applications/Cxx/gdcmpdf.cxx b/Applications/Cxx/gdcmpdf.cxx
index 4d97d81e0..59ca77a28 100644
--- a/Applications/Cxx/gdcmpdf.cxx
+++ b/Applications/Cxx/gdcmpdf.cxx
@@ -106,7 +106,11 @@ static std::string getInfoDate(Dict *infoDict, const char *key)
return out;
}
+#ifdef LIBPOPPLER_UNICODEMAP_HAS_CONSTMAPUNICODE
+static std::string getInfoString(Dict *infoDict, const char *key, const UnicodeMap *uMap, bool & unicode)
+#else
static std::string getInfoString(Dict *infoDict, const char *key, UnicodeMap *uMap, bool & unicode)
+#endif
{
Object obj;
#ifdef LIBPOPPLER_GOOSTRING_HAS_CONSTGETCHAR
@@ -333,13 +337,21 @@ int main (int argc, char *argv[])
GooString *fileName;
PDFDoc *doc;
Object info;
+#ifdef LIBPOPPLER_UNICODEMAP_HAS_CONSTMAPUNICODE
+ const UnicodeMap *uMap;
+#else
UnicodeMap *uMap;
+#endif
ownerPW = NULL;
userPW = NULL;
#ifdef LIBPOPPLER_GLOBALPARAMS_CSTOR_HAS_PARAM
globalParams = new GlobalParams(0);
+#else
+#ifdef LIBPOPPLER_GLOBALPARAMS_HAS_RESET
+ globalParams.reset(new GlobalParams());
#else
globalParams = new GlobalParams();
+#endif
#endif
uMap = globalParams->getTextEncoding();
-----------------------------------------------------------------------
Summary of changes:
Applications/Cxx/CMakeLists.txt | 13 +++++++++++++
Applications/Cxx/gdcminfo.cxx | 12 ++++++++++++
Applications/Cxx/gdcmpdf.cxx | 12 ++++++++++++
3 files changed, 37 insertions(+)
hooks/post-receive
--
Grassroots DICOM
|