Blob Blame History Raw
--- grib2/wgrib2/enc_jpeg2000_clone.c.jasper3	2022-02-14 18:05:29.066783126 +0900
+++ grib2/wgrib2/enc_jpeg2000_clone.c	2022-02-14 18:06:30.750911168 +0900
@@ -68,6 +68,7 @@ int enc_jpeg2000_clone(unsigned char *ci
 *$$$*/
 {
     int ier,rwcnt;
+    int fmt;
     jas_image_t image;
     jas_stream_t *jpcstream,*istream;
     jas_image_cmpt_t cmpt,*pcmpt;
@@ -168,7 +169,8 @@ int enc_jpeg2000_clone(unsigned char *ci
 //
 //     Encode image.
 //
-    ier=jpc_encode(&image,jpcstream,opts);
+    fmt = jas_image_strtofmt("jpc");
+    ier=jas_image_encode(&image,jpcstream,fmt,opts);
     if ( ier != 0 ) {
        printf(" jpc_encode return = %d \n",ier);
        return -3;
--- grib2/wgrib2/unpk.c.jasper3	2016-11-02 21:00:24.000000000 +0900
+++ grib2/wgrib2/unpk.c	2022-02-14 18:05:29.068783130 +0900
@@ -197,7 +197,7 @@ int unpk_grib(unsigned char **sec, float
         image = NULL;
 	opts = NULL;
         jpcstream=jas_stream_memopen((char *) sec[7]+5, (int) GB2_Sec7_size(sec)-5);
-	image = jpc_decode(jpcstream, opts);
+	image = jas_image_decode (jpcstream, -1, 0);
 	if (image == NULL) fatal_error("jpeg2000 decoding", "");
 	pcmpt = image->cmpts_[0];
         if (image->numcmpts_ != 1 )