Skip to content

Commit

Permalink
Merge pull request #660 from stweil/1.83
Browse files Browse the repository at this point in the history
Prepare new bug fix release 1.83.1
  • Loading branch information
DanBloomberg authored Jan 25, 2023
2 parents 97b82b0 + 71db308 commit 2ab39c9
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 28 deletions.
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ PROJECT_NAME = Leptonica
# could be handy for archiving the generated documentation or if some version
# control system is used.

PROJECT_NUMBER = 1.83.0
PROJECT_NUMBER = 1.83.1

# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a
Expand Down
16 changes: 8 additions & 8 deletions README.html
Original file line number Diff line number Diff line change
Expand Up @@ -75,12 +75,12 @@
- SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*====================================================================*/

README (version 1.83.0)
File update: 20 Dec 2022
README (version 1.83.1)
File update: 25 Jan 2023
---------------------------

gunzip leptonica-1.83.0.tar.gz
tar -xvf leptonica-1.83.0.tar
gunzip leptonica-1.83.1.tar.gz
tar -xvf leptonica-1.83.1.tar

</pre>

Expand Down Expand Up @@ -117,7 +117,7 @@ <h2> <A NAME="BUILDING">
Libraries, executables and prototypes are easily made, as described below.

When you extract from the archive, all files are put in a
subdirectory 'leptonica-1.83.0'. In that directory you will
subdirectory 'leptonica-1.83.1'. In that directory you will
find a src directory containing the source files for the library,
and a prog directory containing source files for various
testing and example programs.
Expand Down Expand Up @@ -259,7 +259,7 @@ <h2> <A NAME="BUILDING">
make install

Configure also supports building in a separate directory from the
source. Run "/(path-to)/leptonica-1.83.0/configure" and then "make"
source. Run "/(path-to)/leptonica-1.83.1/configure" and then "make"
from the desired build directory.

