--- ./pdf/pdf_file.c.origin	2023-06-22 07:31:38.829918108 +0000
+++ ./pdf/pdf_file.c	2023-06-22 07:31:45.880155536 +0000
@@ -53,8 +53,6 @@
 #  include "sjpx_luratech.h"
 #elif defined(USE_OPENJPEG_JP2)
 #  include "sjpx_openjpeg.h"
-#else
-#  include "sjpx.h"
 #endif
 
 extern const uint file_default_buffer_size;
@@ -440,7 +438,7 @@
     }
     return 0;
 }
-
+#if defined(USE_LWF_JP2) || defined(USE_OPENJPEG_JP2)
 /*
  * dict -- the dict that contained the decoder (i.e. the image dict)
  * decode -- the decoder dict
@@ -569,6 +567,7 @@
 
     return 0;
 }
+#endif
 
 private_st_jpeg_decompress_data();
 
@@ -819,10 +818,12 @@
         code = pdfi_DCT_filter(ctx, dict, decode, source, new_stream);
         return code;
     }
+#if defined(USE_LWF_JP2) || defined(USE_OPENJPEG_JP2)
     if (pdfi_name_is(n, "JPXDecode")) {
         code = pdfi_JPX_filter(ctx, dict, decode, source, new_stream);
         return code;
     }
+#endif
 
     if (pdfi_name_is(n, "AHx")) {
         if (!inline_image) {
