[gdcm] Update charls patch for JpegLsDecode
Orion Poplawski
orion at fedoraproject.org
Wed Nov 2 15:16:21 UTC 2011
commit b2fed2e1136911d4a14130e80e74b8edbe6a1c02
Author: Orion Poplawski <orion at cora.nwra.com>
Date: Wed Nov 2 09:16:18 2011 -0600
Update charls patch for JpegLsDecode
gdcm-2.0.18-charls.patch | 17 +++++++++++++++--
1 files changed, 15 insertions(+), 2 deletions(-)
---
diff --git a/gdcm-2.0.18-charls.patch b/gdcm-2.0.18-charls.patch
index 61de90e..d67f1a5 100644
--- a/gdcm-2.0.18-charls.patch
+++ b/gdcm-2.0.18-charls.patch
@@ -1,6 +1,6 @@
diff -up gdcm-2.0.18/Examples/Cxx/FixJAIBugJPEGLS.cxx.charls gdcm-2.0.18/Examples/Cxx/FixJAIBugJPEGLS.cxx
--- gdcm-2.0.18/Examples/Cxx/FixJAIBugJPEGLS.cxx.charls 2011-06-29 01:08:45.000000000 -0600
-+++ gdcm-2.0.18/Examples/Cxx/FixJAIBugJPEGLS.cxx 2011-11-02 08:59:23.582956059 -0600
++++ gdcm-2.0.18/Examples/Cxx/FixJAIBugJPEGLS.cxx 2011-11-02 09:15:59.630494712 -0600
@@ -17,8 +17,7 @@
#include <fstream>
@@ -23,7 +23,7 @@ diff -up gdcm-2.0.18/Examples/Cxx/FixJAIBugJPEGLS.cxx.charls gdcm-2.0.18/Example
if (JpegLsReadHeader(buffer, totalLen, &metadata) != OK)
{
std::cerr << "Cant parse jpegls" << std::endl;
-@@ -156,7 +159,11 @@ int main(int argc, char *argv[])
+@@ -156,15 +159,24 @@ int main(int argc, char *argv[])
const char *pbyteCompressed = &vbuffer[0];
unsigned int cbyteCompressed = vbuffer.size(); // updated legnth
@@ -35,3 +35,16 @@ diff -up gdcm-2.0.18/Examples/Cxx/FixJAIBugJPEGLS.cxx.charls gdcm-2.0.18/Example
JpegLsReadHeader(pbyteCompressed, cbyteCompressed, ¶ms);
std::vector<BYTE> rgbyteOut;
+ //rgbyteOut.resize( image.GetBufferLength() );
+ rgbyteOut.resize(params.height *params.width * ((params.bitspersample + 7) / 8) * params.components);
+
++#ifdef GDCM_USE_SYSTEM_CHARLS
++ JLS_ERROR result =
++ JpegLsDecode(&rgbyteOut[0], rgbyteOut.size(), pbyteCompressed, cbyteCompressed, ¶ms );
++#else
+ JLS_ERROR result =
+ JpegLsDecode(&rgbyteOut[0], rgbyteOut.size(), pbyteCompressed, cbyteCompressed );
++#endif
+ if (result != OK)
+ {
+ std::cerr << "Could not patch JAI-JPEGLS" << std::endl;
More information about the scm-commits
mailing list