changeset 2895:da43ef7ff32a db-changes

cont
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 18 Oct 2018 10:43:24 +0200
parents a27b0e9a3fd9
children 3fabf9a673f6
files Core/HttpServer/MongooseServer.cpp Core/HttpServer/MongooseServer.h Core/Images/ImageProcessing.cpp Core/Images/PixelTraits.h
diffstat 4 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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 <list>
 #include <map>
 #include <set>
@@ -60,6 +58,7 @@
 namespace Orthanc
 {
   class ChunkStore;
+  class OrthancException;
 
   class IHttpExceptionFormatter : public boost::noncopyable
   {
--- 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 <boost/math/special_functions/round.hpp>
 
--- 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 <limits>
 
@@ -55,10 +54,13 @@
     ORTHANC_FORCE_INLINE
     static PixelType IntegerToPixel(int64_t value)
     {
-      if (value < static_cast<int64_t>(std::numeric_limits<PixelType>::min()) ||
-          value > static_cast<int64_t>(std::numeric_limits<PixelType>::max()))
+      if (value < static_cast<int64_t>(std::numeric_limits<PixelType>::min()))
       {
-        throw OrthancException(ErrorCode_ParameterOutOfRange);
+        return std::numeric_limits<PixelType>::min();
+      }
+      else if (value > static_cast<int64_t>(std::numeric_limits<PixelType>::max()))
+      {
+        return std::numeric_limits<PixelType>::max();        
       }
       else
       {