(thanks to Winfried for his help)
[openjpeg.git] / codec / j2k_dump.c
index 83fc1c94d5daa018fb0072a855bb25dd5141c523..3c3e8d9148650c2f01b07b4afbc28d0d9a3aef6d 100644 (file)
 #include <stdlib.h>
 #include <math.h>
 
-#include "opj_config.h"
-#include "openjpeg.h"
-#include "../libopenjpeg/j2k.h"
-#include "../libopenjpeg/jp2.h"
-#include "compat/getopt.h"
-#include "convert.h"
-#ifdef WIN32
+#ifdef _WIN32
 #include "windirent.h"
 #else
 #include <dirent.h>
-#endif /* WIN32 */
-#include "index.h"
+#endif /* _WIN32 */
 
-#ifndef WIN32
+#ifdef _WIN32
+#include <windows.h>
+#else
 #include <strings.h>
 #define _stricmp strcasecmp
 #define _strnicmp strncasecmp
-#endif
+#endif /* _WIN32 */
 
-/* ----------------------------------------------------------------------- */
-
-#define J2K_CFMT 0
-#define JP2_CFMT 1
-#define JPT_CFMT 2
+#include "opj_config.h"
+#include "openjpeg.h"
+#include "../libopenjpeg/j2k.h"
+#include "../libopenjpeg/jp2.h"
+#include "getopt.h"
+#include "convert.h"
+#include "index.h"
 
-#define PXM_DFMT 10
-#define PGX_DFMT 11
-#define BMP_DFMT 12
-#define YUV_DFMT 13
-#define TIF_DFMT 14
-#define RAW_DFMT 15
-#define TGA_DFMT 16
-#define PNG_DFMT 17
-/* ----------------------------------------------------------------------- */
+#include "format_defs.h"
 
 typedef struct dircnt{
        /** Buffer for holding images read from Directory*/
@@ -477,6 +466,10 @@ int main(int argc, char *argv[])
                                return 1;
                        }
                        /* dump image */
+         if(image->icc_profile_buf)
+        {
+         free(image->icc_profile_buf); image->icc_profile_buf = NULL;
+        }      
       j2k_dump_image(stdout, image);
 
                        /* dump cp */