diff --git a/doc/man/man3/libopenjp2.3 b/doc/man/man3/libopenjp2.3
index 9b06cc867..f504621da 100644
--- a/doc/man/man3/libopenjp2.3
+++ b/doc/man/man3/libopenjp2.3
@@ -245,10 +245,10 @@ typedef struct opj_cparameters
\fBchar\fR infile[OPJ_PATH_LEN];
/* output file name */
\fBchar\fR outfile[OPJ_PATH_LEN];
- /* DEPRECATED. Index generation is now handeld with the
+ /* DEPRECATED. Index generation is now handled with the
opj_encode_with_info() function. Set to NULL */
\fBint\fR index_on;
- /* DEPRECATED. Index generation is now handeld with the
+ /* DEPRECATED. Index generation is now handled with the
opj_encode_with_info() function. Set to NULL */
\fBchar\fR index[OPJ_PATH_LEN];
/* subimage encoding: origin image offset in x direction */
diff --git a/src/bin/wx/OPJViewer/source/imagjpeg2000.cpp b/src/bin/wx/OPJViewer/source/imagjpeg2000.cpp
index 9e1ab90dc..4eda46adb 100644
--- a/src/bin/wx/OPJViewer/source/imagjpeg2000.cpp
+++ b/src/bin/wx/OPJViewer/source/imagjpeg2000.cpp
@@ -652,7 +652,7 @@ jpeg2000_file_parse(wxInputStream& stream, unsigned long int filepoint,
return (0);
}
-// search first contiguos codestream box in an mj2 file
+// search first contiguous codestream box in an mj2 file
unsigned long int
searchjpeg2000c(wxInputStream& stream, unsigned long int fsize, int number)
{
diff --git a/src/lib/openjp2/ht_dec.c b/src/lib/openjp2/ht_dec.c
index a554b24a6..2984f5609 100644
--- a/src/lib/openjp2/ht_dec.c
+++ b/src/lib/openjp2/ht_dec.c
@@ -901,7 +901,7 @@ typedef struct frwd_struct {
* X controls this value.
*
* Unstuffing prevent sequences that are more than 0xFF7F from appearing
- * in the conpressed sequence. So whenever a value of 0xFF is coded, the
+ * in the compressed sequence. So whenever a value of 0xFF is coded, the
* MSB of the next byte is set 0 and must be ignored during decoding.
*
* Reading can go beyond the end of buffer by up to 3 bytes.
@@ -1032,7 +1032,7 @@ OPJ_UINT32 frwd_fetch(frwd_struct_t *msp)
//************************************************************************/
/** @brief Allocates T1 buffers
*
- * @param [in, out] t1 is codeblock cofficients storage
+ * @param [in, out] t1 is codeblock coefficients storage
* @param [in] w is codeblock width
* @param [in] h is codeblock height
*/
@@ -1120,7 +1120,7 @@ OPJ_BOOL opj_t1_ht_decode_cblk(opj_t1_t *t1,
/** @brief Decodes one codeblock, processing the cleanup, siginificance
* propagation, and magnitude refinement pass
*
- * @param [in, out] t1 is codeblock cofficients storage
+ * @param [in, out] t1 is codeblock coefficients storage
* @param [in] cblk is codeblock properties
* @param [in] orient is the subband to which the codeblock belongs (not needed)
* @param [in] roishift is region of interest shift
diff --git a/src/lib/openjp2/openjpeg.h b/src/lib/openjp2/openjpeg.h
index 67d168bb5..113481bbb 100644
--- a/src/lib/openjp2/openjpeg.h
+++ b/src/lib/openjp2/openjpeg.h
@@ -772,7 +772,7 @@ typedef struct opj_packet_info {
OPJ_OFF_T end_ph_pos;
/** packet end position */
OPJ_OFF_T end_pos;
- /** packet distorsion */
+ /** packet distortion */
double disto;
} opj_packet_info_t;
diff --git a/src/lib/openjp2/opj_common.h b/src/lib/openjp2/opj_common.h
index ee8adf472..2923a35b7 100644
--- a/src/lib/openjp2/opj_common.h
+++ b/src/lib/openjp2/opj_common.h
@@ -28,8 +28,8 @@
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef OPJ_COMMMON_H
-#define OPJ_COMMMON_H
+#ifndef OPJ_COMMON_H
+#define OPJ_COMMON_H
/*
==========================================================
@@ -44,4 +44,4 @@
#define OPJ_COMP_PARAM_DEFAULT_PROG_ORDER OPJ_LRCP
#define OPJ_COMP_PARAM_DEFAULT_NUMRESOLUTION 6
-#endif /* OPJ_COMMMON_H */
+#endif /* OPJ_COMMON_H */
diff --git a/src/lib/openjp2/tcd.c b/src/lib/openjp2/tcd.c
index 687aa61bb..8ca259b71 100644
--- a/src/lib/openjp2/tcd.c
+++ b/src/lib/openjp2/tcd.c
@@ -243,7 +243,7 @@ void opj_tcd_rateallocate_fixed(opj_tcd_t *tcd)
/* ----------------------------------------------------------------------- */
/** Returns OPJ_TRUE if the layer allocation is unchanged w.r.t to the previous
- * invokation with a different threshold */
+ * invocation with a different threshold */
static
OPJ_BOOL opj_tcd_makelayer(opj_tcd_t *tcd,
OPJ_UINT32 layno,
@@ -2861,12 +2861,12 @@ OPJ_BOOL opj_tcd_is_subband_area_of_interest(opj_tcd_t *tcd,
return intersects;
}
-/** Returns whether a tile componenent is fully decoded, taking into account
+/** Returns whether a tile component is fully decoded, taking into account
* p_tcd->win_* members.
*
* @param p_tcd TCD handle.
* @param compno Component number
- * @return OPJ_TRUE whether the tile componenent is fully decoded
+ * @return OPJ_TRUE whether the tile component is fully decoded
*/
static OPJ_BOOL opj_tcd_is_whole_tilecomp_decoding(opj_tcd_t *p_tcd,
OPJ_UINT32 compno)
diff --git a/src/lib/openjp2/tcd.h b/src/lib/openjp2/tcd.h
index f659869a1..b7123e87d 100644
--- a/src/lib/openjp2/tcd.h
+++ b/src/lib/openjp2/tcd.h
@@ -491,7 +491,7 @@ void opj_tcd_reinit_segment(opj_tcd_seg_t* seg);
* @param y0 Upper left y in subband coordinates
* @param x1 Lower right x in subband coordinates
* @param y1 Lower right y in subband coordinates
- * @return OPJ_TRUE whether the sub-band region contributs to the area of
+ * @return OPJ_TRUE whether the sub-band region contributes to the area of
* interest.
*/
OPJ_BOOL opj_tcd_is_subband_area_of_interest(opj_tcd_t *tcd,
diff --git a/src/lib/openjpip/auxtrans_manager.h b/src/lib/openjpip/auxtrans_manager.h
index 7a4531701..e7527275a 100644
--- a/src/lib/openjpip/auxtrans_manager.h
+++ b/src/lib/openjpip/auxtrans_manager.h
@@ -38,8 +38,8 @@
typedef struct auxtrans_param {
int tcpauxport; /**< tcp port*/
int udpauxport; /**< udp port*/
- SOCKET tcplistensock; /**< listenning socket for aux tcp (-1 if not open)*/
- SOCKET udplistensock; /**< listenning socket for aux udp (-1 if not open)*/
+ SOCKET tcplistensock; /**< listening socket for aux tcp (-1 if not open)*/
+ SOCKET udplistensock; /**< listening socket for aux udp (-1 if not open)*/
} auxtrans_param_t;
/**
diff --git a/src/lib/openjpip/box_manager.h b/src/lib/openjpip/box_manager.h
index 250ef640c..4a3ae767e 100644
--- a/src/lib/openjpip/box_manager.h
+++ b/src/lib/openjpip/box_manager.h
@@ -72,7 +72,7 @@ boxlist_param_t * get_boxstructure(int fd, OPJ_OFF_T offset, OPJ_SIZE_T length);
/**
* generate box from JP2 file at the given offset
*
- * @param[in] fd file discriptor of the JP2 file
+ * @param[in] fd file descriptor of the JP2 file
* @param[in] offset Box offset
* @return pointer to the structure of generate box parameters
*/
@@ -91,7 +91,7 @@ box_param_t * gene_boxbyOffinStream(Byte_t *stream, OPJ_OFF_T offset);
/**
* generate(search) box from JP2 file
*
- * @param[in] fd file discriptor of the JP2 file
+ * @param[in] fd file descriptor of the JP2 file
* @param[in] offset start Byte position of the search
* @param[in] length Byte length of the search, if 0, size to the end of file
* @param[in] TBox Box Type
diff --git a/src/lib/openjpip/boxheader_manager.h b/src/lib/openjpip/boxheader_manager.h
index b43b447c9..9942d59c6 100644
--- a/src/lib/openjpip/boxheader_manager.h
+++ b/src/lib/openjpip/boxheader_manager.h
@@ -47,7 +47,7 @@ typedef struct boxheader_param {
/**
* generate a box header at the given offset
*
- * @param[in] fd file discriptor of the JP2 file
+ * @param[in] fd file descriptor of the JP2 file
* @param[in] offset Box offset
* @return pointer to the structure of generate box header parameters
*/
diff --git a/src/lib/openjpip/byte_manager.h b/src/lib/openjpip/byte_manager.h
index 02c806e0b..3c7a91bef 100644
--- a/src/lib/openjpip/byte_manager.h
+++ b/src/lib/openjpip/byte_manager.h
@@ -42,7 +42,7 @@ typedef uint64_t Byte8_t;
/**
* fetch bytes of data in file stream
*
- * @param[in] fd file discriptor
+ * @param[in] fd file descriptor
* @param[in] offset start Byte position
* @param[in] size Byte length
* @return pointer to the fetched data
@@ -53,7 +53,7 @@ Byte_t * fetch_bytes(int fd, OPJ_OFF_T offset, OPJ_SIZE_T size);
/**
* fetch a 1-byte Byte codes in file stream
*
- * @param[in] fd file discriptor
+ * @param[in] fd file descriptor
* @param[in] offset start Byte position
* @return fetched codes
*/
@@ -62,7 +62,7 @@ Byte_t fetch_1byte(int fd, OPJ_OFF_T offset);
/**
* fetch a 2-byte big endian Byte codes in file stream
*
- * @param[in] fd file discriptor
+ * @param[in] fd file descriptor
* @param[in] offset start Byte position
* @return fetched codes
*/
@@ -71,7 +71,7 @@ Byte2_t fetch_2bytebigendian(int fd, OPJ_OFF_T offset);
/**
* fetch a 4-byte big endian Byte codes in file stream
*
- * @param[in] fd file discriptor
+ * @param[in] fd file descriptor
* @param[in] offset start Byte position
* @return fetched codes
*/
@@ -80,7 +80,7 @@ Byte4_t fetch_4bytebigendian(int fd, OPJ_OFF_T offset);
/**
* fetch a 8-byte big endian Byte codes in file stream
*
- * @param[in] fd file discriptor
+ * @param[in] fd file descriptor
* @param[in] offset start Byte position
* @return fetched codes
*/
@@ -122,7 +122,7 @@ void modify_4Bytecode(Byte4_t code, Byte_t *stream);
/**
* Get file size
*
- * @param[in] fd file discriptor
+ * @param[in] fd file descriptor
* @return file size
*/
OPJ_OFF_T get_filesize(int fd);
diff --git a/src/lib/openjpip/msgqueue_manager.h b/src/lib/openjpip/msgqueue_manager.h
index ad97828de..d0715310f 100644
--- a/src/lib/openjpip/msgqueue_manager.h
+++ b/src/lib/openjpip/msgqueue_manager.h
@@ -151,7 +151,7 @@ void enqueue_metadata(Byte8_t meta_id, msgqueue_param_t *msgqueue);
* reconstruct JPT/JPP-stream from message queue
*
* @param[in] msgqueue message queue pointer
- * @param[in] tmpfd file discriptor to write JPT/JPP-stream
+ * @param[in] tmpfd file descriptor to write JPT/JPP-stream
*/
void recons_stream_from_msgqueue(msgqueue_param_t *msgqueue, int tmpfd);
diff --git a/src/lib/openjpip/openjpip.h b/src/lib/openjpip/openjpip.h
index 5913bd0fe..a9fab4f80 100644
--- a/src/lib/openjpip/openjpip.h
+++ b/src/lib/openjpip/openjpip.h
@@ -159,7 +159,7 @@ typedef struct dec_server_record {
Byte_t *jpipstream; /**< JPT/JPP stream*/
OPJ_SIZE_T jpipstreamlen; /**< length of jpipstream*/
msgqueue_param_t *msgqueue; /**< parsed message queue of jpipstream*/
- SOCKET listening_socket; /**< listenning socket*/
+ SOCKET listening_socket; /**< listening socket*/
} dec_server_record_t;
diff --git a/src/lib/openjpip/session_manager.h b/src/lib/openjpip/session_manager.h
index 1343b1e77..3e1d2c412 100644
--- a/src/lib/openjpip/session_manager.h
+++ b/src/lib/openjpip/session_manager.h
@@ -57,7 +57,7 @@ sessionlist_param_t * gene_sessionlist(void);
/**
- * generate a session under the sesion list
+ * generate a session under the session list
*
* @param[in] sessionlist session list to insert the new session
* @return pointer to the generated session
diff --git a/src/lib/openjpip/sock_manager.h b/src/lib/openjpip/sock_manager.h
index f33306c02..44054f308 100644
--- a/src/lib/openjpip/sock_manager.h
+++ b/src/lib/openjpip/sock_manager.h
@@ -51,9 +51,9 @@ typedef int SOCKET;
SOCKET open_listeningsocket(uint16_t port);
/**
- * accept a new connection to the listenning socket
+ * accept a new connection to the listening socket
*
- * @param listening_socket listenning socket
+ * @param listening_socket listening socket
* @return connected socket (-1 if error occurs)
*/
SOCKET accept_socket(SOCKET listening_socket);
diff --git a/tests/compare_images.c b/tests/compare_images.c
index f3f876397..9b55e054a 100644
--- a/tests/compare_images.c
+++ b/tests/compare_images.c
@@ -939,7 +939,7 @@ int main(int argc, char **argv)
if ( imageToPNG(imageDiff, filenamePNGdiff_it_comp, it_comp) == EXIT_SUCCESS )
{
- printf(" %s \n", it_comp, filenamePNGdiff_it_comp);
+ printf(" %s \n", it_comp, filenamePNGdiff_it_comp);
}
*/
diff --git a/tests/nonregression/CMakeLists.txt b/tests/nonregression/CMakeLists.txt
index 519905778..c3b9578f6 100644
--- a/tests/nonregression/CMakeLists.txt
+++ b/tests/nonregression/CMakeLists.txt
@@ -82,8 +82,8 @@ set(BLACKLIST_JPEG2000
issue475.jp2 #kdu_jp2info ok
issue413.jp2 #kdu_jp2info ok
issue823.jp2 #kdu_jp2info ok
- issue826.jp2 #inspection reveales that the transformation value is out of range
- oss-fuzz2785.jp2 #inspection reveales that the transformation value is out of range
+ issue826.jp2 #inspection reveals that the transformation value is out of range
+ oss-fuzz2785.jp2 #inspection reveals that the transformation value is out of range
issue1438.j2k
)
diff --git a/tests/nonregression/test_suite.ctest.in b/tests/nonregression/test_suite.ctest.in
index 584dfaf7f..67409f9b4 100644
--- a/tests/nonregression/test_suite.ctest.in
+++ b/tests/nonregression/test_suite.ctest.in
@@ -6,7 +6,7 @@
# + For encoder related tests = dump, compare dump to base, decode the encoded file with
# reference and compare the decoded file with the baseline decoded previously with
# ref decoder.
-# + For decoder related tests = dump, compare dump to base, (TODO: compare outpout decoding
+# + For decoder related tests = dump, compare dump to base, (TODO: compare output decoding
# image to base)
#
# Line begin with ! should failed (should be used for bad jpeg2000 file which should be
diff --git a/tests/pdf2jp2.c b/tests/pdf2jp2.c
index 38aa739fe..f36ea4f98 100644
--- a/tests/pdf2jp2.c
+++ b/tests/pdf2jp2.c
@@ -52,7 +52,7 @@ int main(int argc, char *argv[])
{
#define NUMJP2 32
int i, c = 0;
- long offets[NUMJP2];
+ long offsets[NUMJP2];
char buffer[512];
#define BUFLEN 4096
int cont = 1;
@@ -85,7 +85,7 @@ int main(int argc, char *argv[])
const ptrdiff_t diff = ret - haystack;
assert( diff >= 0 );
/*fprintf( stdout, "Found it: %lx\n", (ptrdiff_t)cpos - (ptrdiff_t)hlen + diff);*/
- offets[c++] = (ptrdiff_t)cpos - (ptrdiff_t)hlen + diff;
+ offsets[c++] = (ptrdiff_t)cpos - (ptrdiff_t)hlen + diff;
}
cont = (nread == flen);
memcpy( haystack, haystack + nread, nlen );
@@ -97,7 +97,7 @@ int main(int argc, char *argv[])
{
int s, len = 0;
char *r;
- const int ret = fseek(f, offets[i], SEEK_SET);
+ const int ret = fseek(f, offsets[i], SEEK_SET);
assert( ret == 0 );
r = fgets(buffer, sizeof(buffer), f);
assert( r );
@@ -105,7 +105,7 @@ int main(int argc, char *argv[])
s = sscanf(r, "JPXDecode]/Length %d/Width %*d/BitsPerComponent %*d/Height %*d", &len);
if( s == 0 )
{ // try again harder
- const int ret = fseek(f, offets[i] - 40, SEEK_SET); // 40 is magic number
+ const int ret = fseek(f, offsets[i] - 40, SEEK_SET); // 40 is magic number
assert( ret == 0 );
r = fgets(buffer, sizeof(buffer), f);
assert( r );
diff --git a/wrapping/java/openjp2/JavaOpenJPEG.c b/wrapping/java/openjp2/JavaOpenJPEG.c
index 85b0c0af5..da1c0ea8f 100644
--- a/wrapping/java/openjp2/JavaOpenJPEG.c
+++ b/wrapping/java/openjp2/JavaOpenJPEG.c
@@ -1452,7 +1452,7 @@ static char* create_index_into_byte_array(opj_codestream_info_t *cstr_info,
+ (10 /* image_w until decomposition */
+ (cstr_info->numdecompos[0] + 1) * 2 /* pdx size for each tile */
+ 2 /* main_head_end + codestream_size */
- + cstr_info->tw * cstr_info->th * 4 /* tile info, without distorsion info */
+ + cstr_info->tw * cstr_info->th * 4 /* tile info, without distortion info */
+ cstr_info->tw * cstr_info->th * cstr_info->numlayers *
(cstr_info->numdecompos[0] + 1) * cstr_info->numcomps * prec_max * 8
) * sizeof(int);