diff --git a/source-dvipdfm-x.dif b/source-dvipdfm-x.dif new file mode 100644 index 0000000..549f476 --- /dev/null +++ b/source-dvipdfm-x.dif @@ -0,0 +1,55 @@ +2024-04-07 Yukimasa Morimi + * pdfximage.c: fix an issue where the PDF becomes large when + inserting the same image multiple times. + https://github.com/texjporg/tex-jp-build/pull/169 + +--- + texk/dvipdfm-x/pdfximage.c | 29 ++++++++++++++++------------- + 1 file changed, 16 insertions(+), 13 deletions(-) + +--- texk/dvipdfm-x/pdfximage.c 2024-03-05 00:40:55.000000000 +0100 ++++ texk/dvipdfm-x/pdfximage.c 2024-04-12 14:22:48.800914761 +0200 +@@ -396,6 +396,8 @@ load_image (const char *ident, const cha + int utf8name_failed = 0; + #endif /* WIN32 */ + ++#define dpx_streq(a, b) ((a) == (b) || (a) && (b) && strcmp(a, b) == 0) ++ + int + pdf_ximage_load_image (const char *ident, const char *filename, load_options options) + { +@@ -408,20 +410,21 @@ pdf_ximage_load_image (const char *ident + + for (i = 0; i < ic->count; i++) { + I = &ic->ximages[i]; +- if (I->filename && !strcmp(filename, I->filename)) { +- id = i; +- break; +- } +- } +- if (id >= 0) { +- if (I->attr.page_no == options.page_no && +- (I->attr.page_name && options.page_name && +- strcmp(I->attr.page_name, options.page_name) == 0) && +- !pdf_compare_object(I->attr.dict, options.dict) && /* ????? */ +- I->attr.bbox_type == options.bbox_type) { +- return id; +- } ++ if (I->filename == NULL || strcmp(filename, I->filename) != 0) ++ continue; ++ id = i; + f = I->fullname; ++ ++ if (I->attr.page_no != options.page_no) ++ continue; ++ if (!dpx_streq(I->attr.page_name, options.page_name)) ++ continue; ++ if (pdf_compare_object(I->attr.dict, options.dict) != 0) /* ????? */ ++ continue; ++ if (I->attr.bbox_type != options.bbox_type) ++ continue; ++ ++ return id; + } + if (f) { + /* we already have converted this file; f is the temporary file name */ diff --git a/texlive.changes b/texlive.changes index a3c229d..0e4cf0d 100644 --- a/texlive.changes +++ b/texlive.changes @@ -1,3 +1,10 @@ +------------------------------------------------------------------- +Fri Apr 12 13:10:45 UTC 2024 - Dr. Werner Fink + +- Add patch source-dvipdfm-x.dif + * dvipdfmx: repeated inclusion of the same image did not share + the image data, but had separate copies for each inclusion. + ------------------------------------------------------------------- Thu Mar 21 13:47:14 UTC 2024 - Dr. Werner Fink diff --git a/texlive.spec b/texlive.spec index 7916cd0..fe67dfd 100644 --- a/texlive.spec +++ b/texlive.spec @@ -264,6 +264,8 @@ Patch17: source-64.dif Patch18: source-a2ping.dif Patch19: source-dvipng.dif Patch21: source-ppc64.dif +# PATCH-FIX-UPSTREAM +Patch22: source-dvipdfm-x.dif # PATCH-FIX-SUSE Make biber work with our perl Patch42: biblatex-encoding.dif Patch43: biblatex-ms-encoding.dif @@ -4243,6 +4245,7 @@ This package is required by the package texlive-biber-bin. %patch -P18 -p0 -b .a2p %patch -P19 -p0 -b .dvipng %patch -P21 -p0 -b .ppcelf +%patch -P22 -p0 -b .sameimg pushd libs/luajit/LuaJIT-src/ #Missed patch ppc and risc %patch -P106 -p1 -b .arm64