Skip to content

Commit

Permalink
copy r70880 to branch: fix from ymorimi for dvipdfm-x insertion of th…
Browse files Browse the repository at this point in the history
…e same image multiple times

git-svn-id: svn://tug.org/texlive/branches/branch2024/Build/source@70897 c570f23f-e606-0410-a88d-b1316a301751
  • Loading branch information
kberry committed Apr 9, 2024
1 parent 47d5e2d commit 2c40b6f
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 25 deletions.
7 changes: 7 additions & 0 deletions texk/dvipdfm-x/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2024-04-07 Yukimasa Morimi <h20y6m@yahoo.co.jp>

* 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
* configure.ac: version 20240407.

2024-03-10 Karl Berry <karl@tug.org>

* TL'24 release.
Expand Down
22 changes: 11 additions & 11 deletions texk/dvipdfm-x/configure
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.72 for dvipdfm-x (TeX Live) 20240305.
# Generated by GNU Autoconf 2.72 for dvipdfm-x (TeX Live) 20240407.
#
# Report bugs to <dvipdfmx@tug.org>.
#
Expand Down Expand Up @@ -614,8 +614,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='dvipdfm-x (TeX Live)'
PACKAGE_TARNAME='dvipdfm-x--tex-live-'
PACKAGE_VERSION='20240305'
PACKAGE_STRING='dvipdfm-x (TeX Live) 20240305'
PACKAGE_VERSION='20240407'
PACKAGE_STRING='dvipdfm-x (TeX Live) 20240407'
PACKAGE_BUGREPORT='dvipdfmx@tug.org'
PACKAGE_URL=''

Expand Down Expand Up @@ -1383,7 +1383,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
'configure' configures dvipdfm-x (TeX Live) 20240305 to adapt to many kinds of systems.
'configure' configures dvipdfm-x (TeX Live) 20240407 to adapt to many kinds of systems.

Usage: $0 [OPTION]... [VAR=VALUE]...

Expand Down Expand Up @@ -1455,7 +1455,7 @@ fi

if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of dvipdfm-x (TeX Live) 20240305:";;
short | recursive ) echo "Configuration of dvipdfm-x (TeX Live) 20240407:";;
esac
cat <<\_ACEOF

Expand Down Expand Up @@ -1586,7 +1586,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
dvipdfm-x (TeX Live) configure 20240305
dvipdfm-x (TeX Live) configure 20240407
generated by GNU Autoconf 2.72

Copyright (C) 2023 Free Software Foundation, Inc.
Expand Down Expand Up @@ -2367,7 +2367,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.

It was created by dvipdfm-x (TeX Live) $as_me 20240305, which was
It was created by dvipdfm-x (TeX Live) $as_me 20240407, which was
generated by GNU Autoconf 2.72. Invocation command line was

$ $0$ac_configure_args_raw
Expand Down Expand Up @@ -8928,7 +8928,7 @@ fi

# Define the identity of the package.
PACKAGE='dvipdfm-x--tex-live-'
VERSION='20240305'
VERSION='20240407'


printf "%s\n" "#define PACKAGE \"$PACKAGE\"" >>confdefs.h
Expand Down Expand Up @@ -15995,7 +15995,7 @@ Usage: $0 [OPTIONS]
Report bugs to <bug-libtool@gnu.org>."

lt_cl_version="\
dvipdfm-x (TeX Live) config.lt 20240305
dvipdfm-x (TeX Live) config.lt 20240407
configured by $0, generated by GNU Autoconf 2.72.

Copyright (C) 2011 Free Software Foundation, Inc.
Expand Down Expand Up @@ -17938,7 +17938,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by dvipdfm-x (TeX Live) $as_me 20240305, which was
This file was extended by dvipdfm-x (TeX Live) $as_me 20240407, which was
generated by GNU Autoconf 2.72. Invocation command line was

CONFIG_FILES = $CONFIG_FILES
Expand Down Expand Up @@ -18010,7 +18010,7 @@ ac_cs_config_escaped=`printf "%s\n" "$ac_cs_config" | sed "s/^ //; s/'/'\\\\\\\\
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config='$ac_cs_config_escaped'
ac_cs_version="\\
dvipdfm-x (TeX Live) config.status 20240305
dvipdfm-x (TeX Live) config.status 20240407
configured by $0, generated by GNU Autoconf 2.72,
with options \\"\$ac_cs_config\\"

Expand Down
2 changes: 1 addition & 1 deletion texk/dvipdfm-x/configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ dnl This file is free software; the copyright holder
dnl gives unlimited permission to copy and/or distribute it,
dnl with or without modifications, as long as this notice is preserved.
dnl
AC_INIT([dvipdfm-x (TeX Live)], [20240305], [dvipdfmx@tug.org])
AC_INIT([dvipdfm-x (TeX Live)], [20240407], [dvipdfmx@tug.org])
AC_PREREQ([2.65])
AC_CONFIG_SRCDIR([agl.c])
AC_CONFIG_AUX_DIR([../../build-aux])
Expand Down
29 changes: 16 additions & 13 deletions texk/dvipdfm-x/pdfximage.c
Original file line number Diff line number Diff line change
Expand Up @@ -396,6 +396,8 @@ load_image (const char *ident, const char *filename, const char *fullname, int f
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)
{
Expand All @@ -408,20 +410,21 @@ pdf_ximage_load_image (const char *ident, const char *filename, load_options opt

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 */
Expand Down

0 comments on commit 2c40b6f

Please sign in to comment.