diff --git a/Doxyfile b/Doxyfile index 9d3fecfa9..0d0b9aeeb 100644 --- a/Doxyfile +++ b/Doxyfile @@ -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 diff --git a/README.html b/README.html index dbdd3e6cd..0b9a53f76 100644 --- a/README.html +++ b/README.html @@ -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 @@ -117,7 +117,7 @@

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. @@ -259,7 +259,7 @@

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 @@ -1203,8 +1203,8 @@

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 diff --git a/configure.ac b/configure.ac index c01d71d1e..7b3fc6865 100644 --- a/configure.ac +++ b/configure.ac @@ -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]) diff --git a/src/jp2kheader.c b/src/jp2kheader.c index afb01c88a..7e9c255a2 100644 --- a/src/jp2kheader.c +++ b/src/jp2kheader.c @@ -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) @@ -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; @@ -183,7 +183,7 @@ 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) @@ -191,13 +191,13 @@ l_uint8 ihdr[4] = {0x69, 0x68, 0x64, 0x72}; /* 'ihdr' */ /* 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) @@ -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, diff --git a/src/pdfio2.c b/src/pdfio2.c index 7f2a9a2d1..ef9d54761 100644 --- a/src/pdfio2.c +++ b/src/pdfio2.c @@ -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 */ diff --git a/sw.cpp b/sw.cpp index 41781779f..31ae6f9a7 100644 --- a/sw.cpp +++ b/sw.cpp @@ -19,7 +19,7 @@ void build(Solution &s) t += "org.sw.demo.webmproject.webp"_dep; }; - auto &leptonica = s.addTarget("danbloomberg.leptonica", "1.83.0"); + auto &leptonica = s.addTarget("danbloomberg.leptonica", "1.83.1"); leptonica += Git("https://github.com/DanBloomberg/leptonica"); { diff --git a/version-notes.html b/version-notes.html index 847c857cf..9022945b2 100644 --- a/version-notes.html +++ b/version-notes.html @@ -89,6 +89,9 @@

 
+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()