]> git.pld-linux.org Git - packages/gdal.git/blame - jasper.patch
- release 5 (by relup.sh)
[packages/gdal.git] / jasper.patch
CommitLineData
634a6a3d
JP
1From 3c5cb6266a01a607ee7560807465bc833240d793 Mon Sep 17 00:00:00 2001
2From: Even Rouault <even.rouault@spatialys.com>
3Date: Mon, 10 Aug 2020 17:26:53 +0200
4Subject: [PATCH] JPEG2000: fix build with Jasper 2.0.17 (fixes #2844)
5
6---
7 gdal/frmts/jpeg2000/jpeg2000dataset.cpp | 4 ++--
8 1 file changed, 2 insertions(+), 2 deletions(-)
9
10diff --git a/gdal/frmts/jpeg2000/jpeg2000dataset.cpp b/gdal/frmts/jpeg2000/jpeg2000dataset.cpp
11index 3e668ffe503..2d3f4e46876 100644
12--- a/gdal/frmts/jpeg2000/jpeg2000dataset.cpp
13+++ b/gdal/frmts/jpeg2000/jpeg2000dataset.cpp
14@@ -484,7 +484,7 @@ int JPEG2000Dataset::DecodeImage()
15 /* the JP2 boxes match the ones of the code stream */
16 if (nBands != 0)
17 {
18- if (nBands != jas_image_numcmpts( psImage ))
19+ if (nBands != static_cast<int>(jas_image_numcmpts( psImage )))
20 {
21 CPLError(CE_Failure, CPLE_AppDefined,
22 "The number of components indicated in the IHDR box (%d) mismatch "
23@@ -595,7 +595,7 @@ GDALDataset *JPEG2000Dataset::Open( GDALOpenInfo * poOpenInfo )
24
25 {
26 int iFormat;
27- char *pszFormatName = nullptr;
28+ const char *pszFormatName = nullptr;
29
30 if (!Identify(poOpenInfo))
31 return nullptr;
32From e236eeaed1be45a4af457565085e3db1f2fc489f Mon Sep 17 00:00:00 2001
33From: Even Rouault <even.rouault@spatialys.com>
34Date: Tue, 11 Aug 2020 09:26:41 +0200
35Subject: [PATCH] JPEG2000: follow-up fix to build with Jasper 2.0.17 (fixes
36 #2844)
37
38---
39 gdal/frmts/jpeg2000/jpeg2000_vsil_io.cpp | 10 ++++++++++
40 1 file changed, 10 insertions(+)
41
42diff --git a/gdal/frmts/jpeg2000/jpeg2000_vsil_io.cpp b/gdal/frmts/jpeg2000/jpeg2000_vsil_io.cpp
43index e780d2bcaed..10a4f96f0ee 100644
44--- a/gdal/frmts/jpeg2000/jpeg2000_vsil_io.cpp
45+++ b/gdal/frmts/jpeg2000/jpeg2000_vsil_io.cpp
46@@ -94,13 +94,23 @@ typedef struct {
47 * File stream object.
48 \******************************************************************************/
49
50+// PRIjas_seqent macro is defined since Jasper 2.0.17
51+
52+#ifndef PRIjas_seqent
53 static int JPEG2000_VSIL_read(jas_stream_obj_t *obj, char *buf, int cnt)
54+#else
55+static int JPEG2000_VSIL_read(jas_stream_obj_t *obj, char *buf, unsigned cnt)
56+#endif
57 {
58 jas_stream_VSIFL_t *fileobj = JAS_CAST(jas_stream_VSIFL_t *, obj);
59 return static_cast<int>(VSIFReadL(buf, 1, cnt, fileobj->fp));
60 }
61
62+#ifndef PRIjas_seqent
63 static int JPEG2000_VSIL_write(jas_stream_obj_t *obj, char *buf, int cnt)
64+#else
65+static int JPEG2000_VSIL_write(jas_stream_obj_t *obj, char *buf, unsigned int cnt)
66+#endif
67 {
68 jas_stream_VSIFL_t *fileobj = JAS_CAST(jas_stream_VSIFL_t *, obj);
69 return static_cast<int>(VSIFWriteL(buf, 1, cnt, fileobj->fp));
34a41104
JP
70From 1562e215c6f53a53efa66263113ecc6e761818d2 Mon Sep 17 00:00:00 2001
71From: Even Rouault <even.rouault@spatialys.com>
72Date: Mon, 5 Oct 2020 12:11:52 +0200
73Subject: [PATCH] JPEG2000: make it build with Jasper 2.0.21 (fixes #3012)
74
75---
76 gdal/frmts/jpeg2000/jpeg2000_vsil_io.cpp | 16 +++++++++-------
77 gdal/frmts/jpeg2000/jpeg2000dataset.cpp | 2 +-
78 2 files changed, 10 insertions(+), 8 deletions(-)
79
80diff --git a/gdal/frmts/jpeg2000/jpeg2000_vsil_io.cpp b/gdal/frmts/jpeg2000/jpeg2000_vsil_io.cpp
81index 10a4f96f0ee..ebcac4010ce 100644
82--- a/gdal/frmts/jpeg2000/jpeg2000_vsil_io.cpp
83+++ b/gdal/frmts/jpeg2000/jpeg2000_vsil_io.cpp
84@@ -94,22 +94,24 @@ typedef struct {
85 * File stream object.
86 \******************************************************************************/
87
88+#if defined(PRIjas_seqent)
89 // PRIjas_seqent macro is defined since Jasper 2.0.17
90-
91-#ifndef PRIjas_seqent
92-static int JPEG2000_VSIL_read(jas_stream_obj_t *obj, char *buf, int cnt)
93-#else
94 static int JPEG2000_VSIL_read(jas_stream_obj_t *obj, char *buf, unsigned cnt)
95+#else
96+static int JPEG2000_VSIL_read(jas_stream_obj_t *obj, char *buf, int cnt)
97 #endif
98 {
99 jas_stream_VSIFL_t *fileobj = JAS_CAST(jas_stream_VSIFL_t *, obj);
100 return static_cast<int>(VSIFReadL(buf, 1, cnt, fileobj->fp));
101 }
102
103-#ifndef PRIjas_seqent
104-static int JPEG2000_VSIL_write(jas_stream_obj_t *obj, char *buf, int cnt)
105-#else
106+#if defined(JAS_INCLUDE_JP2_CODEC)
107+// Jasper 2.0.21
108+static int JPEG2000_VSIL_write(jas_stream_obj_t *obj, const char *buf, unsigned int cnt)
109+#elif defined(PRIjas_seqent)
110 static int JPEG2000_VSIL_write(jas_stream_obj_t *obj, char *buf, unsigned int cnt)
111+#else
112+static int JPEG2000_VSIL_write(jas_stream_obj_t *obj, char *buf, int cnt)
113 #endif
114 {
115 jas_stream_VSIFL_t *fileobj = JAS_CAST(jas_stream_VSIFL_t *, obj);
116diff --git a/gdal/frmts/jpeg2000/jpeg2000dataset.cpp b/gdal/frmts/jpeg2000/jpeg2000dataset.cpp
117index a5a6b258ed9..bd1e7763186 100644
118--- a/gdal/frmts/jpeg2000/jpeg2000dataset.cpp
119+++ b/gdal/frmts/jpeg2000/jpeg2000dataset.cpp
120@@ -513,7 +513,7 @@ int JPEG2000Dataset::DecodeImage()
121 for ( iBand = 0; iBand < nBands; iBand++ )
122 {
123 JPEG2000RasterBand* poBand = (JPEG2000RasterBand*) GetRasterBand(iBand+1);
124- if (poBand->iDepth != jas_image_cmptprec( psImage, iBand ) ||
125+ if (poBand->iDepth != static_cast<int>(jas_image_cmptprec( psImage, iBand )) ||
126 poBand->bSignedness != jas_image_cmptsgnd( psImage, iBand ))
127 {
128 CPLError(CE_Failure, CPLE_AppDefined,
This page took 0.042118 seconds and 4 git commands to generate.