summaryrefslogtreecommitdiff
path: root/Build/source/texk/dvipdfmx
diff options
context:
space:
mode:
authorKarl Berry <karl@freefriends.org>2009-05-25 23:12:24 +0000
committerKarl Berry <karl@freefriends.org>2009-05-25 23:12:24 +0000
commit64ea3583cea282dcc8ca3d73eee931f3e7a701a8 (patch)
tree260bf87a61001d353d442455d161d5e8108af5ef /Build/source/texk/dvipdfmx
parent7660c21eadc2ae14f6ac9819d65519aefd535be7 (diff)
update to snapshot 20090522
git-svn-id: svn://tug.org/texlive/trunk@13470 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfmx')
-rw-r--r--Build/source/texk/dvipdfmx/ChangeLog23
-rwxr-xr-xBuild/source/texk/dvipdfmx/configure22
-rw-r--r--Build/source/texk/dvipdfmx/configure.ac2
-rw-r--r--Build/source/texk/dvipdfmx/src/Makefile.am2
-rw-r--r--Build/source/texk/dvipdfmx/src/Makefile.in2
-rw-r--r--Build/source/texk/dvipdfmx/src/dpxconf.c26
-rw-r--r--Build/source/texk/dvipdfmx/src/dvipdfmx.c48
-rw-r--r--Build/source/texk/dvipdfmx/src/dvipdfmx.h28
-rw-r--r--Build/source/texk/dvipdfmx/src/epdf.c15
-rw-r--r--Build/source/texk/dvipdfmx/src/jpegimage.c11
-rw-r--r--Build/source/texk/dvipdfmx/src/pngimage.c27
-rw-r--r--Build/source/texk/dvipdfmx/src/xbb.c29
-rw-r--r--Build/source/texk/dvipdfmx/src/xbb.h4
13 files changed, 160 insertions, 79 deletions
diff --git a/Build/source/texk/dvipdfmx/ChangeLog b/Build/source/texk/dvipdfmx/ChangeLog
index 76cc7803ad9..22c2f12546a 100644
--- a/Build/source/texk/dvipdfmx/ChangeLog
+++ b/Build/source/texk/dvipdfmx/ChangeLog
@@ -1,8 +1,29 @@
-$Header: /home/cvsroot/dvipdfmx/ChangeLog,v 1.256 2009/05/06 06:09:05 chofchof Exp $
+$Header: /home/cvsroot/dvipdfmx/ChangeLog,v 1.260 2009/05/22 07:59:59 chofchof Exp $
ChangeLog: Changes for DVIPDFMx
===============================
+2009-05-22 Jin-Hwan Cho
+
+ * generic/pgf-doc-diff.version2cvs, generic/pgf-generic-diff.version2cvs:
+ Removed the patches for the CVS version of pgf,
+ because they are applied to the main stream.
+
+2009-05-10 Matthias Franz
+
+ * epdf.c:
+ Don't try to convert included PDF files whose version number
+ is higher than output file version. (If run as dvipdfm,
+ conversion still occurs.)
+
+ * Makefile.am, Makefile.in, dvipdfmx.c, dvipdfmx.h, jpegimage.c, pngimage.c, xbb.c, xbb.h:
+ Added dvipdfm compatibility mode. This mode is triggered
+ if dvipdfmx is called as "dvipdfm", and likewise extractbb
+ as "ebb". (The latter mode was already present.)
+
+ * dpxconf.c:
+ Made predefined paper sizes match values given by libpaper.
+
2009-05-06 Jin-Hwan Cho
* dvipdfmx.c, pdflimits.h, pdfobj.c:
diff --git a/Build/source/texk/dvipdfmx/configure b/Build/source/texk/dvipdfmx/configure
index 561e5f1cfd2..e167cdcc461 100755
--- a/Build/source/texk/dvipdfmx/configure
+++ b/Build/source/texk/dvipdfmx/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.63 for dvipdfmx 20090506.
+# Generated by GNU Autoconf 2.63 for dvipdfmx 20090522.
#
# Report bugs to <dvipdfmx@project.ktug.or.kr>.
#
@@ -745,8 +745,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='dvipdfmx'
PACKAGE_TARNAME='dvipdfmx'
-PACKAGE_VERSION='20090506'
-PACKAGE_STRING='dvipdfmx 20090506'
+PACKAGE_VERSION='20090522'
+PACKAGE_STRING='dvipdfmx 20090522'
PACKAGE_BUGREPORT='dvipdfmx@project.ktug.or.kr'
ac_unique_file="src/dvipdfmx.c"
@@ -1495,7 +1495,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 dvipdfmx 20090506 to adapt to many kinds of systems.
+\`configure' configures dvipdfmx 20090522 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1565,7 +1565,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of dvipdfmx 20090506:";;
+ short | recursive ) echo "Configuration of dvipdfmx 20090522:";;
esac
cat <<\_ACEOF
@@ -1682,7 +1682,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-dvipdfmx configure 20090506
+dvipdfmx configure 20090522
generated by GNU Autoconf 2.63
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1696,7 +1696,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 dvipdfmx $as_me 20090506, which was
+It was created by dvipdfmx $as_me 20090522, which was
generated by GNU Autoconf 2.63. Invocation command line was
$ $0 $@
@@ -6941,7 +6941,7 @@ fi
# Define the identity of the package.
PACKAGE='dvipdfmx'
- VERSION='20090506'
+ VERSION='20090522'
cat >>confdefs.h <<_ACEOF
@@ -16308,7 +16308,7 @@ Usage: $0 [OPTIONS]
Report bugs to <bug-libtool@gnu.org>."
lt_cl_version="\
-dvipdfmx config.lt 20090506
+dvipdfmx config.lt 20090522
configured by $0, generated by GNU Autoconf 2.63.
Copyright (C) 2008 Free Software Foundation, Inc.
@@ -18713,7 +18713,7 @@ exec 6>&1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by dvipdfmx $as_me 20090506, which was
+This file was extended by dvipdfmx $as_me 20090522, which was
generated by GNU Autoconf 2.63. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -18776,7 +18776,7 @@ Report bugs to <bug-autoconf@gnu.org>."
_ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_version="\\
-dvipdfmx config.status 20090506
+dvipdfmx config.status 20090522
configured by $0, generated by GNU Autoconf 2.63,
with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
diff --git a/Build/source/texk/dvipdfmx/configure.ac b/Build/source/texk/dvipdfmx/configure.ac
index b8809ae3df5..7085650e6f7 100644
--- a/Build/source/texk/dvipdfmx/configure.ac
+++ b/Build/source/texk/dvipdfmx/configure.ac
@@ -6,7 +6,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([dvipdfmx], [20090506], [dvipdfmx@project.ktug.or.kr])
+AC_INIT([dvipdfmx], [20090522], [dvipdfmx@project.ktug.or.kr])
AC_PREREQ([2.63])
AC_CONFIG_SRCDIR([src/dvipdfmx.c])
AC_CONFIG_AUX_DIR([../../build-aux])
diff --git a/Build/source/texk/dvipdfmx/src/Makefile.am b/Build/source/texk/dvipdfmx/src/Makefile.am
index 269794671b9..71abfbad42d 100644
--- a/Build/source/texk/dvipdfmx/src/Makefile.am
+++ b/Build/source/texk/dvipdfmx/src/Makefile.am
@@ -19,7 +19,7 @@ dvipdfmx_SOURCES = \
unicode.c vf.c xbb.c \
agl.h bmpimage.h cff.h cff_dict.h cff_limits.h cff_stdstr.h cff_types.h \
cid.h cid_basefont.h cid_p.h cidtype0.h cidtype2.h cmap.h cmap_p.h cmap_read.h cmap_write.h \
- cs_type2.h dpxconf.h dpxcrypt.h dpxutil.h dpxfile.h dvi.h dvicodes.h epdf.h error.h fontmap.h \
+ cs_type2.h dpxconf.h dpxcrypt.h dpxutil.h dpxfile.h dvi.h dvicodes.h dvipdfmx.h epdf.h error.h fontmap.h \
jpegimage.h mem.h mfileio.h mpost.h numbers.h otl_conf.h otl_opt.h pdfcolor.h pdfdev.h \
pdfdoc.h pdfdraw.h pdfencoding.h pdfencrypt.h pdffont.h pdflimits.h pdfnames.h pdfobj.h \
pdfparse.h pdfresource.h pdfximage.h pkfont.h pngimage.h pst.h pst_obj.h sfnt.h \
diff --git a/Build/source/texk/dvipdfmx/src/Makefile.in b/Build/source/texk/dvipdfmx/src/Makefile.in
index b49126ddb0b..29cad0b7010 100644
--- a/Build/source/texk/dvipdfmx/src/Makefile.in
+++ b/Build/source/texk/dvipdfmx/src/Makefile.in
@@ -239,7 +239,7 @@ dvipdfmx_SOURCES = \
unicode.c vf.c xbb.c \
agl.h bmpimage.h cff.h cff_dict.h cff_limits.h cff_stdstr.h cff_types.h \
cid.h cid_basefont.h cid_p.h cidtype0.h cidtype2.h cmap.h cmap_p.h cmap_read.h cmap_write.h \
- cs_type2.h dpxconf.h dpxcrypt.h dpxutil.h dpxfile.h dvi.h dvicodes.h epdf.h error.h fontmap.h \
+ cs_type2.h dpxconf.h dpxcrypt.h dpxutil.h dpxfile.h dvi.h dvicodes.h dvipdfmx.h epdf.h error.h fontmap.h \
jpegimage.h mem.h mfileio.h mpost.h numbers.h otl_conf.h otl_opt.h pdfcolor.h pdfdev.h \
pdfdoc.h pdfdraw.h pdfencoding.h pdfencrypt.h pdffont.h pdflimits.h pdfnames.h pdfobj.h \
pdfparse.h pdfresource.h pdfximage.h pkfont.h pngimage.h pst.h pst_obj.h sfnt.h \
diff --git a/Build/source/texk/dvipdfmx/src/dpxconf.c b/Build/source/texk/dvipdfmx/src/dpxconf.c
index 03a22589003..5b8670310d6 100644
--- a/Build/source/texk/dvipdfmx/src/dpxconf.c
+++ b/Build/source/texk/dvipdfmx/src/dpxconf.c
@@ -1,4 +1,4 @@
-/* $Header: /home/cvsroot/dvipdfmx/src/dpxconf.c,v 1.3 2008/11/30 21:12:27 matthias Exp $
+/* $Header: /home/cvsroot/dvipdfmx/src/dpxconf.c,v 1.4 2009/05/10 16:39:53 matthias Exp $
This is DVIPDFMx, an eXtended version of DVIPDFM by Mark A. Wicks.
@@ -38,10 +38,10 @@ const struct paper paperspecs[] = {
{"legal" , 612.00, 1008.00},
{"ledger", 1224.00, 792.00},
{"tabloid", 792.00, 1224.00},
- {"a6", 297.64, 420.91},
- {"a5", 420.91, 595.27},
- {"a4", 595.27, 841.82},
- {"a3", 841.82, 1190.16},
+ {"a6", 297.638, 419.528},
+ {"a5", 419.528, 595.276},
+ {"a4", 595.276, 841.890},
+ {"a3", 841.890, 1190.550},
/*
* The B series paper formats were first introduced in Japanese
* patch (jpatch). The size of b6, ..., b5var paper is JIS paper
@@ -49,10 +49,10 @@ const struct paper paperspecs[] = {
* libpaper if you need ISO paper sizes.
*/
#if defined(USE_ISO_PAPERSIZE) || defined(ISO_PAPERSIZE)
- {"b6", 354, 499},
- {"b5", 501, 709},
- {"b4", 709, 1002},
- {"b3", 1002, 1418},
+ {"b6", 354.331, 498.898},
+ {"b5", 498.898, 708.661},
+ {"b4", 708.661, 1000.630},
+ {"b3", 1000.630, 1417.320},
#else
{"b6", 364.25, 515.91},
{"b5", 515.91, 728.50},
@@ -65,10 +65,10 @@ const struct paper paperspecs[] = {
{"jisb5", 515.91, 728.50},
{"jisb4", 728.50, 1031.81},
{"jisb3", 1031.81, 1457.00},
- {"isob6", 354, 499},
- {"isob5", 501, 709},
- {"isob4", 709, 1002},
- {"isob3", 1002, 1418},
+ {"isob6", 354.331, 498.898},
+ {"isob5", 498.898, 708.661},
+ {"isob4", 708.661, 1000.630},
+ {"isob3", 1000.630, 1417.320},
/* -- */
{NULL, 0, 0},
};
diff --git a/Build/source/texk/dvipdfmx/src/dvipdfmx.c b/Build/source/texk/dvipdfmx/src/dvipdfmx.c
index 1e71b205b66..4c324a2aca4 100644
--- a/Build/source/texk/dvipdfmx/src/dvipdfmx.c
+++ b/Build/source/texk/dvipdfmx/src/dvipdfmx.c
@@ -1,4 +1,4 @@
-/* $Header: /home/cvsroot/dvipdfmx/src/dvipdfmx.c,v 1.74 2009/05/06 06:07:09 chofchof Exp $
+/* $Header: /home/cvsroot/dvipdfmx/src/dvipdfmx.c,v 1.76 2009/05/10 17:04:54 matthias Exp $
This is DVIPDFMx, an eXtended version of DVIPDFM by Mark A. Wicks.
@@ -30,7 +30,6 @@
#include <string.h>
#include <limits.h>
#include <ctype.h>
-#include <libgen.h>
#include "system.h"
#include "mem.h"
@@ -57,10 +56,13 @@
#include "pdfximage.h"
#include "cid.h"
+#include "dvipdfmx.h"
#include "xbb.h"
extern void error_cleanup (void);
+int compat_mode = 0; /* 0 = dvipdfmx, 1 = dvipdfm */
+
static int verbose = 0;
static int mp_mode = 0;
@@ -432,9 +434,6 @@ do_args (int argc, char *argv[])
pdf_load_fontmap_file(argv[1], FONTMAP_RMODE_REPLACE);
POP_ARG();
break;
- case 'e':
- WARN("dvipdfm \"-e\" option not supported.");
- break;
case 'q': case 'v':
break;
case 'V':
@@ -449,11 +448,16 @@ do_args (int argc, char *argv[])
ver_minor = atoi(argv[1]);
POP_ARG();
}
- if (ver_minor < PDF_VERSION_MIN || ver_minor > PDF_VERSION_MAX) {
+ if (ver_minor < PDF_VERSION_MIN) {
+ WARN("PDF version 1.%d not supported. Using PDF 1.%d instead.",
+ ver_minor, PDF_VERSION_MIN);
+ ver_minor = PDF_VERSION_MIN;
+ } else if (ver_minor > PDF_VERSION_MAX) {
WARN("PDF version 1.%d not supported. Using PDF 1.%d instead.",
- ver_minor, pdf_get_version());
- } else
- pdf_set_version((unsigned) ver_minor);
+ ver_minor, PDF_VERSION_MAX);
+ ver_minor = PDF_VERSION_MAX;
+ }
+ pdf_set_version((unsigned) ver_minor);
}
break;
case 'z':
@@ -471,7 +475,11 @@ do_args (int argc, char *argv[])
pdf_set_compression(level);
}
break;
- case 'd':
+ case 'd':
+ if (compat_mode) {
+ WARN("dvipdfm \"-d\" option not supported.");
+ break;
+ }
if (isdigit(*(flag+1))) {
flag++;
pdfdecimaldigits = atoi(flag);
@@ -522,6 +530,11 @@ do_args (int argc, char *argv[])
}
POP_ARG();
break;
+ case 'e':
+ if (compat_mode) {
+ WARN("dvipdfm \"-e\" option not supported.");
+ break;
+ } /* else fall through */
default:
if (!really_quiet)
fprintf (stderr, "Unknown option in \"%s\"", flag);
@@ -788,11 +801,14 @@ main (int argc, char *argv[])
double dvi2pts;
{
- char *base = basename(argv[0]);
- if (strcmp(base, "ebb") == 0)
- return extractbb(argc, argv, EBB_OUTPUT);
- else if (strcmp(base, "xbb") == 0 || strcmp(base, "extractbb") == 0)
- return extractbb(argc, argv, XBB_OUTPUT);
+ const char *base = xbasename(argv[0]);
+
+ if (!(strcmp(base, "dvipdfm") && strcmp(base, "ebb")))
+ compat_mode = 1;
+
+ if (!(strcmp(base, "extractbb") && strcmp(base, "xbb") &&
+ strcmp(base, "ebb")))
+ return extractbb(argc, argv);
}
mem_debug_init();
@@ -846,7 +862,7 @@ main (int argc, char *argv[])
MESG("%s -> %s\n", dvi_filename, pdf_filename);
if (do_encryption) {
- if (key_bits > 40 && pdf_get_version() <= PDF_VERSION_MIN)
+ if (key_bits > 40 && pdf_get_version() < 4)
ERROR("Chosen key length requires at least PDF 1.4. "
"Use \"-V 4\" to change.");
pdf_enc_set_passwd(key_bits, permission, dvi_filename, pdf_filename);
diff --git a/Build/source/texk/dvipdfmx/src/dvipdfmx.h b/Build/source/texk/dvipdfmx/src/dvipdfmx.h
new file mode 100644
index 00000000000..c2c03b0df1c
--- /dev/null
+++ b/Build/source/texk/dvipdfmx/src/dvipdfmx.h
@@ -0,0 +1,28 @@
+/* $Header: /home/cvsroot/dvipdfmx/src/dvipdfmx.h,v 1.1 2009/05/10 17:04:54 matthias Exp $
+
+ This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
+
+ Copyright (C) 2009 by Jin-Hwan Cho, Matthias Franz, and Shunsaku Hirata,
+ the dvipdfmx project team <dvipdfmx@project.ktug.or.kr>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
+*/
+
+#ifndef _DVIPDFMX_H_
+#define _DVIPDFMX_H_
+
+extern int compat_mode;
+
+#endif /* _DVIPDFMX_H_ */
diff --git a/Build/source/texk/dvipdfmx/src/epdf.c b/Build/source/texk/dvipdfmx/src/epdf.c
index 78e269e04c3..938ae319c27 100644
--- a/Build/source/texk/dvipdfmx/src/epdf.c
+++ b/Build/source/texk/dvipdfmx/src/epdf.c
@@ -1,4 +1,4 @@
-/* $Header: /home/cvsroot/dvipdfmx/src/epdf.c,v 1.27 2009/05/04 00:41:42 matthias Exp $
+/* $Header: /home/cvsroot/dvipdfmx/src/epdf.c,v 1.28 2009/05/10 21:35:12 matthias Exp $
This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
@@ -40,6 +40,8 @@
#include "mfileio.h"
#include "error.h"
+#include "dvipdfmx.h"
+
#include "pdfobj.h"
#include "pdfdev.h"
#include "pdfdoc.h"
@@ -202,8 +204,13 @@ pdf_include_page (pdf_ximage *ximage, FILE *image_file, const char *filename)
return -1;
too_recent:
- WARN("PDF version of input file more recent than in output file.");
- WARN("Converting. Use \"-V\" switch to change output PDF version.");
pdf_close(pf);
- return 1;
+ WARN("PDF version of input file more recent than in output file.");
+ if (compat_mode) {
+ WARN("Converting. Use \"-V\" switch to change output PDF version.");
+ return 1;
+ } else {
+ WARN("Use \"-V\" switch to change output PDF version.");
+ return -1;
+ }
}
diff --git a/Build/source/texk/dvipdfmx/src/jpegimage.c b/Build/source/texk/dvipdfmx/src/jpegimage.c
index ed8d69165a2..6a4fdf20b32 100644
--- a/Build/source/texk/dvipdfmx/src/jpegimage.c
+++ b/Build/source/texk/dvipdfmx/src/jpegimage.c
@@ -1,4 +1,4 @@
-/* $Header: /home/cvsroot/dvipdfmx/src/jpegimage.c,v 1.10 2009/03/24 02:07:48 matthias Exp $
+/* $Header: /home/cvsroot/dvipdfmx/src/jpegimage.c,v 1.11 2009/05/10 17:04:54 matthias Exp $
This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
@@ -62,6 +62,8 @@
#include "mfileio.h"
#include "numbers.h"
+#include "dvipdfmx.h"
+
#include "pdfobj.h"
#include "jpegimage.h"
@@ -347,6 +349,13 @@ static void
jpeg_get_density (struct JPEG_info *j_info,
double *xdensity, double *ydensity)
{
+ if (compat_mode) {
+ *xdensity = *ydensity = 72.0 / 100.0;
+ return;
+ }
+
+ *xdensity = *ydensity = 1.0;
+
if (IS_JFIF(j_info)) {
struct JPEG_APPn_JFIF *app_data;
int i;
diff --git a/Build/source/texk/dvipdfmx/src/pngimage.c b/Build/source/texk/dvipdfmx/src/pngimage.c
index 6d4953650cd..db6ef2bcc95 100644
--- a/Build/source/texk/dvipdfmx/src/pngimage.c
+++ b/Build/source/texk/dvipdfmx/src/pngimage.c
@@ -1,4 +1,4 @@
-/* $Header: /home/cvsroot/dvipdfmx/src/pngimage.c,v 1.26 2009/03/24 02:07:48 matthias Exp $
+/* $Header: /home/cvsroot/dvipdfmx/src/pngimage.c,v 1.27 2009/05/10 17:04:54 matthias Exp $
This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
@@ -53,6 +53,8 @@
#include "error.h"
#include "mem.h"
+#include "dvipdfmx.h"
+
#include "pdfcolor.h"
#include "pdfobj.h"
@@ -210,10 +212,15 @@ png_include_image (pdf_ximage *ximage, FILE *png_file)
info.width = width;
info.height = height;
info.bits_per_component = bpc;
- if (xppm > 0)
- info.xdensity = 72.0 / 0.0254 / xppm;
- if (yppm > 0)
- info.ydensity = 72.0 / 0.0254 / yppm;
+
+ if (compat_mode)
+ info.xdensity = info.ydensity = 72.0 / 100.0;
+ else {
+ if (xppm > 0)
+ info.xdensity = 72.0 / 0.0254 / xppm;
+ if (yppm > 0)
+ info.ydensity = 72.0 / 0.0254 / yppm;
+ }
stream = pdf_new_stream (STREAM_COMPRESS);
stream_dict = pdf_stream_dict(stream);
@@ -1040,10 +1047,12 @@ png_get_bbox (FILE *png_file, long *width, long *height,
if (png_ptr)
png_destroy_read_struct(&png_ptr, NULL, NULL);
- if (xppm > 0)
- *xdensity = 72.0 / 0.0254 / xppm;
- if (yppm > 0)
- *ydensity = 72.0 / 0.0254 / yppm;
+ if (compat_mode)
+ *xdensity = *ydensity = 72.0 / 100.0;
+ else {
+ *xdensity = xppm ? 72.0 / 0.0254 / xppm : 1.0;
+ *ydensity = yppm ? 72.0 / 0.0254 / yppm : 1.0;
+ }
return 0;
}
diff --git a/Build/source/texk/dvipdfmx/src/xbb.c b/Build/source/texk/dvipdfmx/src/xbb.c
index 03db02e0bed..fd329548dbd 100644
--- a/Build/source/texk/dvipdfmx/src/xbb.c
+++ b/Build/source/texk/dvipdfmx/src/xbb.c
@@ -1,4 +1,4 @@
-/* $Header: /home/cvsroot/dvipdfmx/src/xbb.c,v 1.25 2009/05/04 00:41:43 matthias Exp $
+/* $Header: /home/cvsroot/dvipdfmx/src/xbb.c,v 1.26 2009/05/10 17:04:54 matthias Exp $
This is extractbb, a bounding box extraction program.
@@ -37,6 +37,7 @@
#include "jpegimage.h"
#include "pngimage.h"
+#include "dvipdfmx.h"
#include "xbb.h"
#define XBB_PROGRAM "extractbb"
@@ -81,8 +82,6 @@ char *extensions[] = {
".jpeg", ".JPEG", ".jpg", ".JPG", ".pdf", ".PDF", ".png", ".PNG"
};
-static int xbb_output_mode = XBB_OUTPUT;
-
static int xbb_to_file = 1;
static char *make_xbb_filename(const char *name)
@@ -104,7 +103,7 @@ static char *make_xbb_filename(const char *name)
strncpy(result, name, strlen(name)-strlen(extensions[i]));
result[strlen(name)-strlen(extensions[i])] = 0;
}
- strcat(result, (xbb_output_mode == XBB_OUTPUT ? ".xbb" : ".bb"));
+ strcat(result, (!compat_mode ? ".xbb" : ".bb"));
return result;
}
@@ -137,7 +136,7 @@ static void write_xbb(char *fname,
fprintf(fp, "%%%%Creator: %s %s\n", XBB_PROGRAM, XBB_VERSION);
fprintf(fp, "%%%%BoundingBox: %ld %ld %ld %ld\n", bbllx, bblly, bburx, bbury);
- if (xbb_output_mode == XBB_OUTPUT) {
+ if (!compat_mode) {
/* Note:
* According to Adobe Technical Note #5644, the arguments to
* "%%HiResBoundingBox:" must be of type real. And according
@@ -164,16 +163,13 @@ static void write_xbb(char *fname,
static void do_jpeg (FILE *fp, char *filename)
{
long width, height;
- double xdensity = 1.0, ydensity = 1.0;
+ double xdensity, ydensity;
if (jpeg_get_bbox(fp, &width, &height, &xdensity, &ydensity) < 0) {
WARN("%s does not look like a JPEG file...\n", filename);
return;
}
- if (xbb_output_mode == EBB_OUTPUT)
- xdensity = ydensity = 72.0 / 100.0;
-
write_xbb(filename, 0, 0, xdensity*width, ydensity*height, -1, -1);
return;
}
@@ -183,16 +179,13 @@ static void do_jpeg (FILE *fp, char *filename)
static void do_png (FILE *fp, char *filename)
{
long width, height;
- double xdensity = 1.0, ydensity = 1.0;
+ double xdensity, ydensity;
if (png_get_bbox(fp, &width, &height, &xdensity, &ydensity) < 0) {
WARN("%s does not look like a PNG file...\n", filename);
return;
}
- if (xbb_output_mode == EBB_OUTPUT)
- xdensity = ydensity = 72.0 / 100.0;
-
write_xbb(filename, 0, 0, xdensity*width, ydensity*height, -1, -1);
return;
}
@@ -225,12 +218,10 @@ static void do_pdf (FILE *fp, char *filename)
pdf_file_get_version(pf), count);
}
-int extractbb (int argc, char *argv[], int mode)
+int extractbb (int argc, char *argv[])
{
mem_debug_init();
- xbb_output_mode = mode;
-
pdf_files_init();
pdf_set_version(5);
@@ -248,11 +239,11 @@ int extractbb (int argc, char *argv[], int mode)
argc -= 1; argv += 1;
break;
case 'm':
- xbb_output_mode = EBB_OUTPUT;
+ compat_mode = 1;
argc -= 1; argv += 1;
break;
case 'x':
- xbb_output_mode = XBB_OUTPUT;
+ compat_mode = 0;
argc -= 1; argv += 1;
break;
case 'v':
@@ -269,7 +260,7 @@ int extractbb (int argc, char *argv[], int mode)
argc -= 1; argv += 1;
break;
case 'b':
- if (mode == EBB_OUTPUT) {
+ if (compat_mode) {
/* ignore obsolete "binary mode" option */
argc -= 1; argv += 1;
break;
diff --git a/Build/source/texk/dvipdfmx/src/xbb.h b/Build/source/texk/dvipdfmx/src/xbb.h
index a36513b2220..9e139736d2c 100644
--- a/Build/source/texk/dvipdfmx/src/xbb.h
+++ b/Build/source/texk/dvipdfmx/src/xbb.h
@@ -1,4 +1,4 @@
-/* $Header: /home/cvsroot/dvipdfmx/src/xbb.h,v 1.1 2008/05/17 07:22:21 chofchof Exp $
+/* $Header: /home/cvsroot/dvipdfmx/src/xbb.h,v 1.2 2009/05/10 17:04:54 matthias Exp $
This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
@@ -26,6 +26,6 @@
#define EBB_OUTPUT 0
#define XBB_OUTPUT 1
-extern int extractbb(int argc, char *argv[], int mode);
+extern int extractbb(int argc, char *argv[]);
#endif /* _XBB_H_ */