diff Core/Images/JpegWriter.cpp @ 1916:5bcf721bde4f

IImageWriter
author Sebastien Jodogne <s.jodogne@gmail.com>
date Tue, 09 Feb 2016 15:26:37 +0100
parents 501769757bf9
children 08ce34cfacad
line wrap: on
line diff
--- a/Core/Images/JpegWriter.cpp	Tue Feb 09 14:50:29 2016 +0100
+++ b/Core/Images/JpegWriter.cpp	Tue Feb 09 15:26:37 2016 +0100
@@ -111,14 +111,15 @@
   }
 
 
-  void JpegWriter::WriteToFile(const char* filename,
-                               unsigned int width,
-                               unsigned int height,
-                               unsigned int pitch,
-                               PixelFormat format,
-                               const void* buffer)
+  void JpegWriter::WriteToFileInternal(const std::string& filename,
+                                       unsigned int width,
+                                       unsigned int height,
+                                       unsigned int pitch,
+                                       PixelFormat format,
+                                       const void* buffer)
   {
-    FILE* fp = fopen(filename, "wb");
+    // TODO This will not work on Windows system if the path contains non-ASCII characters
+    FILE* fp = fopen(filename.c_str(), "wb");
     if (fp == NULL)
     {
       throw OrthancException(ErrorCode_FullStorage);
@@ -156,12 +157,12 @@
   }
 
 
-  void JpegWriter::WriteToMemory(std::string& jpeg,
-                                 unsigned int width,
-                                 unsigned int height,
-                                 unsigned int pitch,
-                                 PixelFormat format,
-                                 const void* buffer)
+  void JpegWriter::WriteToMemoryInternal(std::string& jpeg,
+                                         unsigned int width,
+                                         unsigned int height,
+                                         unsigned int pitch,
+                                         PixelFormat format,
+                                         const void* buffer)
   {
     std::vector<uint8_t*> lines;
     GetLines(lines, height, pitch, format, buffer);