-
Notifications
You must be signed in to change notification settings - Fork 160
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
a grapics/jasper update made some internal function symbols not
show up in the library. Fix the zyGrib build by using the public API
- Loading branch information
Showing
3 changed files
with
83 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
$NetBSD: patch-g2clib_dec__jpeg2000.c,v 1.1 2024/01/01 19:01:06 plunky Exp $ | ||
|
||
jpc_decode() is an internal jasper function, use jas_image_decode() instead | ||
|
||
--- g2clib/dec_jpeg2000.c.orig 2016-11-09 16:27:38.000000000 +0000 | ||
+++ g2clib/dec_jpeg2000.c | ||
@@ -50,7 +50,7 @@ | ||
*$$$*/ | ||
|
||
{ | ||
- int ier; | ||
+ int ier,fmt; | ||
g2int i,j,k; | ||
jas_image_t *image=0; | ||
jas_stream_t *jpcstream; | ||
@@ -61,6 +61,12 @@ | ||
// jas_init(); | ||
|
||
ier=0; | ||
+ | ||
+ fmt = jas_image_strtofmt("jpc"); | ||
+ if (fmt == -1) { | ||
+ printf(" image format 'jpc' unknown\n"); | ||
+ return -3; | ||
+ } | ||
// | ||
// Create jas_stream_t containing input JPEG200 codestream in memory. | ||
// | ||
@@ -70,9 +76,9 @@ | ||
// | ||
// Decode JPEG200 codestream into jas_image_t structure. | ||
// | ||
- image=jpc_decode(jpcstream,opts); | ||
+ image=jas_image_decode(jpcstream,fmt,opts); | ||
if ( image == 0 ) { | ||
- printf(" jpc_decode return\n"); | ||
+ printf(" jas_image_decode return\n"); | ||
return -3; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,50 @@ | ||
$NetBSD: patch-g2clib_enc_jpeg2000.c,v 1.2 2020/06/20 21:34:26 mef Exp $ | ||
$NetBSD: patch-g2clib_enc_jpeg2000.c,v 1.3 2024/01/01 19:01:06 plunky Exp $ | ||
|
||
https://github.com/cloudruninc/wps/issues/5 | ||
|
||
--- g2clib/enc_jpeg2000.c.orig 2019-10-28 18:40:41.262350843 +0100 | ||
+++ g2clib/enc_jpeg2000.c 2019-10-28 18:40:52.446238823 +0100 | ||
@@ -121,7 +121,6 @@ | ||
jpc_encode() is an internal jasper function, use jas_image_encode() instead | ||
|
||
--- g2clib/enc_jpeg2000.c.orig 2016-11-09 16:27:38.000000000 +0000 | ||
+++ g2clib/enc_jpeg2000.c | ||
@@ -69,7 +69,7 @@ int enc_jpeg2000(unsigned char *cin,g2in | ||
* | ||
*$$$*/ | ||
{ | ||
- int ier,rwcnt; | ||
+ int ier,rwcnt,fmt; | ||
jas_image_t image; | ||
jas_stream_t *jpcstream,*istream; | ||
jas_image_cmpt_t cmpt,*pcmpt; | ||
@@ -121,7 +121,6 @@ int enc_jpeg2000(unsigned char *cin,g2in | ||
image.clrspc_=JAS_CLRSPC_SGRAY; /* grayscale Image */ | ||
image.cmprof_=0; | ||
#endif | ||
- image.inmem_=1; | ||
|
||
cmpt.tlx_=0; | ||
cmpt.tly_=0; | ||
@@ -143,6 +142,12 @@ int enc_jpeg2000(unsigned char *cin,g2in | ||
pcmpt=&cmpt; | ||
image.cmpts_=&pcmpt; | ||
|
||
+ fmt = jas_image_strtofmt("jpc"); | ||
+ if (fmt == -1) { | ||
+ printf(" image format 'jpc' not found\n"); | ||
+ return -3; | ||
+ } | ||
+ | ||
// | ||
// Open a JasPer stream containing the input grayscale values | ||
// | ||
@@ -158,9 +163,9 @@ int enc_jpeg2000(unsigned char *cin,g2in | ||
// | ||
// Encode image. | ||
// | ||
- ier=jpc_encode(&image,jpcstream,opts); | ||
+ ier=jas_image_encode(&image,jpcstream,fmt,opts); | ||
if ( ier != 0 ) { | ||
- printf(" jpc_encode return = %d \n",ier); | ||
+ printf(" jas_image_encode return = %d \n",ier); | ||
return -3; | ||
} | ||
// |