diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2018-03-03 10:27:37 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2018-03-03 10:27:37 +0000 |
commit | 09fb04c030e2d160d226f0f684c63e0753fb3f37 (patch) | |
tree | be9e6bacd4abd22d5d569f1289e0cd222a647f58 | |
parent | 89807db415192c13901dc2b5c21a11bf00852c6d (diff) |
remove unused lines
git-svn-id: svn://tug.org/texlive/trunk@46795 c570f23f-e606-0410-a88d-b1316a301751
-rw-r--r-- | Build/source/texk/dvipdfm-x/ChangeLog | 2 | ||||
-rw-r--r-- | Build/source/texk/dvipdfm-x/xbb.c | 190 |
2 files changed, 1 insertions, 191 deletions
diff --git a/Build/source/texk/dvipdfm-x/ChangeLog b/Build/source/texk/dvipdfm-x/ChangeLog index 94f6fb5e4cc..51326a84585 100644 --- a/Build/source/texk/dvipdfm-x/ChangeLog +++ b/Build/source/texk/dvipdfm-x/ChangeLog @@ -1,6 +1,6 @@ 2018-03-03 Akira Kakuto <kakuto@fuk.kindai.ac.jp> - * xbb.c: Support libdpx. + * xbb.c: Remove unused lines. 2018-03-02 Akira Kakuto <kakuto@fuk.kindai.ac.jp> diff --git a/Build/source/texk/dvipdfm-x/xbb.c b/Build/source/texk/dvipdfm-x/xbb.c index 82afc7ad259..3541c8d1f20 100644 --- a/Build/source/texk/dvipdfm-x/xbb.c +++ b/Build/source/texk/dvipdfm-x/xbb.c @@ -421,193 +421,3 @@ int extractbb (int argc, char *argv[]) return 0; } - -#if defined(LIBDPX) -static void do_aptex_bmp (FILE *fp, char *filename, pdf_rect * box) -{ - int width, height; - double xdensity, ydensity; - - if (bmp_get_bbox(fp, &width, &height, &xdensity, &ydensity) < 0) { - WARN("%s does not look like a BMP file...\n", filename); - return; - } - - box->llx = 0.0; - box->lly = 0.0; - box->urx = xdensity*width; - box->ury = ydensity*height; - return; -} - -static void do_aptex_jpeg (FILE *fp, char *filename, pdf_rect * box) -{ - int width, height; - 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; - } - - box->llx = 0.0; - box->lly = 0.0; - box->urx = xdensity*width; - box->ury = ydensity*height; - return; -} - -static void do_aptex_jp2 (FILE *fp, char *filename, pdf_rect * box) -{ - int width, height; - double xdensity, ydensity; - - if (jp2_get_bbox(fp, &width, &height, &xdensity, &ydensity) < 0) { - WARN("%s does not look like a JP2/JPX file...\n", filename); - return; - } - - box->llx = 0.0; - box->lly = 0.0; - box->urx = xdensity*width; - box->ury = ydensity*height; - return; -} - -#ifdef HAVE_LIBPNG -static void do_aptex_png (FILE *fp, char *filename, pdf_rect * box) -{ - uint32_t width, height; - 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; - } - - box->llx = 0.0; - box->lly = 0.0; - box->urx = xdensity*width; - box->ury = ydensity*height; - return; -} -#endif /* HAVE_LIBPNG */ - -static void do_aptex_pdf (FILE *fp, char *filename, pdf_rect * box) -{ - pdf_obj *page; - pdf_file *pf; - int page_no = Include_Page; - int count; - pdf_rect bbox; - pdf_tmatrix matrix; - pdf_coord p1, p2, p3, p4; - - pf = pdf_open(filename, fp); - if (!pf) { - WARN("%s does not look like a PDF file...\n", filename); - return; - } - count = pdf_doc_get_page_count(pf); - page = pdf_doc_get_page(pf, page_no, PageBox, &bbox, &matrix, NULL); - - pdf_close(pf); - - if (!page) - return; - - pdf_release_obj(page); - - /* Image's attribute "bbox" here is affected by /Rotate entry of included - * PDF page. - */ - p1.x = bbox.llx; p1.y = bbox.lly; - pdf_dev_transform(&p1, &matrix); - p2.x = bbox.urx; p2.y = bbox.lly; - pdf_dev_transform(&p2, &matrix); - p3.x = bbox.urx; p3.y = bbox.ury; - pdf_dev_transform(&p3, &matrix); - p4.x = bbox.llx; p4.y = bbox.ury; - pdf_dev_transform(&p4, &matrix); - - box->llx = min4(p1.x, p2.x, p3.x, p4.x); - box->lly = min4(p1.y, p2.y, p3.y, p4.y); - box->urx = max4(p1.x, p2.x, p3.x, p4.x); - box->ury = max4(p1.y, p2.y, p3.y, p4.y); -} - -void aptex_extractbb (char * pict, uint32_t page, uint32_t rect, pdf_rect * bbox) -{ - FILE *infile = NULL; - char *kpse_file_name = NULL; - int pictwd, pictht; - double xdensity, ydensity; - - if (page == 0) - Include_Page = 1; - else - Include_Page = page; - - PageBox = rect; - - if (kpse_in_name_ok(pict)) - { - infile = MFOPEN(pict, FOPEN_RBIN_MODE); - if (infile) - { - kpse_file_name = xstrdup(pict); - } - else - { - kpse_file_name = kpse_find_pict(pict); - if (kpse_file_name && kpse_in_name_ok(kpse_file_name)) - infile = MFOPEN(kpse_file_name, FOPEN_RBIN_MODE); - } - } - if (infile == NULL) - { - WARN("Can't find file (%s), or it is forbidden to read ...skipping\n", pict); - goto cont; - } - if (check_for_bmp(infile)) - { - do_aptex_bmp(infile, kpse_file_name, bbox); - goto cont; - } - if (check_for_jpeg(infile)) - { - do_aptex_jpeg(infile, kpse_file_name, bbox); - goto cont; - } - if (check_for_jp2(infile)) - { - do_aptex_jp2(infile, kpse_file_name, bbox); - goto cont; - } - if (check_for_pdf(infile)) - { - pdf_files_init(); - pdf_set_version(PDF_VERSION_MAX); - do_aptex_pdf(infile, kpse_file_name, bbox); - pdf_files_close(); - goto cont; - } -#ifdef HAVE_LIBPNG - if (check_for_png(infile)) - { - do_aptex_png(infile, kpse_file_name, bbox); - goto cont; - } -#endif /* HAVE_LIBPNG */ - WARN("Can't handle file type for file named %s\n", pict); - bbox->llx = 0.0; - bbox->lly = 0.0; - bbox->urx = 0.0; - bbox->ury = 0.0; -cont: - if (kpse_file_name) - RELEASE(kpse_file_name); - if (infile) - MFCLOSE(infile); -} -#endif /* LIBDPX */ |