comparison Plugins/Engine/OrthancPlugins.cpp @ 1603:905b4db3092b

CompressAndAnswerJpegImage
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 01 Sep 2015 13:08:41 +0200
parents 7151d63e6d81
children 1f5d6a2f9638
comparison
equal deleted inserted replaced
1602:292bce3f54ed 1603:905b4db3092b
32 32
33 #include "OrthancPlugins.h" 33 #include "OrthancPlugins.h"
34 34
35 #include "../../Core/ChunkedBuffer.h" 35 #include "../../Core/ChunkedBuffer.h"
36 #include "../../Core/HttpServer/HttpToolbox.h" 36 #include "../../Core/HttpServer/HttpToolbox.h"
37 #include "../../Core/ImageFormats/PngWriter.h"
38 #include "../../Core/Logging.h" 37 #include "../../Core/Logging.h"
39 #include "../../Core/OrthancException.h" 38 #include "../../Core/OrthancException.h"
40 #include "../../Core/Toolbox.h" 39 #include "../../Core/Toolbox.h"
41 #include "../../OrthancServer/OrthancInitialization.h" 40 #include "../../OrthancServer/OrthancInitialization.h"
42 #include "../../OrthancServer/ServerContext.h" 41 #include "../../OrthancServer/ServerContext.h"
43 #include "../../OrthancServer/ServerToolbox.h" 42 #include "../../OrthancServer/ServerToolbox.h"
44 #include "../../Core/Compression/ZlibCompressor.h" 43 #include "../../Core/Compression/ZlibCompressor.h"
45 #include "../../Core/Compression/GzipCompressor.h" 44 #include "../../Core/Compression/GzipCompressor.h"
46 #include "../../Core/ImageFormats/PngReader.h" 45 #include "../../Core/ImageFormats/PngReader.h"
47 #include "../../Core/ImageFormats/PngWriter.h" 46 #include "../../Core/ImageFormats/PngWriter.h"
47 #include "../../Core/ImageFormats/JpegWriter.h"
48 48
49 #include <boost/regex.hpp> 49 #include <boost/regex.hpp>
50 50
51 namespace Orthanc 51 namespace Orthanc
52 { 52 {
718 break; 718 break;
719 } 719 }
720 720
721 case OrthancPluginImageFormat_Jpeg: 721 case OrthancPluginImageFormat_Jpeg:
722 { 722 {
723 // TODO 723 JpegWriter writer;
724 // quality 724 writer.SetQuality(p.quality);
725 writer.WriteToMemory(compressed, accessor);
726 translatedOutput->SetContentType("image/jpeg");
727 break;
725 } 728 }
726 729
727 default: 730 default:
728 throw OrthancException(ErrorCode_ParameterOutOfRange); 731 throw OrthancException(ErrorCode_ParameterOutOfRange);
729 } 732 }