Configure has a number of useful options; run "configure --help" for
Expand Down Expand Up @@ -1203,8 +1203,8 @@ <h2> <A NAME="CONTENTS">
http://code.google.com/p/leptonica, as well as all versions after 1.60.
These have now been transferred by Egor Pugin to github:
github.com/danbloomberg/leptonica
where all releases (1.42 - 1.83.0) are available; e.g.,
https://github.com/DanBloomberg/leptonica/releases/tag/1.83.0
where all releases (1.42 - 1.83.1) are available; e.g.,
https://github.com/DanBloomberg/leptonica/releases/tag/1.83.1
The more recent releases, from 1.74, are also available at
leptonica.org/download.html
Note that if you are downloading from github, the releases are more
Expand Down
2 changes: 1 addition & 1 deletion configure.ac
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
AC_PREREQ([2.50])
AC_INIT([leptonica], [1.83.0])
AC_INIT([leptonica], [1.83.1])
AC_CONFIG_AUX_DIR([config])
AC_CONFIG_HEADERS([config_auto.h:config/config.h.in])
AC_CONFIG_SRCDIR([src/adaptmap.c])
Expand Down
30 changes: 15 additions & 15 deletions src/jp2kheader.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ freadHeaderJp2k(FILE *fp,
l_int32 *pspp,
l_int32 *pcodec)
{
l_uint8 buf[80]; /* just need the first 80 bytes */
l_uint8 buf[120]; /* usually just need the first 80 bytes */
l_int32 nread, ret;

if (!fp)
Expand Down Expand Up @@ -173,7 +173,7 @@ readHeaderMemJp2k(const l_uint8 *data,
l_int32 *pspp,
l_int32 *pcodec)
{
l_int32 format, val, w, h, bps, spp, loc, found, windex, codec;
l_int32 format, val, w, h, bps, spp, loc, found, index, codec;
l_uint8 ihdr[4] = {0x69, 0x68, 0x64, 0x72}; /* 'ihdr' */

if (pw) *pw = 0;
Expand All @@ -183,21 +183,21 @@ l_uint8 ihdr[4] = {0x69, 0x68, 0x64, 0x72}; /* 'ihdr' */
if (pcodec) *pcodec = 0;
if (!data)
return ERROR_INT("data not defined", __func__, 1);
if (size < 80)
if (size < 120)
return ERROR_INT("size < 80", __func__, 1);
findFileFormatBuffer(data, &format);
if (format != IFF_JP2)
return ERROR_INT("not jp2 file", __func__, 1);

/* Find beginning of the image metadata */
if (!memcmp(data, "\xff\x4f\xff\x51", 4)) { /* codestream */
windex = 2;
index = 8;
codec = L_J2K_CODEC;
} else { /* file data with image header box 'ihdr' */
arrayFindSequence(data, size, ihdr, 4, &loc, &found);
if (!found)
return ERROR_INT("image parameters not found", __func__, 1);
windex = loc / 4 + 1; /* expect 12 */
index = loc + 4;
codec = L_JP2_CODEC;
#if DEBUG_CODEC
if (loc != 44)
Expand All @@ -207,25 +207,25 @@ l_uint8 ihdr[4] = {0x69, 0x68, 0x64, 0x72}; /* 'ihdr' */
if (pcodec) *pcodec = codec;

if (codec == L_JP2_CODEC) {
if (size < 4 * (windex + 3))
if (size < index + 4 * 3)
return ERROR_INT("header size is too small", __func__, 1);
val = *((l_uint32 *)data + windex);
val = *(l_uint32 *)(data + index);
h = convertOnLittleEnd32(val);
val = *((l_uint32 *)data + windex + 1);
val = *(l_uint32 *)(data + index + 4);
w = convertOnLittleEnd32(val);
val = *((l_uint16 *)data + 2 * (windex + 2));
val = *(l_uint16 *)(data + index + 8);
spp = convertOnLittleEnd16(val);
bps = *(data + 4 * (windex + 2) + 2) + 1;
bps = *(data + index + 10) + 1;
} else { /* codec == L_J2K_CODEC */
if (size < 4 * (windex + 9))
if (size < index + 4 * 9)
return ERROR_INT("header size is too small", __func__, 1);
val = *((l_uint32 *)data + windex);
val = *(l_uint32 *)(data + index);
w = convertOnLittleEnd32(val);
val = *((l_uint32 *)data + windex + 1);
val = *(l_uint32 *)(data + index + 4);
h = convertOnLittleEnd32(val);
val = *((l_uint16 *)data + 2 * (windex + 8));
val = *(l_uint16 *)(data + index + 32);
spp = convertOnLittleEnd16(val);
bps = *(data + 4 * (windex + 8) + 2) + 1;
bps = *(data + index + 34) + 1;
}
#if DEBUG_CODEC
lept_stderr("h = %d, w = %d, codec: %s, spp = %d, bps = %d\n", h, w,
Expand Down
2 changes: 0 additions & 2 deletions src/pdfio2.c
Original file line number Diff line number Diff line change
Expand Up @@ -562,8 +562,6 @@ PIX *pixt;
} else if (format == IFF_PNG) {
cid = l_generateFlateDataPdf(fname, pix);
}
if (!cid)
return ERROR_INT("cid not made from file", __func__, 1);
}

/* Otherwise, use the pix to generate the pdf output */
Expand Down
2 changes: 1 addition & 1 deletion sw.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ void build(Solution &s)
t += "org.sw.demo.webmproject.webp"_dep;
};

auto &leptonica = s.addTarget<LibraryTarget>("danbloomberg.leptonica", "1.83.0");
auto &leptonica = s.addTarget<LibraryTarget>("danbloomberg.leptonica", "1.83.1");
leptonica += Git("https://github.com/DanBloomberg/leptonica");

{
Expand Down
3 changes: 3 additions & 0 deletions version-notes.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,9 @@ <h2 align=center> <IMG SRC="moller52.jpg" border=1 ALIGN_MIDDLE> </h2>

<pre>

1.83.1 Jan 25, 2023
* Cherry-pick two bug fixes from 1.84.0.

1.83.0 Dec 20, 2022
* Simplify setting the title of pdf files.
* Catch tiff failure to open stream in fopenTiffMemStream()
Expand Down

0 comments on commit 2ab39c9

Please sign in to comment.