Description: openjpeg2 viewer fails to build
Author: Mathieu Malaterre <malat@debian.org>
Bug: https://github.com/uclouvain/openjpeg/issues/878#issuecomment-722037293
Last-Update: 2021-02-08

--- openjpeg2-2.4.0.orig/src/bin/wx/OPJViewer/source/imagjpeg2000.cpp
+++ openjpeg2-2.4.0/src/bin/wx/OPJViewer/source/imagjpeg2000.cpp
@@ -56,6 +56,7 @@
 #include "wx/module.h"
 #endif
 
+#include "openmj2/openjpeg.h"
 #include "openjp2/openjpeg.h"
 
 #include "wx/filefn.h"
@@ -1204,7 +1205,7 @@ bool wxJPEG2000Handler::SaveFile(wxImage
     if (m_prsize != wxT("")) {
         char sep;
         int res_spec = 0;
-        char *s = (char *) m_prsize.c_str();
+        const char *s = (const char *) m_prsize.c_str();
         do {
             sep = 0;
             sscanf(s, "[%d,%d]%c", &parameters.prcw_init[res_spec],
--- openjpeg2-2.4.0.orig/src/bin/wx/OPJViewer/source/imagjpeg2000.h
+++ openjpeg2-2.4.0/src/bin/wx/OPJViewer/source/imagjpeg2000.h
@@ -49,6 +49,7 @@
 #if wxUSE_LIBOPENJPEG
 
 #include "wx/image.h"
+#include "openmj2/openjpeg.h"
 #include "openjp2/openjpeg.h"
 #include "jp2/index.h"
 
@@ -61,7 +62,7 @@ public:
     {
         m_name = wxT("JPEG 2000 family file format");
         m_extension = wxT("mj2");
-        m_type = wxBITMAP_TYPE_JPEG2000;
+        m_type = (wxBitmapType)wxBITMAP_TYPE_JPEG2000;
         m_mime = wxT("image/mj2");
 
         /* decoding */
