diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2015-12-30 05:25:52 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2015-12-30 05:25:52 +0000 |
commit | 632abcdde570001e5f8e7509d630749e73cf2732 (patch) | |
tree | 4aea8023ed33dcfa7fe49a4b1705a2b5fb009bba /Build/source/texk/dvipdfm-x/spc_pdfm.c | |
parent | 4b54d57009fe18e922c56ba0e404a23d443f6ddc (diff) |
texk/dvipdfm-x: patches by S. Hirata
git-svn-id: svn://tug.org/texlive/trunk@39238 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/texk/dvipdfm-x/spc_pdfm.c')
-rw-r--r-- | Build/source/texk/dvipdfm-x/spc_pdfm.c | 40 |
1 files changed, 18 insertions, 22 deletions
diff --git a/Build/source/texk/dvipdfm-x/spc_pdfm.c b/Build/source/texk/dvipdfm-x/spc_pdfm.c index 1b12dd966eb..c8d2bef7c56 100644 --- a/Build/source/texk/dvipdfm-x/spc_pdfm.c +++ b/Build/source/texk/dvipdfm-x/spc_pdfm.c @@ -567,7 +567,7 @@ spc_handler_pdfm_annot (struct spc_env *spe, struct spc_arg *args) } transform_info_clear(&ti); - if (spc_util_read_dimtrns(spe, &ti, args, NULL, 0) < 0) { + if (spc_util_read_dimtrns(spe, &ti, args, 0) < 0) { if (ident) RELEASE(ident); return -1; @@ -745,7 +745,7 @@ spc_handler_pdfm_btrans (struct spc_env *spe, struct spc_arg *args) transform_info ti; transform_info_clear(&ti); - if (spc_util_read_dimtrns(spe, &ti, args, NULL, 0) < 0) { + if (spc_util_read_dimtrns(spe, &ti, args, 0) < 0) { return -1; } @@ -908,7 +908,7 @@ spc_handler_pdfm_bead (struct spc_env *spe, struct spc_arg *args) /* If okay so far, try to get a bounding box */ transform_info_clear(&ti); - if (spc_util_read_dimtrns(spe, &ti, args, NULL, 0) < 0) { + if (spc_util_read_dimtrns(spe, &ti, args, 0) < 0) { RELEASE(article_name); return -1; } @@ -962,8 +962,6 @@ spc_handler_pdfm_bead (struct spc_env *spe, struct spc_arg *args) return 0; } -int ImageSpecial = 0; /* default value */ - static int spc_handler_pdfm_image (struct spc_env *spe, struct spc_arg *args) { @@ -972,12 +970,7 @@ spc_handler_pdfm_image (struct spc_env *spe, struct spc_arg *args) char *ident = NULL; pdf_obj *fspec, *attr = NULL; transform_info ti; - int page_no; - -/* - Initialize the PageBox as the default value -*/ - PageBox = 0; + load_options options = {1, 0, NULL}; skip_white(&args->curptr, args->endptr); if (args->curptr[0] == '@') { @@ -990,9 +983,15 @@ spc_handler_pdfm_image (struct spc_env *spe, struct spc_arg *args) } } + /* 2015/12/29 + * There should not be "page" and "pagebox" in read_dimtrns(). + * It is for reading "dimensions" and "transformations" and "page" is + * completely unrelated. + */ transform_info_clear(&ti); - page_no = 1; - if (spc_util_read_dimtrns(spe, &ti, args, &page_no, 0) < 0) { + if (spc_util_read_blahblah(spe, &ti, + &options.page_no, &options.bbox_type, args) < 0) { + spc_warn(spe, "Reading option field in pdf:image failed."); if (ident) RELEASE(ident); return -1; @@ -1015,16 +1014,14 @@ spc_handler_pdfm_image (struct spc_env *spe, struct spc_arg *args) skip_white(&args->curptr, args->endptr); if (args->curptr < args->endptr) { - attr = parse_pdf_object(&args->curptr, args->endptr, NULL); + options.dict = parse_pdf_object(&args->curptr, args->endptr, NULL); if (!attr || !PDF_OBJ_DICTTYPE(attr)) { spc_warn(spe, "Ignore invalid attribute dictionary."); if (attr) pdf_release_obj(attr); } } - ImageSpecial = 1; - xobj_id = pdf_ximage_findresource(pdf_string_value(fspec), page_no, attr); - ImageSpecial = 0; + xobj_id = pdf_ximage_findresource(pdf_string_value(fspec), options); if (xobj_id < 0) { spc_warn(spe, "Could not find image resource..."); @@ -1042,8 +1039,6 @@ spc_handler_pdfm_image (struct spc_env *spe, struct spc_arg *args) return -1; } - PageBox_of_id[xobj_id] = (uint8_t)PageBox; - if (!(ti.flags & INFO_DO_HIDE)) pdf_dev_put_image(xobj_id, &ti, spe->x_user, spe->y_user); @@ -1553,7 +1548,7 @@ spc_handler_pdfm_bform (struct spc_env *spe, struct spc_arg *args) } transform_info_clear(&ti); - if (spc_util_read_dimtrns(spe, &ti, args, NULL, 0) < 0) { + if (spc_util_read_dimtrns(spe, &ti, args, 0) < 0) { RELEASE(ident); return -1; } @@ -1653,6 +1648,7 @@ spc_handler_pdfm_uxobj (struct spc_env *spe, struct spc_arg *args) int xobj_id; char *ident; transform_info ti; + load_options options = {1, 0, NULL}; skip_white(&args->curptr, args->endptr); @@ -1664,7 +1660,7 @@ spc_handler_pdfm_uxobj (struct spc_env *spe, struct spc_arg *args) transform_info_clear(&ti); if (args->curptr < args->endptr) { - if (spc_util_read_dimtrns(spe, &ti, args, NULL, 0) < 0) { + if (spc_util_read_dimtrns(spe, &ti, args, 0) < 0) { RELEASE(ident); return -1; } @@ -1676,7 +1672,7 @@ spc_handler_pdfm_uxobj (struct spc_env *spe, struct spc_arg *args) */ xobj_id = findresource(sd, ident); if (xobj_id < 0) { - xobj_id = pdf_ximage_findresource(ident, 0, NULL); + xobj_id = pdf_ximage_findresource(ident, options); if (xobj_id < 0) { spc_warn(spe, "Specified (image) object doesn't exist: %s", ident); RELEASE(ident); |