Skip to content

Commit

Permalink
Merge pull request #17596 from victoryforce/jpf-jpx-extensions-import…
Browse files Browse the repository at this point in the history
…-support

[imageio] Add support for importing JPEG2000 files with `.jpf` and `.jpx` file extensions
  • Loading branch information
TurboGit authored Oct 5, 2024
2 parents b647194 + 81bc593 commit f899a72
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
6 changes: 3 additions & 3 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ if(USE_OPENJPEG)
list(APPEND SOURCES "imageio/imageio_j2k.c")
include_directories(SYSTEM ${OPENJPEG_INCLUDE_DIRS})
list(APPEND LIBS ${OPENJPEG_LIBRARIES})
set(DT_SUPPORTED_EXTENSIONS ${DT_SUPPORTED_EXTENSIONS} j2c j2k jp2 jpc CACHE INTERNAL "")
set(DT_SUPPORTED_EXTENSIONS ${DT_SUPPORTED_EXTENSIONS} j2c j2k jp2 jpc jpf jpx CACHE INTERNAL "")
endif(OpenJPEG_FOUND)
endif(USE_OPENJPEG)

Expand Down Expand Up @@ -558,7 +558,7 @@ if(USE_GRAPHICSMAGICK)
find_package(GraphicsMagick)
if(GraphicsMagick_FOUND)
add_definitions(-DHAVE_GRAPHICSMAGICK)
set(DT_SUPPORTED_EXTENSIONS ${DT_SUPPORTED_EXTENSIONS} bmp dcm fit fits fts gif jng jp2 jpc miff mng pam webp jxl CACHE INTERNAL "")
set(DT_SUPPORTED_EXTENSIONS ${DT_SUPPORTED_EXTENSIONS} bmp dcm fit fits fts gif jng jp2 jpc jpf jpx miff mng pam webp jxl CACHE INTERNAL "")
include_directories(SYSTEM ${GraphicsMagick_INCLUDE_DIRS})
list(APPEND LIBS ${GraphicsMagick_LIBRARIES})
endif(GraphicsMagick_FOUND)
Expand All @@ -580,7 +580,7 @@ if(USE_IMAGEMAGICK AND NOT GraphicsMagick_FOUND)
list(APPEND LIBS ${ImageMagick_LIBRARY})
unset(ImageMagick_LIBRARY CACHE)
endforeach(lib)
set(DT_SUPPORTED_EXTENSIONS ${DT_SUPPORTED_EXTENSIONS} bmp dcm fit fits fts gif jng jp2 jpc miff mng pam webp jxl CACHE INTERNAL "")
set(DT_SUPPORTED_EXTENSIONS ${DT_SUPPORTED_EXTENSIONS} bmp dcm fit fits fts gif jng jp2 jpc jpf jpx miff mng pam webp jxl CACHE INTERNAL "")
endif(ImageMagick_FOUND)
endif(USE_IMAGEMAGICK AND NOT GraphicsMagick_FOUND)

Expand Down
6 changes: 3 additions & 3 deletions src/imageio/imageio_gm.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@
static gboolean _supported_image(const gchar *filename)
{
const char *extensions_whitelist[] = { "tiff", "tif", "pbm", "pgm", "ppm", "pnm",
"webp", "jpc", "jp2", "bmp", "dcm", "jng",
"miff", "mng", "pam", "gif", "jxl", "fit",
"fits", "fts", NULL };
"webp", "jpc", "jp2", "jpf", "jpx", "bmp",
"miff", "dcm", "jng", "mng", "pam", "gif",
"fits", "fit", "fts", "jxl", NULL };
gboolean supported = FALSE;
char *ext = g_strrstr(filename, ".");
if(!ext) return FALSE;
Expand Down
6 changes: 3 additions & 3 deletions src/imageio/imageio_im.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@
static gboolean _supported_image(const gchar *filename)
{
const char *extensions_whitelist[] = { "tiff", "tif", "pbm", "pgm", "ppm", "pnm",
"webp", "jpc", "jp2", "bmp", "dcm", "jng",
"miff", "mng", "pam", "gif", "jxl", "fit",
"fits", "fts", NULL };
"webp", "jpc", "jp2", "jpf", "jpx", "bmp",
"miff", "dcm", "jng", "mng", "pam", "gif",
"fits", "fit", "fts", "jxl", NULL };
gboolean supported = FALSE;
char *ext = g_strrstr(filename, ".");
if(!ext) return FALSE;
Expand Down
4 changes: 2 additions & 2 deletions src/imageio/imageio_j2k.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ static void error_callback(const char *msg, void *client_data)

static int get_file_format(const char *filename)
{
static const char *extension[] = { "j2k", "jp2", "jpt", "j2c", "jpc" };
static const int format[] = { J2K_CFMT, JP2_CFMT, JPT_CFMT, J2K_CFMT, J2K_CFMT };
static const char *extension[] = { "j2k", "jp2", "jpt", "j2c", "jpc", "jpf", "jpx" };
static const int format[] = { J2K_CFMT, JP2_CFMT, JPT_CFMT, J2K_CFMT, J2K_CFMT, JP2_CFMT, JP2_CFMT };
char *ext = strrchr(filename, '.');
if(ext == NULL) return -1;
ext++;
Expand Down

0 comments on commit f899a72

Please sign in to comment.