uclouvain / openjpeg

Official repository of the OpenJPEG project
Other
975 stars 456 forks source link

PAM error in opj_decompress #1005

Open szukw000 opened 7 years ago

szukw000 commented 7 years ago

PAM files can be compressed and decompressed. But the 'get_file_format()' function is missing a PAM entry.

--- openjpeg2-2017-08-10/src/bin/jp2/opj_decompress.c.orig  2017-08-28 10:53:24.028669178 +0200
+++ openjpeg2-2017-08-10/src/bin/jp2/opj_decompress.c   2017-08-28 10:54:16.902664654 +0200
@@ -419,8 +419,8 @@
 int get_file_format(const char *filename)
 {
     unsigned int i;
-    static const char *extension[] = {"pgx", "pnm", "pgm", "ppm", "bmp", "tif", "raw", "rawl", "tga", "png", "j2k", "jp2", "jpt", "j2c", "jpc" };
-    static const int format[] = { PGX_DFMT, PXM_DFMT, PXM_DFMT, PXM_DFMT, BMP_DFMT, TIF_DFMT, RAW_DFMT, RAWL_DFMT, TGA_DFMT, PNG_DFMT, J2K_CFMT, JP2_CFMT, JPT_CFMT, J2K_CFMT, J2K_CFMT };
+    static const char *extension[] = {"pgx", "pam", "pnm", "pgm", "ppm", "bmp", "tif", "raw", "rawl", "tga", "png", "j2k", "jp2", "jpt", "j2c", "jpc" };
+    static const int format[] = { PGX_DFMT, PXM_DFMT, PXM_DFMT, PXM_DFMT, PXM_DFMT, BMP_DFMT, TIF_DFMT, RAW_DFMT, RAWL_DFMT, TGA_DFMT, PNG_DFMT, J2K_CFMT, JP2_CFMT, JPT_CFMT, J2K_CFMT, J2K_CFMT };
     const char * ext = strrchr(filename, '.');
     if (ext == NULL) {
         return -1;

winfried

rouault commented 7 years ago

Would you mind resending as a pull request ?