summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/image
diff options
context:
space:
mode:
authorTaco Hoekwater <taco@elvenkind.com>2014-03-15 12:21:15 +0000
committerTaco Hoekwater <taco@elvenkind.com>2014-03-15 12:21:15 +0000
commita22d9897afbabdd07f13d2bc5c7c5b9c5865ab53 (patch)
tree70829ffa23329ca4c04efa8da7a18cfe9c44a1f4 /Build/source/texk/web2c/luatexdir/image
parent5909dbd7ee4290cc486c9c12e4ef0b2bfb9067d4 (diff)
here is luatex 0.79.0
git-svn-id: svn://tug.org/texlive/trunk@33180 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/image')
-rw-r--r--Build/source/texk/web2c/luatexdir/image/image.h6
-rw-r--r--Build/source/texk/web2c/luatexdir/image/pdftoepdf.w34
-rw-r--r--Build/source/texk/web2c/luatexdir/image/writeimg.w24
-rw-r--r--Build/source/texk/web2c/luatexdir/image/writejbig2.w14
-rw-r--r--Build/source/texk/web2c/luatexdir/image/writejp2.w22
-rw-r--r--Build/source/texk/web2c/luatexdir/image/writejpg.w22
-rw-r--r--Build/source/texk/web2c/luatexdir/image/writepng.w36
7 files changed, 79 insertions, 79 deletions
diff --git a/Build/source/texk/web2c/luatexdir/image/image.h b/Build/source/texk/web2c/luatexdir/image/image.h
index 4e88dbeeaba..0526b84ec57 100644
--- a/Build/source/texk/web2c/luatexdir/image/image.h
+++ b/Build/source/texk/web2c/luatexdir/image/image.h
@@ -18,7 +18,7 @@
You should have received a copy of the GNU General Public License along
with LuaTeX; if not, see <http://www.gnu.org/licenses/>. */
-/* $Id: image.h 4406 2012-05-07 21:47:26Z hhenkel $ */
+/* $Id: image.h 4847 2014-03-05 18:13:17Z luigi $ */
#ifndef IMAGE_H
# define IMAGE_H
@@ -35,8 +35,8 @@ extern scaled one_hundred_bp; /* from pdfgen.w */
# define bp2sp(p) do_zround(p * (one_hundred_bp / 100.0))
# define sp2bp(i) (i * 100.0 / one_hundred_bp)
-# define TYPE_IMG "image"
-# define TYPE_IMG_DICT "image-dict"
+# define TYPE_IMG "image.meta"
+# define TYPE_IMG_DICT "image.dict"
/**********************************************************************/
diff --git a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.w b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.w
index 52838d338b4..492492c5fd3 100644
--- a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.w
+++ b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.w
@@ -20,7 +20,7 @@
@ @c
static const char _svn_version[] =
- "$Id: pdftoepdf.w 4749 2014-01-15 08:43:57Z taco $"
+ "$Id: pdftoepdf.w 4847 2014-03-05 18:13:17Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/image/pdftoepdf.w $";
// define DEBUG
@@ -70,14 +70,14 @@ static char *get_file_checksum(char *a, file_error_mode fe)
time_t mtime = finfo.st_mtime;
ck = (char *) malloc(PDF_CHECKSUM_SIZE);
if (ck == NULL)
- pdftex_fail("PDF inclusion: out of memory while processing '%s'",
+ luatex_fail("PDF inclusion: out of memory while processing '%s'",
a);
snprintf(ck, PDF_CHECKSUM_SIZE, "%" PRIu64 "_%" PRIu64, (uint64_t) size,
(uint64_t) mtime);
} else {
switch (fe) {
case FE_FAIL:
- pdftex_fail("PDF inclusion: could not stat() file '%s'", a);
+ luatex_fail("PDF inclusion: could not stat() file '%s'", a);
break;
case FE_RETURN_NULL:
if (ck != NULL)
@@ -127,7 +127,7 @@ PdfDocument *refPdfDocument(char *file_path, file_error_mode fe)
#endif
assert(pdf_doc->checksum != NULL);
if (strncmp(pdf_doc->checksum, checksum, PDF_CHECKSUM_SIZE) != 0) {
- pdftex_fail("PDF inclusion: file has changed '%s'", file_path);
+ luatex_fail("PDF inclusion: file has changed '%s'", file_path);
}
free(checksum);
}
@@ -144,7 +144,7 @@ PdfDocument *refPdfDocument(char *file_path, file_error_mode fe)
if (!doc->isOk() || !doc->okToPrint()) {
switch (fe) {
case FE_FAIL:
- pdftex_fail("xpdf: reading PDF image failed");
+ luatex_fail("xpdf: reading PDF image failed");
break;
case FE_RETURN_NULL:
delete doc;
@@ -242,7 +242,7 @@ static int addInObj(PDF pdf, PdfDocument * pdf_doc, Ref ref)
ObjMap *obj_map;
InObj *p, *q, *n;
if (ref.num == 0) {
- pdftex_fail("PDF inclusion: reference to invalid object"
+ luatex_fail("PDF inclusion: reference to invalid object"
" (is the included pdf broken?)");
}
if ((obj_map = findObjMap(pdf_doc, ref)) != NULL)
@@ -429,7 +429,7 @@ static void copyObject(PDF pdf, PdfDocument * pdf_doc, Object * obj)
case objError:
case objEOF:
case objNone:
- pdftex_fail("PDF inclusion: type <%s> cannot be copied",
+ luatex_fail("PDF inclusion: type <%s> cannot be copied",
obj->getTypeName());
break;
default:
@@ -482,7 +482,7 @@ static PDFRectangle *get_pagebox(Page * page, int pagebox_spec)
return page->getArtBox();
break;
default:
- pdftex_fail("PDF inclusion: unknown value of pagebox spec (%i)",
+ luatex_fail("PDF inclusion: unknown value of pagebox spec (%i)",
(int) pagebox_spec);
}
return page->getMediaBox(); // to make the compiler happy
@@ -530,10 +530,10 @@ read_pdf_info(image_dict * idict, int minor_pdf_version_wanted,
const char *msg =
"PDF inclusion: found PDF version <%d.%d>, but at most version <1.%d> allowed";
if (pdf_inclusion_errorlevel > 0) {
- pdftex_fail(msg, pdf_major_version_found, pdf_minor_version_found,
+ luatex_fail(msg, pdf_major_version_found, pdf_minor_version_found,
minor_pdf_version_wanted);
} else {
- pdftex_warn(msg, pdf_major_version_found, pdf_minor_version_found,
+ luatex_warn(msg, pdf_major_version_found, pdf_minor_version_found,
minor_pdf_version_wanted);
}
}
@@ -543,19 +543,19 @@ read_pdf_info(image_dict * idict, int minor_pdf_version_wanted,
GooString name(img_pagename(idict));
LinkDest *link = doc->findDest(&name);
if (link == NULL || !link->isOk())
- pdftex_fail("PDF inclusion: invalid destination <%s>",
+ luatex_fail("PDF inclusion: invalid destination <%s>",
img_pagename(idict));
Ref ref = link->getPageRef();
img_pagenum(idict) = catalog->findPage(ref.num, ref.gen);
if (img_pagenum(idict) == 0)
- pdftex_fail("PDF inclusion: destination is not a page <%s>",
+ luatex_fail("PDF inclusion: destination is not a page <%s>",
img_pagename(idict));
delete link;
} else {
// get page by number
if (img_pagenum(idict) <= 0
|| img_pagenum(idict) > img_totalpages(idict))
- pdftex_fail("PDF inclusion: required page <%i> does not exist",
+ luatex_fail("PDF inclusion: required page <%i> does not exist",
(int) img_pagenum(idict));
}
// get the required page
@@ -600,7 +600,7 @@ read_pdf_info(image_dict * idict, int minor_pdf_version_wanted,
img_rotation(idict) = 1;
break;
default:
- pdftex_warn
+ luatex_warn
("PDF inclusion: "
"/Rotate parameter in PDF file not multiple of 90 degrees.");
}
@@ -695,7 +695,7 @@ void write_epdf(PDF pdf, image_dict * idict)
// Metadata validity check (as a stream it must be indirect)
pageDict->lookupNF((char *) "Metadata", &obj1);
if (!obj1.isNull() && !obj1.isRef())
- pdftex_warn("PDF inclusion: /Metadata must be indirect object");
+ luatex_warn("PDF inclusion: /Metadata must be indirect object");
obj1.free();
// copy selected items in Page dictionary
@@ -732,7 +732,7 @@ void write_epdf(PDF pdf, image_dict * idict)
op2->free();
};
if (!op1->isDict())
- pdftex_warn("PDF inclusion: Page /Resources missing.");
+ luatex_warn("PDF inclusion: Page /Resources missing.");
op1->free();
}
obj1.free();
@@ -751,7 +751,7 @@ void write_epdf(PDF pdf, image_dict * idict)
//
contents.streamGetDict()->lookup((char *) "F", &obj1);
if (!obj1.isNull()) {
- pdftex_fail("PDF inclusion: Unsupported external stream");
+ luatex_fail("PDF inclusion: Unsupported external stream");
}
obj1.free();
contents.streamGetDict()->lookup((char *) "Length", &obj1);
diff --git a/Build/source/texk/web2c/luatexdir/image/writeimg.w b/Build/source/texk/web2c/luatexdir/image/writeimg.w
index 03b5af45c50..e5c39466ce7 100644
--- a/Build/source/texk/web2c/luatexdir/image/writeimg.w
+++ b/Build/source/texk/web2c/luatexdir/image/writeimg.w
@@ -22,7 +22,7 @@
@ @c
static const char _svn_version[] =
- "$Id: writeimg.w 4718 2014-01-02 15:35:31Z taco $"
+ "$Id: writeimg.w 4847 2014-03-05 18:13:17Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/image/writeimg.w $";
#include "ptexlib.h"
@@ -141,7 +141,7 @@ static void check_type_by_header(image_dict * idict)
for (i = 0; (unsigned) i < MAX_HEADER; i++) {
header[i] = (char) xgetc(file);
if (feof(file))
- pdftex_fail("reading image file failed");
+ luatex_fail("reading image file failed");
}
xfclose(file, img_filepath(idict));
/* tests */
@@ -292,7 +292,7 @@ void read_img(PDF pdf,
int callback_id;
assert(idict != NULL);
if (img_filename(idict) == NULL)
- pdftex_fail("image file name missing");
+ luatex_fail("image file name missing");
callback_id = callback_defined(find_image_file_callback);
if (img_filepath(idict) == NULL) {
if (callback_id > 0
@@ -304,7 +304,7 @@ void read_img(PDF pdf,
img_filepath(idict) =
kpse_find_file(img_filename(idict), kpse_tex_format, true);
if (img_filepath(idict) == NULL)
- pdftex_fail("cannot find image file '%s'", img_filename(idict));
+ luatex_fail("cannot find image file '%s'", img_filename(idict));
}
recorder_record_input(img_filename(idict));
/* type checks */
@@ -328,14 +328,14 @@ void read_img(PDF pdf,
break;
case IMG_TYPE_JBIG2:
if (minor_version < 4) {
- pdftex_fail
+ luatex_fail
("JBIG2 images only possible with at least PDF 1.4; you are generating PDF 1.%i",
(int) minor_version);
}
read_jbig2_info(idict);
break;
default:
- pdftex_fail("internal error: unknown image type (2)");
+ luatex_fail("internal error: unknown image type (2)");
}
cur_file_name = NULL;
if (img_state(idict) < DICT_FILESCANNED)
@@ -538,11 +538,11 @@ scaled_whd scale_img(image_dict * idict, scaled_whd alt_rule, int transform)
xr = img_xres(idict);
yr = img_yres(idict);
if (x <= 0 || y <= 0 || xr < 0 || yr < 0)
- pdftex_fail("ext1: invalid image dimensions");
+ luatex_fail("ext1: invalid image dimensions");
if (xr > 65535 || yr > 65535) {
xr = 0;
yr = 0;
- pdftex_warn("ext1: too large image resolution ignored");
+ luatex_warn("ext1: too large image resolution ignored");
}
if (((transform - img_rotation(idict)) & 1) == 1) {
tmp = x;
@@ -601,7 +601,7 @@ void write_img(PDF pdf, image_dict * idict)
write_pdfstream(pdf, idict);
break;
default:
- pdftex_fail("internal error: unknown image type (1)");
+ luatex_fail("internal error: unknown image type (1)");
}
if (tracefilenames)
tex_printf(">");
@@ -625,7 +625,7 @@ void pdf_write_image(PDF pdf, int n)
void check_pdfstream_dict(image_dict * idict)
{
if (!img_is_bbox(idict))
- pdftex_fail("image.stream: no bbox given");
+ luatex_fail("image.stream: no bbox given");
if (img_state(idict) < DICT_FILESCANNED)
img_state(idict) = DICT_FILESCANNED;
}
@@ -822,14 +822,14 @@ void undumpimagemeta(PDF pdf, int pdfversion, int pdfinclusionerrorlevel)
break;
case IMG_TYPE_JBIG2:
if (pdfversion < 4) {
- pdftex_fail
+ luatex_fail
("JBIG2 images only possible with at least PDF 1.4; you are generating PDF 1.%i",
(int) pdfversion);
}
undumpinteger(img_pagenum(idict));
break;
default:
- pdftex_fail("unknown type of image");
+ luatex_fail("unknown type of image");
}
read_img(pdf, idict, pdfversion, pdfinclusionerrorlevel);
}
diff --git a/Build/source/texk/web2c/luatexdir/image/writejbig2.w b/Build/source/texk/web2c/luatexdir/image/writejbig2.w
index 98d824fc782..371e5452776 100644
--- a/Build/source/texk/web2c/luatexdir/image/writejbig2.w
+++ b/Build/source/texk/web2c/luatexdir/image/writejbig2.w
@@ -81,7 +81,7 @@ object exists, reference it. Else create fresh one.
@ @c
static const char _svn_version[] =
- "$Id: writejbig2.w 4718 2014-01-02 15:35:31Z taco $"
+ "$Id: writejbig2.w 4847 2014-03-05 18:13:17Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/image/writejbig2.w $";
#undef DEBUG
@@ -209,9 +209,9 @@ static int ygetc(FILE * stream)
int c = getc(stream);
if (c < 0) {
if (c == EOF)
- pdftex_fail("getc() failed; premature end of JBIG2 image file");
+ luatex_fail("getc() failed; premature end of JBIG2 image file");
else
- pdftex_fail("getc() failed (can't happen)");
+ luatex_fail("getc() failed (can't happen)");
}
return c;
}
@@ -384,7 +384,7 @@ static void readfilehdr(FILEINFO * fip)
xfseek(fip->file, 0, SEEK_SET, fip->filepath);
for (i = 0; i < 8; i++)
if (ygetc(fip->file) != jbig2_id[i])
- pdftex_fail
+ luatex_fail
("readfilehdr(): reading JBIG2 image file failed: ID string missing");
/* Annex D.4.2 File header flags */
fip->filehdrflags = (unsigned int) ygetc(fip->file);
@@ -441,7 +441,7 @@ static void checkseghdrflags(SEGINFO * sip)
case M_Extension:
break;
default:
- pdftex_fail
+ luatex_fail
("checkseghdrflags(): unknown segment type in JBIG2 image file");
break;
}
@@ -790,7 +790,7 @@ void read_jbig2_info(image_dict * idict)
assert(idict != NULL);
img_type(idict) = IMG_TYPE_JBIG2;
if (img_pagenum(idict) < 1)
- pdftex_fail
+ luatex_fail
("read_jbig2_info(): page %d not in JBIG2 image file; page must be > 0",
(int) img_pagenum(idict));
if (file_tree == NULL) {
@@ -816,7 +816,7 @@ void read_jbig2_info(image_dict * idict)
}
pip = find_pageinfo(&(fip->pages), (unsigned long) img_pagenum(idict));
if (pip == NULL)
- pdftex_fail("read_jbig2_info(): page %d not found in JBIG2 image file",
+ luatex_fail("read_jbig2_info(): page %d not found in JBIG2 image file",
(int) img_pagenum(idict));
img_totalpages(idict) = (int) fip->numofpages;
img_xsize(idict) = (int) pip->width;
diff --git a/Build/source/texk/web2c/luatexdir/image/writejp2.w b/Build/source/texk/web2c/luatexdir/image/writejp2.w
index c71a6cea160..61549a67738 100644
--- a/Build/source/texk/web2c/luatexdir/image/writejp2.w
+++ b/Build/source/texk/web2c/luatexdir/image/writejp2.w
@@ -20,7 +20,7 @@
@ @c
static const char _svn_version[] =
- "$Id: writejp2.w 4718 2014-01-02 15:35:31Z taco $"
+ "$Id: writejp2.w 4847 2014-03-05 18:13:17Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/image/writejp2.w $";
@ Basic JPEG~2000 image support. Section and Table references below:
@@ -69,7 +69,7 @@ static hdr_struct read_boxhdr(image_dict * idict)
if (hdr.lbox == 1)
hdr.lbox = read8bytes(img_file(idict));
if (hdr.lbox == 0 && hdr.tbox != BOX_JP2C)
- pdftex_fail("reading JP2 image failed (LBox == 0)");
+ luatex_fail("reading JP2 image failed (LBox == 0)");
return hdr;
}
@@ -125,20 +125,20 @@ static void scan_res(image_dict * idict, uint64_t epos_s)
if (img_xres(idict) == 0 && img_yres(idict) == 0) {
scan_resc_resd(idict);
if (xftell(img_file(idict), img_filepath(idict)) != (long)epos)
- pdftex_fail
+ luatex_fail
("reading JP2 image failed (resc box size inconsistent)");
}
break;
case (BOX_RESD):
scan_resc_resd(idict);
if (xftell(img_file(idict), img_filepath(idict)) != (long)epos)
- pdftex_fail
+ luatex_fail
("reading JP2 image failed (resd box size inconsistent)");
break;
default:;
}
if (epos > epos_s)
- pdftex_fail("reading JP2 image failed (res box size inconsistent)");
+ luatex_fail("reading JP2 image failed (res box size inconsistent)");
if (epos == epos_s)
break;
xfseek(img_file(idict), (long) epos, SEEK_SET, img_filepath(idict));
@@ -160,7 +160,7 @@ static boolean scan_jp2h(image_dict * idict, uint64_t epos_s)
case (BOX_IHDR):
scan_ihdr(idict);
if (xftell(img_file(idict), img_filepath(idict)) != (long)epos)
- pdftex_fail
+ luatex_fail
("reading JP2 image failed (ihdr box size inconsistent)");
ihdr_found = true;
break;
@@ -170,7 +170,7 @@ static boolean scan_jp2h(image_dict * idict, uint64_t epos_s)
default:;
}
if (epos > epos_s)
- pdftex_fail
+ luatex_fail
("reading JP2 image failed (jp2h box size inconsistent)");
if (epos == epos_s)
break;
@@ -221,7 +221,7 @@ void read_jp2_info(image_dict * idict, img_readtype_e readtype)
spos = epos;
hdr = read_boxhdr(idict);
if (hdr.tbox != BOX_FTYP)
- pdftex_fail("reading JP2 image failed (missing ftyp box)");
+ luatex_fail("reading JP2 image failed (missing ftyp box)");
epos = spos + hdr.lbox;
xfseek(img_file(idict), (long) epos, SEEK_SET, img_filepath(idict));
@@ -235,7 +235,7 @@ void read_jp2_info(image_dict * idict, img_readtype_e readtype)
break;
case BOX_JP2C:
if (!ihdr_found)
- pdftex_fail("reading JP2 image failed (no ihdr box found)");
+ luatex_fail("reading JP2 image failed (no ihdr box found)");
break;
default:;
}
@@ -255,7 +255,7 @@ static void reopen_jp2(image_dict * idict)
read_jp2_info(idict, IMG_KEEPOPEN);
if (width != img_xsize(idict) || height != img_ysize(idict)
|| xres != img_xres(idict) || yres != img_yres(idict))
- pdftex_fail("writejp2: image dimensions have changed");
+ luatex_fail("writejp2: image dimensions have changed");
}
void write_jp2(PDF pdf, image_dict * idict)
@@ -281,7 +281,7 @@ void write_jp2(PDF pdf, image_dict * idict)
l = (long unsigned int) img_jp2_ptr(idict)->length;
xfseek(img_file(idict), 0, SEEK_SET, img_filepath(idict));
if (read_file_to_buf(pdf, img_file(idict), l) != l)
- pdftex_fail("writejp2: fread failed");
+ luatex_fail("writejp2: fread failed");
pdf_end_stream(pdf);
pdf_end_obj(pdf);
close_and_cleanup_jp2(idict);
diff --git a/Build/source/texk/web2c/luatexdir/image/writejpg.w b/Build/source/texk/web2c/luatexdir/image/writejpg.w
index a48b3c73a45..82091660418 100644
--- a/Build/source/texk/web2c/luatexdir/image/writejpg.w
+++ b/Build/source/texk/web2c/luatexdir/image/writejpg.w
@@ -20,8 +20,8 @@
@ @c
static const char _svn_version[] =
- "$Id: writejpg.w 4442 2012-05-25 22:40:34Z hhenkel $"
- "$URL: https://foundry.supelec.fr/svn/luatex/branches/ex-glyph/source/texk/web2c/luatexdir/image/writejpg.w $";
+ "$Id: writejpg.w 4847 2014-03-05 18:13:17Z luigi $"
+ "$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/image/writejpg.w $";
#include "ptexlib.h"
#include <assert.h>
@@ -130,7 +130,7 @@ void read_jpg_info(PDF pdf, image_dict * idict, img_readtype_e readtype)
img_jpg_ptr(idict)->length = xftell(img_file(idict), img_filepath(idict));
xfseek(img_file(idict), 0, SEEK_SET, img_filepath(idict));
if ((unsigned int) read2bytes(img_file(idict)) != 0xFFD8)
- pdftex_fail("reading JPEG image failed (no JPEG header found)");
+ luatex_fail("reading JPEG image failed (no JPEG header found)");
/* currently only true JFIF files allow extracting |img_xres| and |img_yres| */
if ((unsigned int) read2bytes(img_file(idict)) == 0xFFE0) { /* check for JFIF */
(void) read2bytes(img_file(idict));
@@ -166,9 +166,9 @@ void read_jpg_info(PDF pdf, image_dict * idict, img_readtype_e readtype)
xfseek(img_file(idict), 0, SEEK_SET, img_filepath(idict));
while (1) {
if (feof(img_file(idict)))
- pdftex_fail("reading JPEG image failed (premature file end)");
+ luatex_fail("reading JPEG image failed (premature file end)");
if (fgetc(img_file(idict)) != 0xFF)
- pdftex_fail("reading JPEG image failed (no marker found)");
+ luatex_fail("reading JPEG image failed (no marker found)");
i = xgetc(img_file(idict));
switch (i) {
case M_SOF3: /* lossless */
@@ -181,11 +181,11 @@ void read_jpg_info(PDF pdf, image_dict * idict, img_readtype_e readtype)
case M_SOF13:
case M_SOF14:
case M_SOF15: /* lossless */
- pdftex_fail("unsupported type of compression (SOF_%d)", i - M_SOF0);
+ luatex_fail("unsupported type of compression (SOF_%d)", i - M_SOF0);
break;
case M_SOF2:
if (pdf->minor_version <= 2)
- pdftex_fail("cannot use progressive DCT with PDF-1.2");
+ luatex_fail("cannot use progressive DCT with PDF-1.2");
case M_SOF0:
case M_SOF1:
(void) read2bytes(img_file(idict)); /* read segment length */
@@ -205,7 +205,7 @@ void read_jpg_info(PDF pdf, image_dict * idict, img_readtype_e readtype)
img_procset(idict) |= PROCSET_IMAGE_C;
break;
default:
- pdftex_fail("Unsupported color space %i",
+ luatex_fail("Unsupported color space %i",
(int) img_jpg_color(idict));
}
if (readtype == IMG_CLOSEINBETWEEN)
@@ -243,7 +243,7 @@ static void reopen_jpg(PDF pdf, image_dict * idict)
read_jpg_info(pdf, idict, IMG_KEEPOPEN);
if (width != img_xsize(idict) || height != img_ysize(idict)
|| xres != img_xres(idict) || yres != img_yres(idict))
- pdftex_fail("writejpg: image dimensions have changed");
+ luatex_fail("writejpg: image dimensions have changed");
}
@ @c
@@ -290,7 +290,7 @@ void write_jpg(PDF pdf, image_dict * idict)
pdf_end_array(pdf);
break;
default:
- pdftex_fail("Unsupported color space %i",
+ luatex_fail("Unsupported color space %i",
(int) img_jpg_color(idict));
}
}
@@ -301,7 +301,7 @@ void write_jpg(PDF pdf, image_dict * idict)
l = (size_t) img_jpg_ptr(idict)->length;
xfseek(img_file(idict), 0, SEEK_SET, img_filepath(idict));
if (read_file_to_buf(pdf, img_file(idict), l) != l)
- pdftex_fail("writejpg: fread failed");
+ luatex_fail("writejpg: fread failed");
pdf_end_stream(pdf);
pdf_end_obj(pdf);
close_and_cleanup_jpg(idict);
diff --git a/Build/source/texk/web2c/luatexdir/image/writepng.w b/Build/source/texk/web2c/luatexdir/image/writepng.w
index b5f0cb82323..56c853b26bd 100644
--- a/Build/source/texk/web2c/luatexdir/image/writepng.w
+++ b/Build/source/texk/web2c/luatexdir/image/writepng.w
@@ -20,7 +20,7 @@
@ @c
static const char _svn_version[] =
- "$Id: writepng.w 4718 2014-01-02 15:35:31Z taco $"
+ "$Id: writepng.w 4847 2014-03-05 18:13:17Z luigi $"
"$URL: https://foundry.supelec.fr/svn/luatex/trunk/source/texk/web2c/luatexdir/image/writepng.w $";
#include "ptexlib.h"
@@ -60,13 +60,13 @@ void read_png_info(image_dict * idict, img_readtype_e readtype)
img_png_ptr(idict) = xtalloc(1, png_img_struct);
if ((png_p = png_create_read_struct(PNG_LIBPNG_VER_STRING,
NULL, NULL, NULL)) == NULL)
- pdftex_fail("libpng: png_create_read_struct() failed");
+ luatex_fail("libpng: png_create_read_struct() failed");
img_png_png_ptr(idict) = png_p;
if ((info_p = png_create_info_struct(png_p)) == NULL)
- pdftex_fail("libpng: png_create_info_struct() failed");
+ luatex_fail("libpng: png_create_info_struct() failed");
img_png_info_ptr(idict) = info_p;
if (setjmp(png_jmpbuf(png_p)))
- pdftex_fail("libpng: internal error");
+ luatex_fail("libpng: internal error");
#if PNG_LIBPNG_VER >= 10603
/* ignore possibly incorrect CMF bytes */
png_set_option(png_p, PNG_MAXIMUM_INFLATE_WINDOW, PNG_OPTION_ON);
@@ -95,7 +95,7 @@ void read_png_info(image_dict * idict, img_readtype_e readtype)
img_procset(idict) |= PROCSET_IMAGE_C;
break;
default:
- pdftex_fail("unsupported type of color_type <%i>",
+ luatex_fail("unsupported type of color_type <%i>",
(int) png_get_color_type(png_p, info_p));
}
img_colordepth(idict) = png_get_bit_depth(png_p, info_p);
@@ -234,7 +234,7 @@ static void write_png_gray(PDF pdf, image_dict * idict)
} else {
if (png_get_image_height(png_p, info_p) *
png_get_rowbytes(png_p, info_p) >= 10240000L)
- pdftex_warn
+ luatex_warn
("large interlaced PNG might cause out of memory (use non-interlaced PNG to fix this)");
rows = xtalloc(png_get_image_height(png_p, info_p), png_bytep);
for (i = 0; i < (int) png_get_image_height(png_p, info_p); i++)
@@ -280,7 +280,7 @@ static void write_png_gray_alpha(PDF pdf, image_dict * idict)
} else {
if (png_get_image_height(png_p, info_p) *
png_get_rowbytes(png_p, info_p) >= 10240000L)
- pdftex_warn
+ luatex_warn
("large interlaced PNG might cause out of memory (use non-interlaced PNG to fix this)");
rows = xtalloc(png_get_image_height(png_p, info_p), png_bytep);
for (i = 0; i < (int) png_get_image_height(png_p, info_p); i++)
@@ -333,7 +333,7 @@ static void write_png_rgb_alpha(PDF pdf, image_dict * idict)
} else {
if (png_get_image_height(png_p, info_p) *
png_get_rowbytes(png_p, info_p) >= 10240000L)
- pdftex_warn
+ luatex_warn
("large interlaced PNG might cause out of memory (use non-interlaced PNG to fix this)");
rows = xtalloc(png_get_image_height(png_p, info_p), png_bytep);
for (i = 0; i < (int) png_get_image_height(png_p, info_p); i++)
@@ -371,7 +371,7 @@ static int spng_getint(FILE * f)
{
unsigned char buf[4];
if (fread(buf, 1, 4, f) != 4)
- pdftex_fail("writepng: reading chunk type failed");
+ luatex_fail("writepng: reading chunk type failed");
return ((((((int) buf[0] << 8) + buf[1]) << 8) + buf[2]) << 8) + buf[3];
}
@@ -392,7 +392,7 @@ static void copy_png(PDF pdf, image_dict * idict)
f = (FILE *) png_get_io_ptr(png_p);
/* 1st pass to find overall stream /Length */
if (fseek(f, 8, SEEK_SET) != 0)
- pdftex_fail("writepng: fseek in PNG file failed (1)");
+ luatex_fail("writepng: fseek in PNG file failed (1)");
do {
len = spng_getint(f);
type = spng_getint(f);
@@ -404,7 +404,7 @@ static void copy_png(PDF pdf, image_dict * idict)
streamlength += len;
default:
if (fseek(f, len + 4, SEEK_CUR) != 0)
- pdftex_fail("writepng: fseek in PNG file failed (2)");
+ luatex_fail("writepng: fseek in PNG file failed (2)");
}
} while (endflag == false);
pdf_dict_add_int(pdf, "Length", streamlength);
@@ -424,19 +424,19 @@ static void copy_png(PDF pdf, image_dict * idict)
/* 2nd pass to copy data */
endflag = false;
if (fseek(f, 8, SEEK_SET) != 0)
- pdftex_fail("writepng: fseek in PNG file failed (3)");
+ luatex_fail("writepng: fseek in PNG file failed (3)");
do {
len = spng_getint(f);
type = spng_getint(f);
switch (type) {
case SPNG_CHUNK_IDAT: /* do copy */
if (idat == 2)
- pdftex_fail("writepng: IDAT chunk sequence broken");
+ luatex_fail("writepng: IDAT chunk sequence broken");
idat = 1;
if (read_file_to_buf(pdf, f, len) != len)
- pdftex_fail("writepng: fread failed");
+ luatex_fail("writepng: fread failed");
if (fseek(f, 4, SEEK_CUR) != 0)
- pdftex_fail("writepng: fseek in PNG file failed (4)");
+ luatex_fail("writepng: fseek in PNG file failed (4)");
break;
case SPNG_CHUNK_IEND: /* done */
endflag = true;
@@ -445,7 +445,7 @@ static void copy_png(PDF pdf, image_dict * idict)
if (idat == 1)
idat = 2;
if (fseek(f, len + 4, SEEK_CUR) != 0)
- pdftex_fail("writepng: fseek in PNG file failed (5)");
+ luatex_fail("writepng: fseek in PNG file failed (5)");
}
} while (endflag == false);
pdf_end_stream(pdf);
@@ -463,7 +463,7 @@ static void reopen_png(image_dict * idict)
read_png_info(idict, IMG_KEEPOPEN);
if (width != img_xsize(idict) || height != img_ysize(idict)
|| xres != img_xres(idict) || yres != img_yres(idict))
- pdftex_fail("writepng: image dimensions have changed");
+ luatex_fail("writepng: image dimensions have changed");
}
@ @c
@@ -559,7 +559,7 @@ void write_png(PDF pdf, image_dict * idict)
pdf_dict_add_name(pdf, "ColorSpace", "DeviceRGB");
break;
default:
- pdftex_fail("unsupported type of color_type <%i>",
+ luatex_fail("unsupported type of color_type <%i>",
png_get_color_type(png_p, info_p));
}
}