summaryrefslogtreecommitdiff
path: root/Build
diff options
context:
space:
mode:
authorAkira Kakuto <kakuto@fuk.kindai.ac.jp>2015-07-24 16:53:13 +0000
committerAkira Kakuto <kakuto@fuk.kindai.ac.jp>2015-07-24 16:53:13 +0000
commit92ea75ba44ba2056ddd363d9e9bd70fd63fb07aa (patch)
treeb3b4ed2195b0cb71e85054b6f67bae5582fc778f /Build
parent1f0deaa461431de85dd8bdc54ce111495ee2edde (diff)
dvipdfm-x: Improve obtaining BoundingBox.
git-svn-id: svn://tug.org/texlive/trunk@37940 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build')
-rw-r--r--Build/source/texk/dvipdfm-x/pdfdoc.c13
-rw-r--r--Build/source/texk/dvipdfm-x/pdfobj.h1
-rw-r--r--Build/source/texk/dvipdfm-x/pdfximage.c4
-rw-r--r--Build/source/texk/dvipdfm-x/spc_pdfm.c4
4 files changed, 12 insertions, 10 deletions
diff --git a/Build/source/texk/dvipdfm-x/pdfdoc.c b/Build/source/texk/dvipdfm-x/pdfdoc.c
index 1c99c6f3958..6c4599b8c54 100644
--- a/Build/source/texk/dvipdfm-x/pdfdoc.c
+++ b/Build/source/texk/dvipdfm-x/pdfdoc.c
@@ -1068,15 +1068,12 @@ pdf_doc_get_page (pdf_file *pf, long page_no, long *count_p,
if (crop_box)
box = crop_box;
else
- if (!(box = art_box) &&
+ if (!(box = media_box) &&
+ !(box = art_box) &&
!(box = trim_box) &&
- !(box = bleed_box) &&
- media_box) {
- box = media_box;
- media_box = NULL;
+ bleed_box) {
+ box = bleed_box;
}
- if (media_box)
- pdf_release_obj(media_box);
} else if (PageBox == 1) {
if (crop_box)
box = crop_box;
@@ -1164,7 +1161,7 @@ pdf_doc_get_page (pdf_file *pf, long page_no, long *count_p,
pdf_release_obj(tmp);
}
- if (medbox && PageBox) {
+ if (medbox) {
double mllx, mlly, murx, mury;
for (i = 4; i--; ) {
double x;
diff --git a/Build/source/texk/dvipdfm-x/pdfobj.h b/Build/source/texk/dvipdfm-x/pdfobj.h
index 20b7e83db00..fa5232f1a09 100644
--- a/Build/source/texk/dvipdfm-x/pdfobj.h
+++ b/Build/source/texk/dvipdfm-x/pdfobj.h
@@ -196,4 +196,5 @@ extern int pdfobj_escape_str (char *buffer, int size, const unsigned char *
extern pdf_obj *pdf_new_indirect (pdf_file *pf, unsigned long label, unsigned short generation);
extern int PageBox;
+extern int ImageSpecial;
#endif /* _PDFOBJ_H_ */
diff --git a/Build/source/texk/dvipdfm-x/pdfximage.c b/Build/source/texk/dvipdfm-x/pdfximage.c
index 9e2e680b813..36368603f59 100644
--- a/Build/source/texk/dvipdfm-x/pdfximage.c
+++ b/Build/source/texk/dvipdfm-x/pdfximage.c
@@ -369,9 +369,9 @@ pdf_ximage_findresource (const char *ident, long page_no, pdf_obj *dict)
if (I->ident && !strcmp(ident, I->ident)) {
f = I->filename;
/*
- PageBox can be differrent. So we retry if PageBox != 0
+ PageBox can be differrent. So we retry if ImageSpecial != 0
*/
- if (PageBox == 0) {
+ if (ImageSpecial == 0) {
if (I->page_no == page_no + (page_no < 0 ? I->page_count+1 : 0) &&
I->attr_dict == dict) {
return id;
diff --git a/Build/source/texk/dvipdfm-x/spc_pdfm.c b/Build/source/texk/dvipdfm-x/spc_pdfm.c
index cc9ee9a008b..fc1c49d477f 100644
--- a/Build/source/texk/dvipdfm-x/spc_pdfm.c
+++ b/Build/source/texk/dvipdfm-x/spc_pdfm.c
@@ -984,6 +984,8 @@ spc_handler_pdfm_bead (struct spc_env *spe, struct spc_arg *args)
return 0;
}
+ImageSpecial = 0;
+
static int
spc_handler_pdfm_image (struct spc_env *spe, struct spc_arg *args)
{
@@ -1042,7 +1044,9 @@ spc_handler_pdfm_image (struct spc_env *spe, struct spc_arg *args)
}
}
+ ImageSpecial = 1;
xobj_id = pdf_ximage_findresource(pdf_string_value(fspec), page_no, attr);
+ ImageSpecial = 0;
if (xobj_id < 0) {
spc_warn(spe, "Could not find image resource...");
pdf_release_obj(fspec);