Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package orthanc-gdcm for openSUSE:Factory checked in at 2021-06-23 17:38:14 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/orthanc-gdcm (Old) and /work/SRC/openSUSE:Factory/.orthanc-gdcm.new.2625 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "orthanc-gdcm" Wed Jun 23 17:38:14 2021 rev:5 rq:901371 version:1.3 Changes: -------- --- /work/SRC/openSUSE:Factory/orthanc-gdcm/orthanc-gdcm.changes 2020-12-30 17:12:48.944669740 +0100 +++ /work/SRC/openSUSE:Factory/.orthanc-gdcm.new.2625/orthanc-gdcm.changes 2021-06-23 17:38:18.416477665 +0200 @@ -1,0 +2,7 @@ +Sat Jun 19 13:46:53 UTC 2021 - Axel Braun <[email protected]> + +- version 1.3 +* Prevent changing SOP class UID from "MR Image Storage" to "Enhanced + MR Image Storage" during the transcoding + +------------------------------------------------------------------- Old: ---- OrthancGdcm-1.2.tar.gz New: ---- OrthancGdcm-1.3.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ orthanc-gdcm.spec ++++++ --- /var/tmp/diff_new_pack.qa3sjF/_old 2021-06-23 17:38:18.880478303 +0200 +++ /var/tmp/diff_new_pack.qa3sjF/_new 2021-06-23 17:38:18.884478309 +0200 @@ -1,7 +1,7 @@ # # spec file for package orthanc-gdcm # -# Copyright (c) 2020 SUSE LLC +# Copyright (c) 2021 SUSE LLC # Copyright (c) 2020 Dr. Axel Braun # # All modifications and additions to the file contributed by third parties @@ -21,7 +21,7 @@ Summary: GDCM plugin for Orthanc License: GPL-3.0-or-later Group: Productivity/Graphics/Viewers -Version: 1.2 +Version: 1.3 Release: 0 URL: http://orthanc-server.com Source0: https://www.orthanc-server.com/downloads/get.php?path=/plugin-gdcm/OrthancGdcm-%{version}.tar.gz ++++++ OrthancGdcm-1.2.tar.gz -> OrthancGdcm-1.3.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OrthancGdcm-1.2/.hg_archival.txt new/OrthancGdcm-1.3/.hg_archival.txt --- old/OrthancGdcm-1.2/.hg_archival.txt 2020-12-17 17:22:34.000000000 +0100 +++ new/OrthancGdcm-1.3/.hg_archival.txt 2021-06-14 17:00:50.000000000 +0200 @@ -1,6 +1,6 @@ repo: 108d34b53bb89b998dbe89c3bb031241991f13c7 -node: ad9c32ea9eac377df68f81c8a7b670ec7ff2b6b4 -branch: OrthancGdcm-1.2 +node: 294473d51c84ef734f53708c8ed3d7cbf9787edf +branch: OrthancGdcm-1.3 latesttag: null -latesttagdistance: 41 -changessincelatesttag: 45 +latesttagdistance: 46 +changessincelatesttag: 50 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OrthancGdcm-1.2/CMakeLists.txt new/OrthancGdcm-1.3/CMakeLists.txt --- old/OrthancGdcm-1.2/CMakeLists.txt 2020-12-17 17:22:34.000000000 +0100 +++ new/OrthancGdcm-1.3/CMakeLists.txt 2021-06-14 17:00:50.000000000 +0200 @@ -1,7 +1,7 @@ # Orthanc - A Lightweight, RESTful DICOM Store # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics # Department, University Hospital of Liege, Belgium -# Copyright (C) 2017-2020 Osimis S.A., Belgium +# Copyright (C) 2017-2021 Osimis S.A., Belgium # # This program is free software: you can redistribute it and/or # modify it under the terms of the GNU General Public License as @@ -21,13 +21,13 @@ project(OrthancGdcm) -SET(PLUGIN_VERSION "1.2" CACHE STRING "Version of the plugin") +SET(PLUGIN_VERSION "1.3" CACHE STRING "Version of the plugin") if (PLUGIN_VERSION STREQUAL "mainline") set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "mainline") set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "hg") else() - set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "1.8.1") + set(ORTHANC_FRAMEWORK_DEFAULT_VERSION "1.9.3") set(ORTHANC_FRAMEWORK_DEFAULT_SOURCE "web") endif() @@ -53,6 +53,17 @@ include_directories(${ORTHANC_FRAMEWORK_ROOT}) if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "system") + if (ORTHANC_FRAMEWORK_USE_SHARED) + include(FindBoost) + find_package(Boost COMPONENTS thread) + + if (NOT Boost_FOUND) + message(FATAL_ERROR "Unable to locate Boost on this system") + endif() + + link_libraries(${Boost_LIBRARIES} jsoncpp) + endif() + link_libraries(${ORTHANC_FRAMEWORK_LIBRARIES}) else() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OrthancGdcm-1.2/NEWS new/OrthancGdcm-1.3/NEWS --- old/OrthancGdcm-1.2/NEWS 2020-12-17 17:22:34.000000000 +0100 +++ new/OrthancGdcm-1.3/NEWS 2021-06-14 17:00:50.000000000 +0200 @@ -2,6 +2,13 @@ =============================== +Version 1.3 (2021-06-14) +======================== + +* Prevent changing SOP class UID from "MR Image Storage" to "Enhanced + MR Image Storage" during the transcoding + + Version 1.2 (2020-12-17) ======================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OrthancGdcm-1.2/Plugin/GdcmDecoderCache.cpp new/OrthancGdcm-1.3/Plugin/GdcmDecoderCache.cpp --- old/OrthancGdcm-1.2/Plugin/GdcmDecoderCache.cpp 2020-12-17 17:22:34.000000000 +0100 +++ new/OrthancGdcm-1.3/Plugin/GdcmDecoderCache.cpp 2021-06-14 17:00:50.000000000 +0200 @@ -2,7 +2,7 @@ * Orthanc - A Lightweight, RESTful DICOM Store * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics * Department, University Hospital of Liege, Belgium - * Copyright (C) 2017-2020 Osimis S.A., Belgium + * Copyright (C) 2017-2021 Osimis S.A., Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OrthancGdcm-1.2/Plugin/GdcmDecoderCache.h new/OrthancGdcm-1.3/Plugin/GdcmDecoderCache.h --- old/OrthancGdcm-1.2/Plugin/GdcmDecoderCache.h 2020-12-17 17:22:34.000000000 +0100 +++ new/OrthancGdcm-1.3/Plugin/GdcmDecoderCache.h 2021-06-14 17:00:50.000000000 +0200 @@ -2,7 +2,7 @@ * Orthanc - A Lightweight, RESTful DICOM Store * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics * Department, University Hospital of Liege, Belgium - * Copyright (C) 2017-2020 Osimis S.A., Belgium + * Copyright (C) 2017-2021 Osimis S.A., Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OrthancGdcm-1.2/Plugin/GdcmImageDecoder.cpp new/OrthancGdcm-1.3/Plugin/GdcmImageDecoder.cpp --- old/OrthancGdcm-1.2/Plugin/GdcmImageDecoder.cpp 2020-12-17 17:22:34.000000000 +0100 +++ new/OrthancGdcm-1.3/Plugin/GdcmImageDecoder.cpp 2021-06-14 17:00:50.000000000 +0200 @@ -2,7 +2,7 @@ * Orthanc - A Lightweight, RESTful DICOM Store * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics * Department, University Hospital of Liege, Belgium - * Copyright (C) 2017-2020 Osimis S.A., Belgium + * Copyright (C) 2017-2021 Osimis S.A., Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -297,7 +297,7 @@ } - static void FixPhotometricInterpretation(OrthancImage& image, + static void FixPhotometricInterpretation(const OrthancImage& image, gdcm::PhotometricInterpretation interpretation) { switch (interpretation) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OrthancGdcm-1.2/Plugin/GdcmImageDecoder.h new/OrthancGdcm-1.3/Plugin/GdcmImageDecoder.h --- old/OrthancGdcm-1.2/Plugin/GdcmImageDecoder.h 2020-12-17 17:22:34.000000000 +0100 +++ new/OrthancGdcm-1.3/Plugin/GdcmImageDecoder.h 2021-06-14 17:00:50.000000000 +0200 @@ -2,7 +2,7 @@ * Orthanc - A Lightweight, RESTful DICOM Store * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics * Department, University Hospital of Liege, Belgium - * Copyright (C) 2017-2020 Osimis S.A., Belgium + * Copyright (C) 2017-2021 Osimis S.A., Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OrthancGdcm-1.2/Plugin/Plugin.cpp new/OrthancGdcm-1.3/Plugin/Plugin.cpp --- old/OrthancGdcm-1.2/Plugin/Plugin.cpp 2020-12-17 17:22:34.000000000 +0100 +++ new/OrthancGdcm-1.3/Plugin/Plugin.cpp 2021-06-14 17:00:50.000000000 +0200 @@ -2,7 +2,7 @@ * Orthanc - A Lightweight, RESTful DICOM Store * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics * Department, University Hospital of Liege, Belgium - * Copyright (C) 2017-2020 Osimis S.A., Belgium + * Copyright (C) 2017-2021 Osimis S.A., Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -35,6 +35,7 @@ #include <gdcmTagKeywords.h> #include <gdcmUIDGenerator.h> #include <gdcmVersion.h> +#include <gdcmImageHelper.h> static OrthancPlugins::GdcmDecoderCache cache_; @@ -192,6 +193,23 @@ const gdcm::Image& image, const gdcm::ImageReader& reader) { + /** + * In GDCM, if "ForceRescaleInterceptSlope" is "false" (the default + * value), the SOP Class UID (0008,0016) might be changed from + * 1.2.840.10008.5.1.4.1.1.4 (MR Image Storage) to + * 1.2.840.10008.5.1.4.1.1.4.1 (Enhanced MR Image Storage), because + * of function "ImageHelper::ComputeMediaStorageFromModality()" that + * is called by "ImageWriter::ComputeTargetMediaStorage()". But, + * changing the SOP Class UID is unexpected if doing transcoding. + * + * As another side-effect, the DICOM tags "ImagePositionPatient" + * (0020,0032) and "ImageOrientationPatient" (0020,0037) are removed + * from the root of the dataset, and moved into subsequence "Shared + * Functional Groups Sequence" (5200,9229). This leads to issue + * LSD-598. + **/ + gdcm::ImageHelper::SetForceRescaleInterceptSlope(true); + gdcm::ImageWriter writer; writer.SetImage(image); writer.SetFile(reader.GetFile()); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OrthancGdcm-1.2/Resources/CMake/GdcmConfiguration.cmake new/OrthancGdcm-1.3/Resources/CMake/GdcmConfiguration.cmake --- old/OrthancGdcm-1.2/Resources/CMake/GdcmConfiguration.cmake 2020-12-17 17:22:34.000000000 +0100 +++ new/OrthancGdcm-1.3/Resources/CMake/GdcmConfiguration.cmake 2021-06-14 17:00:50.000000000 +0200 @@ -1,7 +1,7 @@ # Orthanc - A Lightweight, RESTful DICOM Store # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics # Department, University Hospital of Liege, Belgium -# Copyright (C) 2017-2020 Osimis S.A., Belgium +# Copyright (C) 2017-2021 Osimis S.A., Belgium # # This program is free software: you can redistribute it and/or # modify it under the terms of the GNU General Public License as diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OrthancGdcm-1.2/Resources/Orthanc/CMake/AutoGeneratedCode.cmake new/OrthancGdcm-1.3/Resources/Orthanc/CMake/AutoGeneratedCode.cmake --- old/OrthancGdcm-1.2/Resources/Orthanc/CMake/AutoGeneratedCode.cmake 2020-12-17 17:22:34.000000000 +0100 +++ new/OrthancGdcm-1.3/Resources/Orthanc/CMake/AutoGeneratedCode.cmake 2021-06-14 17:00:50.000000000 +0200 @@ -1,7 +1,7 @@ # Orthanc - A Lightweight, RESTful DICOM Store # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics # Department, University Hospital of Liege, Belgium -# Copyright (C) 2017-2020 Osimis S.A., Belgium +# Copyright (C) 2017-2021 Osimis S.A., Belgium # # This program is free software: you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OrthancGdcm-1.2/Resources/Orthanc/CMake/Compiler.cmake new/OrthancGdcm-1.3/Resources/Orthanc/CMake/Compiler.cmake --- old/OrthancGdcm-1.2/Resources/Orthanc/CMake/Compiler.cmake 2020-12-17 17:22:34.000000000 +0100 +++ new/OrthancGdcm-1.3/Resources/Orthanc/CMake/Compiler.cmake 2021-06-14 17:00:50.000000000 +0200 @@ -1,7 +1,7 @@ # Orthanc - A Lightweight, RESTful DICOM Store # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics # Department, University Hospital of Liege, Belgium -# Copyright (C) 2017-2020 Osimis S.A., Belgium +# Copyright (C) 2017-2021 Osimis S.A., Belgium # # This program is free software: you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License @@ -188,7 +188,7 @@ add_definitions( -D_CRT_SECURE_NO_WARNINGS=1 ) - link_libraries(rpcrt4 ws2_32) + link_libraries(rpcrt4 ws2_32 iphlpapi) # "iphlpapi" is for "SystemToolbox::GetMacAddresses()" if (CMAKE_COMPILER_IS_GNUCXX) # Some additional C/C++ compiler flags for MinGW diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OrthancGdcm-1.2/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake new/OrthancGdcm-1.3/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake --- old/OrthancGdcm-1.2/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake 2020-12-17 17:22:34.000000000 +0100 +++ new/OrthancGdcm-1.3/Resources/Orthanc/CMake/DownloadOrthancFramework.cmake 2021-06-14 17:00:50.000000000 +0200 @@ -1,7 +1,7 @@ # Orthanc - A Lightweight, RESTful DICOM Store # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics # Department, University Hospital of Liege, Belgium -# Copyright (C) 2017-2020 Osimis S.A., Belgium +# Copyright (C) 2017-2021 Osimis S.A., Belgium # # This program is free software: you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License @@ -120,6 +120,16 @@ set(ORTHANC_FRAMEWORK_MD5 "f8ec7554ef5d23ea4ce474b1e8214de9") elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.8.1") set(ORTHANC_FRAMEWORK_MD5 "db094f96399cbe8b9bbdbce34884c220") + elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.8.2") + set(ORTHANC_FRAMEWORK_MD5 "8bfa10e66c9931e74111be0bfb1f4548") + elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.0") + set(ORTHANC_FRAMEWORK_MD5 "cea0b02ce184671eaf1bd668beefbf28") + elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.1") + set(ORTHANC_FRAMEWORK_MD5 "08eebc66ef93c3b40115c38501db5fbd") + elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.2") + set(ORTHANC_FRAMEWORK_MD5 "3ea66c09f64aca990016683b6375734e") + elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "1.9.3") + set(ORTHANC_FRAMEWORK_MD5 "9b86e6f00e03278293cd15643cc0233f") # Below this point are development snapshots that were used to # release some plugin, before an official release of the Orthanc @@ -137,6 +147,9 @@ elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "4a3ba4bf4ba7") # PostgreSQL 3.3 (framework pre-1.8.2) set(ORTHANC_FRAMEWORK_MD5 "2d82bddf06f9cfe82095495cb3b8abde") + elseif (ORTHANC_FRAMEWORK_VERSION STREQUAL "23ad1b9c7800") + # For "Toolbox::ReadJson()" and "Toolbox::Write{...}Json()" (pre-1.9.0) + set(ORTHANC_FRAMEWORK_MD5 "9af92080e57c60dd288eba46ce606c00") endif() endif() endif() @@ -421,6 +434,8 @@ if (ORTHANC_FRAMEWORK_SOURCE STREQUAL "system") set(ORTHANC_FRAMEWORK_LIBDIR "" CACHE PATH "") + set(ORTHANC_FRAMEWORK_USE_SHARED ON CACHE BOOL "Whether to use the shared library or the static library") + set(ORTHANC_FRAMEWORK_ADDITIONAL_LIBRARIES "" CACHE STRING "Additional libraries to link against, separated by whitespaces, typically needed if using the static library (a common minimal value is \"boost_filesystem boost_iostreams boost_locale boost_regex boost_thread jsoncpp pugixml uuid\")") if (CMAKE_SYSTEM_NAME STREQUAL "Windows" AND CMAKE_COMPILER_IS_GNUCXX) # MinGW @@ -437,113 +452,75 @@ include(${CMAKE_CURRENT_LIST_DIR}/AutoGeneratedCode.cmake) set(EMBED_RESOURCES_PYTHON ${CMAKE_CURRENT_LIST_DIR}/EmbedResources.py) - if ("${CMAKE_SYSTEM_NAME}" STREQUAL "Windows" OR - ORTHANC_FRAMEWORK_STATIC) - include_directories(${ORTHANC_FRAMEWORK_ROOT}/..) + if (ORTHANC_FRAMEWORK_USE_SHARED) + list(GET CMAKE_FIND_LIBRARY_PREFIXES 0 Prefix) + list(GET CMAKE_FIND_LIBRARY_SUFFIXES 0 Suffix) + else() + list(GET CMAKE_FIND_LIBRARY_PREFIXES 0 Prefix) + list(GET CMAKE_FIND_LIBRARY_SUFFIXES 1 Suffix) + endif() + + # The "OrthancFramework" library must be the first one to be included + if ("${ORTHANC_FRAMEWORK_LIBDIR}" STREQUAL "") + set(ORTHANC_FRAMEWORK_LIBRARIES ${Prefix}OrthancFramework${Suffix}) + else () + set(ORTHANC_FRAMEWORK_LIBRARIES ${ORTHANC_FRAMEWORK_LIBDIR}/${Prefix}OrthancFramework${Suffix}) + endif() + + if (NOT ORTHANC_FRAMEWORK_ADDITIONAL_LIBRARIES STREQUAL "") + # https://stackoverflow.com/a/5272993/881731 + string(REPLACE " " ";" tmp ${ORTHANC_FRAMEWORK_ADDITIONAL_LIBRARIES}) + list(APPEND ORTHANC_FRAMEWORK_LIBRARIES ${tmp}) + endif() + + # Look for the version of the mandatory dependency JsonCpp (cf. JsonCppConfiguration.cmake) + if (CMAKE_CROSSCOMPILING) + set(JSONCPP_INCLUDE_DIR ${ORTHANC_FRAMEWORK_ROOT}/..) else() - # Look for mandatory dependency JsonCpp (cf. JsonCppConfiguration.cmake) find_path(JSONCPP_INCLUDE_DIR json/reader.h + ${ORTHANC_FRAMEWORK_ROOT}/.. /usr/include/jsoncpp /usr/local/include/jsoncpp ) + endif() - message("JsonCpp include dir: ${JSONCPP_INCLUDE_DIR}") - include_directories(${JSONCPP_INCLUDE_DIR}) - link_libraries(jsoncpp) - - CHECK_INCLUDE_FILE_CXX(${JSONCPP_INCLUDE_DIR}/json/reader.h HAVE_JSONCPP_H) - if (NOT HAVE_JSONCPP_H) - message(FATAL_ERROR "Please install the libjsoncpp-dev package") - endif() - - # Switch to the C++11 standard if the version of JsonCpp is 1.y.z - # (same as variable JSONCPP_CXX11 in the source code of Orthanc) - if (EXISTS ${JSONCPP_INCLUDE_DIR}/json/version.h) - file(STRINGS - "${JSONCPP_INCLUDE_DIR}/json/version.h" - JSONCPP_VERSION_MAJOR1 REGEX - ".*define JSONCPP_VERSION_MAJOR.*") - - if (NOT JSONCPP_VERSION_MAJOR1) - message(FATAL_ERROR "Unable to extract the major version of JsonCpp") - endif() - - string(REGEX REPLACE - ".*JSONCPP_VERSION_MAJOR.*([0-9]+)$" "\\1" - JSONCPP_VERSION_MAJOR ${JSONCPP_VERSION_MAJOR1}) - message("JsonCpp major version: ${JSONCPP_VERSION_MAJOR}") - - if (JSONCPP_VERSION_MAJOR GREATER 0) - message("Switching to C++11 standard, as version of JsonCpp is >= 1.0.0") - if (CMAKE_COMPILER_IS_GNUCXX) - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") - elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") - endif() - endif() - else() - message("Unable to detect the major version of JsonCpp, assuming < 1.0.0") - endif() + message("JsonCpp include dir: ${JSONCPP_INCLUDE_DIR}") + include_directories(${JSONCPP_INCLUDE_DIR}) - # Look for mandatory dependency Boost (cf. BoostConfiguration.cmake) - include(FindBoost) - find_package(Boost COMPONENTS filesystem thread system date_time regex ${ORTHANC_BOOST_COMPONENTS}) + CHECK_INCLUDE_FILE_CXX(${JSONCPP_INCLUDE_DIR}/json/reader.h HAVE_JSONCPP_H) + if (NOT HAVE_JSONCPP_H) + message(FATAL_ERROR "Please install the libjsoncpp-dev package") + endif() + + # Switch to the C++11 standard if the version of JsonCpp is 1.y.z + # (same as variable JSONCPP_CXX11 in the source code of Orthanc) + if (EXISTS ${JSONCPP_INCLUDE_DIR}/json/version.h) + file(STRINGS + "${JSONCPP_INCLUDE_DIR}/json/version.h" + JSONCPP_VERSION_MAJOR1 REGEX + ".*define JSONCPP_VERSION_MAJOR.*") - if (NOT Boost_FOUND) - message(FATAL_ERROR "Unable to locate Boost on this system") + if (NOT JSONCPP_VERSION_MAJOR1) + message(FATAL_ERROR "Unable to extract the major version of JsonCpp") endif() - include_directories(${Boost_INCLUDE_DIRS}) - link_libraries(${Boost_LIBRARIES}) - - # Optional component - Lua - if (ENABLE_LUA) - include(FindLua) - - if (NOT LUA_FOUND) - message(FATAL_ERROR "Please install the liblua-dev package") - endif() - - include_directories(${LUA_INCLUDE_DIR}) - link_libraries(${LUA_LIBRARIES}) - endif() - - # Optional component - SQLite - if (ENABLE_SQLITE) - CHECK_INCLUDE_FILE(sqlite3.h HAVE_SQLITE_H) - if (NOT HAVE_SQLITE_H) - message(FATAL_ERROR "Please install the libsqlite3-dev package") - endif() - link_libraries(sqlite3) - endif() - - # Optional component - Pugixml - if (ENABLE_PUGIXML) - CHECK_INCLUDE_FILE_CXX(pugixml.hpp HAVE_PUGIXML_H) - if (NOT HAVE_PUGIXML_H) - message(FATAL_ERROR "Please install the libpugixml-dev package") - endif() - link_libraries(pugixml) - endif() - - # Optional component - DCMTK - if (ENABLE_DCMTK) - include(FindDCMTK) - include_directories(${DCMTK_INCLUDE_DIRS}) - link_libraries(${DCMTK_LIBRARIES}) - endif() - - # Optional component - OpenSSL - if (ENABLE_SSL) - include(FindOpenSSL) - if (NOT ${OPENSSL_FOUND}) - message(FATAL_ERROR "Unable to find OpenSSL") + string(REGEX REPLACE + ".*JSONCPP_VERSION_MAJOR.*([0-9]+)$" "\\1" + JSONCPP_VERSION_MAJOR ${JSONCPP_VERSION_MAJOR1}) + message("JsonCpp major version: ${JSONCPP_VERSION_MAJOR}") + + if (JSONCPP_VERSION_MAJOR GREATER 0) + message("Switching to C++11 standard, as version of JsonCpp is >= 1.0.0") + if (CMAKE_COMPILER_IS_GNUCXX) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11") + elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11") endif() - include_directories(${OPENSSL_INCLUDE_DIR}) - link_libraries(${OPENSSL_LIBRARIES}) endif() + else() + message("Unable to detect the major version of JsonCpp, assuming < 1.0.0") endif() - + # Look for Orthanc framework shared library include(CheckCXXSymbolExists) @@ -563,28 +540,17 @@ message("Orthanc framework include dir: ${ORTHANC_FRAMEWORK_INCLUDE_DIR}") include_directories(${ORTHANC_FRAMEWORK_INCLUDE_DIR}) - - if ("${ORTHANC_FRAMEWORK_LIBDIR}" STREQUAL "") - set(ORTHANC_FRAMEWORK_LIBRARIES OrthancFramework) - else() - if (MSVC) - set(Suffix ".lib") - set(Prefix "") - else() - list(GET CMAKE_FIND_LIBRARY_PREFIXES 0 Prefix) - list(GET CMAKE_FIND_LIBRARY_SUFFIXES 0 Suffix) - endif() - set(ORTHANC_FRAMEWORK_LIBRARIES ${ORTHANC_FRAMEWORK_LIBDIR}/${Prefix}OrthancFramework${Suffix}) - endif() - set(CMAKE_REQUIRED_INCLUDES "${ORTHANC_FRAMEWORK_INCLUDE_DIR}") - set(CMAKE_REQUIRED_LIBRARIES "${ORTHANC_FRAMEWORK_LIBRARIES}") - - check_cxx_symbol_exists("Orthanc::InitializeFramework" "OrthancFramework.h" HAVE_ORTHANC_FRAMEWORK) - if (NOT HAVE_ORTHANC_FRAMEWORK) - message(FATAL_ERROR "Cannot find the Orthanc framework") + if (ORTHANC_FRAMEWORK_USE_SHARED) + set(CMAKE_REQUIRED_INCLUDES "${ORTHANC_FRAMEWORK_INCLUDE_DIR}") + set(CMAKE_REQUIRED_LIBRARIES "${ORTHANC_FRAMEWORK_LIBRARIES}") + + check_cxx_symbol_exists("Orthanc::InitializeFramework" "OrthancFramework.h" HAVE_ORTHANC_FRAMEWORK) + if (NOT HAVE_ORTHANC_FRAMEWORK) + message(FATAL_ERROR "Cannot find the Orthanc framework") + endif() + + unset(CMAKE_REQUIRED_INCLUDES) + unset(CMAKE_REQUIRED_LIBRARIES) endif() - - unset(CMAKE_REQUIRED_INCLUDES) - unset(CMAKE_REQUIRED_LIBRARIES) endif() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OrthancGdcm-1.2/Resources/Orthanc/CMake/DownloadPackage.cmake new/OrthancGdcm-1.3/Resources/Orthanc/CMake/DownloadPackage.cmake --- old/OrthancGdcm-1.2/Resources/Orthanc/CMake/DownloadPackage.cmake 2020-12-17 17:22:34.000000000 +0100 +++ new/OrthancGdcm-1.3/Resources/Orthanc/CMake/DownloadPackage.cmake 2021-06-14 17:00:50.000000000 +0200 @@ -1,7 +1,7 @@ # Orthanc - A Lightweight, RESTful DICOM Store # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics # Department, University Hospital of Liege, Belgium -# Copyright (C) 2017-2020 Osimis S.A., Belgium +# Copyright (C) 2017-2021 Osimis S.A., Belgium # # This program is free software: you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OrthancGdcm-1.2/Resources/Orthanc/LinuxStandardBaseToolchain.cmake new/OrthancGdcm-1.3/Resources/Orthanc/LinuxStandardBaseToolchain.cmake --- old/OrthancGdcm-1.2/Resources/Orthanc/LinuxStandardBaseToolchain.cmake 2020-12-17 17:22:34.000000000 +0100 +++ new/OrthancGdcm-1.3/Resources/Orthanc/LinuxStandardBaseToolchain.cmake 2021-06-14 17:00:50.000000000 +0200 @@ -1,7 +1,7 @@ # Orthanc - A Lightweight, RESTful DICOM Store # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics # Department, University Hospital of Liege, Belgium -# Copyright (C) 2017-2020 Osimis S.A., Belgium +# Copyright (C) 2017-2021 Osimis S.A., Belgium # # This program is free software: you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OrthancGdcm-1.2/Resources/Orthanc/MinGW-W64-Toolchain32.cmake new/OrthancGdcm-1.3/Resources/Orthanc/MinGW-W64-Toolchain32.cmake --- old/OrthancGdcm-1.2/Resources/Orthanc/MinGW-W64-Toolchain32.cmake 2020-12-17 17:22:34.000000000 +0100 +++ new/OrthancGdcm-1.3/Resources/Orthanc/MinGW-W64-Toolchain32.cmake 2021-06-14 17:00:50.000000000 +0200 @@ -1,7 +1,7 @@ # Orthanc - A Lightweight, RESTful DICOM Store # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics # Department, University Hospital of Liege, Belgium -# Copyright (C) 2017-2020 Osimis S.A., Belgium +# Copyright (C) 2017-2021 Osimis S.A., Belgium # # This program is free software: you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OrthancGdcm-1.2/Resources/Orthanc/MinGW-W64-Toolchain64.cmake new/OrthancGdcm-1.3/Resources/Orthanc/MinGW-W64-Toolchain64.cmake --- old/OrthancGdcm-1.2/Resources/Orthanc/MinGW-W64-Toolchain64.cmake 2020-12-17 17:22:34.000000000 +0100 +++ new/OrthancGdcm-1.3/Resources/Orthanc/MinGW-W64-Toolchain64.cmake 2021-06-14 17:00:50.000000000 +0200 @@ -1,7 +1,7 @@ # Orthanc - A Lightweight, RESTful DICOM Store # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics # Department, University Hospital of Liege, Belgium -# Copyright (C) 2017-2020 Osimis S.A., Belgium +# Copyright (C) 2017-2021 Osimis S.A., Belgium # # This program is free software: you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OrthancGdcm-1.2/Resources/Orthanc/MinGWToolchain.cmake new/OrthancGdcm-1.3/Resources/Orthanc/MinGWToolchain.cmake --- old/OrthancGdcm-1.2/Resources/Orthanc/MinGWToolchain.cmake 2020-12-17 17:22:34.000000000 +0100 +++ new/OrthancGdcm-1.3/Resources/Orthanc/MinGWToolchain.cmake 2021-06-14 17:00:50.000000000 +0200 @@ -1,7 +1,7 @@ # Orthanc - A Lightweight, RESTful DICOM Store # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics # Department, University Hospital of Liege, Belgium -# Copyright (C) 2017-2020 Osimis S.A., Belgium +# Copyright (C) 2017-2021 Osimis S.A., Belgium # # This program is free software: you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public License diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OrthancGdcm-1.2/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp new/OrthancGdcm-1.3/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp --- old/OrthancGdcm-1.2/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp 2020-12-17 17:22:34.000000000 +0100 +++ new/OrthancGdcm-1.3/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.cpp 2021-06-14 17:00:50.000000000 +0200 @@ -2,7 +2,7 @@ * Orthanc - A Lightweight, RESTful DICOM Store * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics * Department, University Hospital of Liege, Belgium - * Copyright (C) 2017-2020 Osimis S.A., Belgium + * Copyright (C) 2017-2021 Osimis S.A., Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -24,9 +24,33 @@ #include <boost/algorithm/string/predicate.hpp> #include <boost/move/unique_ptr.hpp> #include <boost/thread.hpp> + + #include <json/reader.h> +#include <json/version.h> #include <json/writer.h> +#if !defined(JSONCPP_VERSION_MAJOR) || !defined(JSONCPP_VERSION_MINOR) +# error Cannot access the version of JsonCpp +#endif + + +/** + * We use deprecated "Json::Reader", "Json::StyledWriter" and + * "Json::FastWriter" if JsonCpp < 1.7.0. This choice is rather + * arbitrary, but if Json >= 1.9.0, gcc generates explicit deprecation + * warnings (clang was warning in earlier versions). For reference, + * these classes seem to have been deprecated since JsonCpp 1.4.0 (on + * February 2015) by the following changeset: + * https://github.com/open-source-parsers/jsoncpp/commit/8df98f6112890d6272734975dd6d70cf8999bb22 + **/ +#if (JSONCPP_VERSION_MAJOR >= 2 || \ + (JSONCPP_VERSION_MAJOR == 1 && JSONCPP_VERSION_MINOR >= 8)) +# define JSONCPP_USE_DEPRECATED 0 +#else +# define JSONCPP_USE_DEPRECATED 1 +#endif + #if !ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 2, 0) static const OrthancPluginErrorCode OrthancPluginErrorCode_NullPointer = OrthancPluginErrorCode_Plugin; @@ -202,10 +226,7 @@ ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); } - const char* tmp = reinterpret_cast<const char*>(buffer_.data); - - Json::Reader reader; - if (!reader.parse(tmp, tmp + buffer_.size, target)) + if (!ReadJson(target, buffer_.data, buffer_.size)) { LogError("Cannot convert some memory buffer to JSON"); ORTHANC_PLUGINS_THROW_EXCEPTION(BadFileFormat); @@ -292,12 +313,102 @@ } + static bool ReadJsonInternal(Json::Value& target, + const void* buffer, + size_t size, + bool collectComments) + { +#if JSONCPP_USE_DEPRECATED == 1 + Json::Reader reader; + return reader.parse(reinterpret_cast<const char*>(buffer), + reinterpret_cast<const char*>(buffer) + size, target, collectComments); +#else + Json::CharReaderBuilder builder; + builder.settings_["collectComments"] = collectComments; + + const std::unique_ptr<Json::CharReader> reader(builder.newCharReader()); + assert(reader.get() != NULL); + + JSONCPP_STRING err; + if (reader->parse(reinterpret_cast<const char*>(buffer), + reinterpret_cast<const char*>(buffer) + size, &target, &err)) + { + return true; + } + else + { + LogError("Cannot parse JSON: " + std::string(err)); + return false; + } +#endif + } + + + bool ReadJson(Json::Value& target, + const std::string& source) + { + return ReadJson(target, source.empty() ? NULL : source.c_str(), source.size()); + } + + + bool ReadJson(Json::Value& target, + const void* buffer, + size_t size) + { + return ReadJsonInternal(target, buffer, size, true); + } + + + bool ReadJsonWithoutComments(Json::Value& target, + const std::string& source) + { + return ReadJsonWithoutComments(target, source.empty() ? NULL : source.c_str(), source.size()); + } + + + bool ReadJsonWithoutComments(Json::Value& target, + const void* buffer, + size_t size) + { + return ReadJsonInternal(target, buffer, size, false); + } + + + void WriteFastJson(std::string& target, + const Json::Value& source) + { +#if JSONCPP_USE_DEPRECATED == 1 + Json::FastWriter writer; + target = writer.write(source); +#else + Json::StreamWriterBuilder builder; + builder.settings_["indentation"] = ""; + target = Json::writeString(builder, source); +#endif + } + + + void WriteStyledJson(std::string& target, + const Json::Value& source) + { +#if JSONCPP_USE_DEPRECATED == 1 + Json::StyledWriter writer; + target = writer.write(source); +#else + Json::StreamWriterBuilder builder; + builder.settings_["indentation"] = " "; + target = Json::writeString(builder, source); +#endif + } + + bool MemoryBuffer::RestApiPost(const std::string& uri, const Json::Value& body, bool applyPlugins) { - Json::FastWriter writer; - return RestApiPost(uri, writer.write(body), applyPlugins); + std::string s; + WriteFastJson(s, body); + return RestApiPost(uri, s, applyPlugins); } @@ -305,8 +416,9 @@ const Json::Value& body, bool applyPlugins) { - Json::FastWriter writer; - return RestApiPut(uri, writer.write(body), applyPlugins); + std::string s; + WriteFastJson(s, body); + return RestApiPut(uri, s, applyPlugins); } @@ -315,8 +427,8 @@ { Clear(); - Json::FastWriter writer; - std::string s = writer.write(tags); + std::string s; + WriteFastJson(s, tags); Check(OrthancPluginCreateDicom(GetGlobalContext(), &buffer_, s.c_str(), NULL, flags)); } @@ -327,8 +439,8 @@ { Clear(); - Json::FastWriter writer; - std::string s = writer.write(tags); + std::string s; + WriteFastJson(s, tags); Check(OrthancPluginCreateDicom(GetGlobalContext(), &buffer_, s.c_str(), pixelData.GetObject(), flags)); } @@ -390,8 +502,7 @@ ORTHANC_PLUGINS_THROW_EXCEPTION(InternalError); } - Json::Reader reader; - if (!reader.parse(str_, target)) + if (!ReadJson(target, str_)) { LogError("Cannot convert some memory buffer to JSON"); ORTHANC_PLUGINS_THROW_EXCEPTION(BadFileFormat); @@ -1190,19 +1301,16 @@ #endif /* HAS_ORTHANC_PLUGIN_FIND_MATCHER == 1 */ void AnswerJson(const Json::Value& value, - OrthancPluginRestOutput* output - ) + OrthancPluginRestOutput* output) { - Json::StyledWriter writer; - std::string bodyString = writer.write(value); - + std::string bodyString; + WriteStyledJson(bodyString, value); OrthancPluginAnswerBuffer(GetGlobalContext(), output, bodyString.c_str(), bodyString.size(), "application/json"); } void AnswerString(const std::string& answer, const char* mimeType, - OrthancPluginRestOutput* output - ) + OrthancPluginRestOutput* output) { OrthancPluginAnswerBuffer(GetGlobalContext(), output, answer.c_str(), answer.size(), mimeType); } @@ -1324,8 +1432,9 @@ const Json::Value& body, bool applyPlugins) { - Json::FastWriter writer; - return RestApiPost(result, uri, writer.write(body), applyPlugins); + std::string s; + WriteFastJson(s, body); + return RestApiPost(result, uri, s, applyPlugins); } @@ -1357,8 +1466,9 @@ const Json::Value& body, bool applyPlugins) { - Json::FastWriter writer; - return RestApiPut(result, uri, writer.write(body), applyPlugins); + std::string s; + WriteFastJson(s, body); + return RestApiPut(result, uri, s, applyPlugins); } @@ -2020,8 +2130,7 @@ } else { - Json::FastWriter writer; - content_ = writer.write(content); + WriteFastJson(content_, content); } } @@ -2041,8 +2150,7 @@ } else { - Json::FastWriter writer; - serialized_ = writer.write(serialized); + WriteFastJson(serialized_, serialized); hasSerialized_ = true; } } @@ -2618,10 +2726,18 @@ delete *it; } + size_ = 0; content_.clear(); } - void Flatten(std::string& target) const + /** + * Since Orthanc 1.9.3, this function also clears the content of + * the ChunkedBuffer in order to mimic the behavior of the + * original class "Orthanc::ChunkedBuffer". This prevents the + * forgetting of calling "Clear()" in order to reduce memory + * consumption. + **/ + void Flatten(std::string& target) { target.resize(size_); @@ -2637,10 +2753,14 @@ memcpy(&target[pos], (*it)->c_str(), s); pos += s; } + + delete *it; } - assert(size_ == 0 || - pos == target.size()); + assert(pos == target.size()); + + size_ = 0; + content_.clear(); } void AddChunk(const void* data, @@ -2671,7 +2791,7 @@ return headers_; } - const ChunkedBuffer& GetBody() const + ChunkedBuffer& GetBody() { return body_; } @@ -2902,8 +3022,7 @@ std::string body; Execute(answerHeaders, body); - Json::Reader reader; - if (!reader.parse(body, answerBody)) + if (!ReadJson(answerBody, body)) { LogError("Cannot convert HTTP answer body to JSON"); ORTHANC_PLUGINS_THROW_EXCEPTION(BadFileFormat); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OrthancGdcm-1.2/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h new/OrthancGdcm-1.3/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h --- old/OrthancGdcm-1.2/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h 2020-12-17 17:22:34.000000000 +0100 +++ new/OrthancGdcm-1.3/Resources/Orthanc/Plugins/OrthancPluginCppWrapper.h 2021-06-14 17:00:50.000000000 +0200 @@ -2,7 +2,7 @@ * Orthanc - A Lightweight, RESTful DICOM Store * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics * Department, University Hospital of Liege, Belgium - * Copyright (C) 2017-2020 Osimis S.A., Belgium + * Copyright (C) 2017-2021 Osimis S.A., Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as @@ -476,6 +476,26 @@ #endif + bool ReadJson(Json::Value& target, + const std::string& source); + + bool ReadJson(Json::Value& target, + const void* buffer, + size_t size); + + bool ReadJsonWithoutComments(Json::Value& target, + const std::string& source); + + bool ReadJsonWithoutComments(Json::Value& target, + const void* buffer, + size_t size); + + void WriteFastJson(std::string& target, + const Json::Value& source); + + void WriteStyledJson(std::string& target, + const Json::Value& source); + bool RestApiGet(Json::Value& result, const std::string& uri, bool applyPlugins); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OrthancGdcm-1.2/Resources/Orthanc/Plugins/OrthancPluginException.h new/OrthancGdcm-1.3/Resources/Orthanc/Plugins/OrthancPluginException.h --- old/OrthancGdcm-1.2/Resources/Orthanc/Plugins/OrthancPluginException.h 2020-12-17 17:22:34.000000000 +0100 +++ new/OrthancGdcm-1.3/Resources/Orthanc/Plugins/OrthancPluginException.h 2021-06-14 17:00:50.000000000 +0200 @@ -2,7 +2,7 @@ * Orthanc - A Lightweight, RESTful DICOM Store * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics * Department, University Hospital of Liege, Belgium - * Copyright (C) 2017-2020 Osimis S.A., Belgium + * Copyright (C) 2017-2021 Osimis S.A., Belgium * * This program is free software: you can redistribute it and/or * modify it under the terms of the GNU General Public License as diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OrthancGdcm-1.2/Resources/Orthanc/Plugins/OrthancPluginsExports.cmake new/OrthancGdcm-1.3/Resources/Orthanc/Plugins/OrthancPluginsExports.cmake --- old/OrthancGdcm-1.2/Resources/Orthanc/Plugins/OrthancPluginsExports.cmake 2020-12-17 17:22:34.000000000 +0100 +++ new/OrthancGdcm-1.3/Resources/Orthanc/Plugins/OrthancPluginsExports.cmake 2021-06-14 17:00:50.000000000 +0200 @@ -1,7 +1,7 @@ # Orthanc - A Lightweight, RESTful DICOM Store # Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics # Department, University Hospital of Liege, Belgium -# Copyright (C) 2017-2020 Osimis S.A., Belgium +# Copyright (C) 2017-2021 Osimis S.A., Belgium # # This program is free software: you can redistribute it and/or # modify it under the terms of the GNU General Public License as diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/OrthancGdcm-1.2/Resources/RunCppCheck.sh new/OrthancGdcm-1.3/Resources/RunCppCheck.sh --- old/OrthancGdcm-1.2/Resources/RunCppCheck.sh 1970-01-01 01:00:00.000000000 +0100 +++ new/OrthancGdcm-1.3/Resources/RunCppCheck.sh 2021-06-14 17:00:50.000000000 +0200 @@ -0,0 +1,52 @@ +#!/bin/bash + +set -ex + +CPPCHECK=cppcheck + +if [ $# -ge 1 ]; then + CPPCHECK=$1 +fi + +cat <<EOF > /tmp/cppcheck-suppressions.txt +unusedFunction +EOF + +${CPPCHECK} --enable=all --quiet --std=c++11 \ + --suppressions-list=/tmp/cppcheck-suppressions.txt \ + -DHAS_ORTHANC_EXCEPTION=1 \ + -DORTHANC_BUILDING_FRAMEWORK_LIBRARY=1 \ + -DORTHANC_ENABLE_BASE64=1 \ + -DORTHANC_ENABLE_CIVETWEB=0 \ + -DORTHANC_ENABLE_CURL=1 \ + -DORTHANC_ENABLE_DCMTK=1 \ + -DORTHANC_ENABLE_DCMTK_JPEG=1 \ + -DORTHANC_ENABLE_DCMTK_JPEG_LOSSLESS=1 \ + -DORTHANC_ENABLE_GLEW=1 \ + -DORTHANC_ENABLE_JPEG=1 \ + -DORTHANC_ENABLE_LOCALE=1 \ + -DORTHANC_ENABLE_LOGGING=1 \ + -DORTHANC_ENABLE_LOGGING_STDIO=1 \ + -DORTHANC_ENABLE_MD5=1 \ + -DORTHANC_ENABLE_MONGOOSE=0 \ + -DORTHANC_ENABLE_OPENGL=1 \ + -DORTHANC_ENABLE_PKCS11=0 \ + -DORTHANC_ENABLE_PNG=1 \ + -DORTHANC_ENABLE_PUGIXML=0 \ + -DORTHANC_ENABLE_SDL=1 \ + -DORTHANC_ENABLE_SSL=1 \ + -DORTHANC_ENABLE_THREADS=1 \ + -DORTHANC_ENABLE_WASM=1 \ + -DORTHANC_ENABLE_ZLIB=1 \ + -DORTHANC_SANDBOXED=0 \ + -D__GNUC__ \ + -D__cplusplus=201103 \ + -D__linux__ \ + -DEM_ASM \ + -UNDEBUG \ + -I/home/jodogne/Subversion/orthanc/OrthancFramework/Sources \ + -I/home/jodogne/Subversion/orthanc/OrthancServer/Plugins/Include/ \ + \ + ../Plugin \ + \ + 2>&1
