# HG changeset patch # User Sebastien Jodogne # Date 1539852204 -7200 # Node ID da43ef7ff32a079798934cbddebe12072ae8e387 # Parent a27b0e9a3fd95bac3e7352fa1b837234318ddce6 cont diff -r a27b0e9a3fd9 -r da43ef7ff32a Core/HttpServer/MongooseServer.cpp --- a/Core/HttpServer/MongooseServer.cpp Thu Oct 18 10:35:09 2018 +0200 +++ b/Core/HttpServer/MongooseServer.cpp Thu Oct 18 10:43:24 2018 +0200 @@ -38,6 +38,7 @@ #include "../Logging.h" #include "../ChunkedBuffer.h" +#include "../OrthancException.h" #include "HttpToolbox.h" #if ORTHANC_ENABLE_MONGOOSE == 1 diff -r a27b0e9a3fd9 -r da43ef7ff32a Core/HttpServer/MongooseServer.h --- a/Core/HttpServer/MongooseServer.h Thu Oct 18 10:35:09 2018 +0200 +++ b/Core/HttpServer/MongooseServer.h Thu Oct 18 10:43:24 2018 +0200 @@ -49,8 +49,6 @@ #include "IIncomingHttpRequestFilter.h" -#include "../OrthancException.h" - #include #include #include @@ -60,6 +58,7 @@ namespace Orthanc { class ChunkStore; + class OrthancException; class IHttpExceptionFormatter : public boost::noncopyable { diff -r a27b0e9a3fd9 -r da43ef7ff32a Core/Images/ImageProcessing.cpp --- a/Core/Images/ImageProcessing.cpp Thu Oct 18 10:35:09 2018 +0200 +++ b/Core/Images/ImageProcessing.cpp Thu Oct 18 10:43:24 2018 +0200 @@ -35,6 +35,7 @@ #include "ImageProcessing.h" #include "PixelTraits.h" +#include "../OrthancException.h" #include diff -r a27b0e9a3fd9 -r da43ef7ff32a Core/Images/PixelTraits.h --- a/Core/Images/PixelTraits.h Thu Oct 18 10:35:09 2018 +0200 +++ b/Core/Images/PixelTraits.h Thu Oct 18 10:43:24 2018 +0200 @@ -34,7 +34,6 @@ #pragma once #include "../Enumerations.h" -#include "../OrthancException.h" #include @@ -55,10 +54,13 @@ ORTHANC_FORCE_INLINE static PixelType IntegerToPixel(int64_t value) { - if (value < static_cast(std::numeric_limits::min()) || - value > static_cast(std::numeric_limits::max())) + if (value < static_cast(std::numeric_limits::min())) { - throw OrthancException(ErrorCode_ParameterOutOfRange); + return std::numeric_limits::min(); + } + else if (value > static_cast(std::numeric_limits::max())) + { + return std::numeric_limits::max(); } else {