diff options
author | DRC <dcommander@users.sourceforge.net> | 2010-10-10 02:15:56 +0000 |
---|---|---|
committer | DRC <dcommander@users.sourceforge.net> | 2010-10-10 02:15:56 +0000 |
commit | c04bd3cc97f44fd9030de1e141754c8775d4e5a5 (patch) | |
tree | 85fe6a10da40c9a47b72eaec3d4cb7604c096667 /jcmarker.c | |
parent | c54275c6a7cc318cd77760536d899d05bb391794 (diff) | |
parent | a4ecaacde6d64e1f20b8647546813c17592016c1 (diff) |
Implement lossless crop feature from jpeg v7 and v8
git-svn-id: svn+ssh://svn.code.sf.net/p/libjpeg-turbo/code/trunk@243 632fc199-4ca6-4c93-a231-07263d6284db
Diffstat (limited to 'jcmarker.c')
-rw-r--r-- | jcmarker.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -2,6 +2,7 @@ * jcmarker.c * * Copyright (C) 1991-1998, Thomas G. Lane. + * Copyright (C) 2010, D. R. Commander. * This file is part of the Independent JPEG Group's software. * For conditions of distribution and use, see the accompanying README file. * @@ -11,6 +12,7 @@ #define JPEG_INTERNALS #include "jinclude.h" #include "jpeglib.h" +#include "jpegcomp.h" typedef enum { /* JPEG marker codes */ @@ -285,13 +287,13 @@ emit_sof (j_compress_ptr cinfo, JPEG_MARKER code) emit_2bytes(cinfo, 3 * cinfo->num_components + 2 + 5 + 1); /* length */ /* Make sure image isn't bigger than SOF field can handle */ - if ((long) cinfo->image_height > 65535L || - (long) cinfo->image_width > 65535L) + if ((long) cinfo->_jpeg_height > 65535L || + (long) cinfo->_jpeg_width > 65535L) ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) 65535); emit_byte(cinfo, cinfo->data_precision); - emit_2bytes(cinfo, (int) cinfo->image_height); - emit_2bytes(cinfo, (int) cinfo->image_width); + emit_2bytes(cinfo, (int) cinfo->_jpeg_height); + emit_2bytes(cinfo, (int) cinfo->_jpeg_width); emit_byte(cinfo, cinfo->num_components); |