summaryrefslogtreecommitdiff
path: root/Build/source/texk/web2c/luatexdir/image
diff options
context:
space:
mode:
authorLuigi Scarso <luigi.scarso@gmail.com>2018-01-17 18:00:12 +0000
committerLuigi Scarso <luigi.scarso@gmail.com>2018-01-17 18:00:12 +0000
commitf100e939b3262ac391fe767d591d1a316ab59f3a (patch)
tree53787d7aa79da3a8b10df0049cfe623cf0f2bd89 /Build/source/texk/web2c/luatexdir/image
parent345e6b3ddab394ae88cd0d916992bc2bc0f8695d (diff)
Luatex 1.07 --- luatex and luatex53
git-svn-id: svn://tug.org/texlive/trunk@46348 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/web2c/luatexdir/image')
-rw-r--r--Build/source/texk/web2c/luatexdir/image/pdftoepdf.w8
-rw-r--r--Build/source/texk/web2c/luatexdir/image/writeimg.w20
2 files changed, 25 insertions, 3 deletions
diff --git a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.w b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.w
index 09dcd251584..7ba29731c19 100644
--- a/Build/source/texk/web2c/luatexdir/image/pdftoepdf.w
+++ b/Build/source/texk/web2c/luatexdir/image/pdftoepdf.w
@@ -693,7 +693,7 @@ void read_pdf_info(image_dict * idict)
unrefPdfDocument(img_filepath(idict));
}
- and also unref'd in the finalizer zo we got an extra unrefs when garbage was
+ and also unref'd in the finalizer so we got an extra unrefs when garbage was
collected. However it is more efficient to keep the file open so we do that
now. The (slower) alternative is to unref here (which in most cases forcing a
close of the file) but then we must not call flush_pdf_info.
@@ -893,6 +893,12 @@ void write_epdf(PDF pdf, image_dict * idict, int suppress_optional_info)
unrefPdfDocument(img_filepath(idict));
*/
+
+if (! img_keepopen(idict)) {
+ unrefPdfDocument(img_filepath(idict));
+}
+
+
}
/* Deallocate a PdfDocument with all its resources. */
diff --git a/Build/source/texk/web2c/luatexdir/image/writeimg.w b/Build/source/texk/web2c/luatexdir/image/writeimg.w
index 95e1ec3049d..1532dbe39c3 100644
--- a/Build/source/texk/web2c/luatexdir/image/writeimg.w
+++ b/Build/source/texk/web2c/luatexdir/image/writeimg.w
@@ -430,14 +430,30 @@ void scan_pdfximage(PDF pdf) /* static_pdf */
@ @c
void scan_pdfrefximage(PDF pdf)
{
- int transform = 0; /* one could scan transform as well */
+ /* one could scan transform as well */
+ int transform = 0;
+ /* begin of experiment */
+ int open = 0;
+ /* end of experiment */
image_dict *idict;
+ /* scans |<rule spec>| to |alt_rule| */
scaled_whd alt_rule, dim;
- alt_rule = scan_alt_rule(); /* scans |<rule spec>| to |alt_rule| */
+ alt_rule = scan_alt_rule();
+ /* begin of experiment */
+ if (scan_keyword("keepopen")) {
+ open = 1;
+ }
+ /* end of experiment */
scan_int();
check_obj_type(pdf, obj_type_ximage, cur_val);
tail_append(new_rule(image_rule));
idict = idict_array[obj_data_ptr(pdf, cur_val)];
+ /* begin of experiment */
+ if (open) {
+ /* so we keep the original value when no close is given */
+ idict->keepopen = 1;
+ }
+ /* end of experiment */
if (img_state(idict) == DICT_NEW) {
normal_warning("image","don't rely on the image data to be okay");
width(tail_par) = 0;