diff options
author | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-12-23 16:27:24 +0000 |
---|---|---|
committer | Akira Kakuto <kakuto@fuk.kindai.ac.jp> | 2016-12-23 16:27:24 +0000 |
commit | d1cfc0855275b55794810162e7ce04a1e16d5188 (patch) | |
tree | 2e2626ee0e4738e8d6b6624c2d7fafe506b3dbfb /Build/source/libs/gd/libgd-src/src/gd_jpeg.c | |
parent | 932a0f6f62cb2f33be1bade4059504d9c2749f9c (diff) |
libgd 2.2.3
git-svn-id: svn://tug.org/texlive/trunk@42778 c570f23f-e606-0410-a88d-b1316a301751
Diffstat (limited to 'Build/source/libs/gd/libgd-src/src/gd_jpeg.c')
-rw-r--r-- | Build/source/libs/gd/libgd-src/src/gd_jpeg.c | 24 |
1 files changed, 7 insertions, 17 deletions
diff --git a/Build/source/libs/gd/libgd-src/src/gd_jpeg.c b/Build/source/libs/gd/libgd-src/src/gd_jpeg.c index 925b417fac3..51233952d44 100644 --- a/Build/source/libs/gd/libgd-src/src/gd_jpeg.c +++ b/Build/source/libs/gd/libgd-src/src/gd_jpeg.c @@ -307,6 +307,10 @@ BGD_DECLARE(void) gdImageJpegCtx(gdImagePtr im, gdIOCtx *outfile, int quality) if(quality >= 0) { jpeg_set_quality(&cinfo, quality, TRUE); + if (quality >= 90) { + cinfo.comp_info[0].h_samp_factor = 1; + cinfo.comp_info[0].v_samp_factor = 1; + } } /* If user requests interlace, translate that to progressive JPEG */ @@ -863,26 +867,12 @@ static int CMYKToRGB(int c, int m, int y, int k, int inverted) * almost a simple global replace from T. Lane's stdio versions. */ -/* Different versions of libjpeg use either 'jboolean' or 'boolean', and - * some platforms define 'boolean', and so forth. Deal with this - * madness by typedeffing 'safeboolean' to 'boolean' if HAVE_BOOLEAN - * is already set, because this is the test that libjpeg uses. - * Otherwise, typedef it to int, because that's what libjpeg does - * if HAVE_BOOLEAN is not defined. -TBB - */ - -#ifdef HAVE_BOOLEAN -typedef boolean safeboolean; -#else -typedef int safeboolean; -#endif /* HAVE_BOOLEAN */ - /* Expanded data source object for gdIOCtx input */ typedef struct { struct jpeg_source_mgr pub; /* public fields */ gdIOCtx *infile; /* source stream */ unsigned char *buffer; /* start of buffer */ - safeboolean start_of_file; /* have we gotten any data yet? */ + boolean start_of_file; /* have we gotten any data yet? */ } my_source_mgr; @@ -942,7 +932,7 @@ void init_source(j_decompress_ptr cinfo) #define END_JPEG_SEQUENCE "\r\n[*]--:END JPEG:--[*]\r\n" -safeboolean fill_input_buffer(j_decompress_ptr cinfo) +boolean fill_input_buffer(j_decompress_ptr cinfo) { my_src_ptr src = (my_src_ptr)cinfo->src; /* 2.0.12: signed size. Thanks to Geert Jansen */ @@ -1132,7 +1122,7 @@ void init_destination(j_compress_ptr cinfo) * write it out when emptying the buffer externally. */ -safeboolean empty_output_buffer(j_compress_ptr cinfo) +boolean empty_output_buffer(j_compress_ptr cinfo) { my_dest_ptr dest = (my_dest_ptr)cinfo->dest; |