[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Freeze exception for exactimage (adopt+bugfixes; through unstable)



Hi,

I wanted to plan the adoption of the package exactimage. This package was 
orphaned in bug #587062. A new maintainer was found in form of Daniel Stender 
<daniel@danielstender.com>. I also asked him whether I can assist him as a Co-
Maintainer.

As it always happens, the time until the freeze of Wheezy was getting smaller 
and smaller.. and then the deadline passed by. So, we ended up with an 
exactimage in Wheezy without an maintainer and several bugs.

A possible solution is a planned freeze exception for exactimage. I've 
prepared an upload to mentors [1] that could be used as start of an discussion 
about what would be seen as acceptable by the release team. All cleanup or 
refactoring changes were removed and only the adopt change, the program 
behavior bug fixes and the libpng transition were included. Even lintian 
warnings about the policy changes were not fixed (3.9.2 -> 3.9.3).

Most of the patches are relative small and easy to understand with a little 
bit knowledge of the code. The only big thing standing out is the 
libjpeg8_compat.patch . It replaces some libjpeg62 specific files (from the 
libjpeg62 orig tarball) with the same files from libjpeg8 (from the libjpeg8 
orig tarball) to fix the hiccups/crashes in the jpeg code related to the abi 
changes. It is necessary because it is not possible to build exactimage 
against libjpeg62-dev after the transition of libevas-dev to libjpeg-dev 
because this virtual package is not provided anymore by libjpeg62-dev. The 
libjpeg8-dev package also conflicts with libjpeg62-dev (and would create even 
more problems during runtime after linking both).

There are many more things in the pipeline [2] (package rewrite, update to 
exactimage 0.8.7, hardening, ...) that I would keep for wheezy+1/experimental.

I would like to get feedback from the release team before I decide how to 
continue with the upload.

exactimage (0.8.5-5) unstable; urgency=low

 * debian/control:
   - Add Daniel Stender and Sven Eckelmann as new maintainer (Closes: #587062)
   - Depend on libpng-dev instead of libpng12-dev (Closes: #662317)
   - Depend on libjpeg8-dev to avoid hiccups with other libjpeg versions
 * debian/patches:
   - Add edentify_tga_mismatch.patch, Fix misidentification of PNM as TGA
     (Closes: #575324)
   - missing_include_vector.patch, Add missing includes for std::vector
   - Add libjpeg8_compat.patch, Build jpeg functionality for libjpeg8 to avoid
     crashes and other hiccups (Closes: #679775)
   - Add optimize2bw_denoise.patch, Fix optimize2bw denoise crash on 64-bit
     systems (Closes: #679772)

Kind regards,
	Sven

[1] http://mentors.debian.net/package/exactimage
[2] http://anonscm.debian.org/gitweb/?p=collab-maint/exactimage.git
File lists identical (after any substitutions)

Control files of package edisplay: lines which differ (wdiff format)
--------------------------------------------------------------------
Maintainer: [-Debian QA Group <packages@qa.debian.org>-] {+Daniel Stender <daniel@danielstender.com>+}
Version: [-0.8.5-4-] {+0.8.5-5+}

Control files of package exactimage: lines which differ (wdiff format)
----------------------------------------------------------------------
Maintainer: [-Debian QA Group <packages@qa.debian.org>-] {+Daniel Stender <daniel@danielstender.com>+}
Version: [-0.8.5-4-] {+0.8.5-5+}

Control files of package exactimage-dbg: lines which differ (wdiff format)
--------------------------------------------------------------------------
Breaks: edisplay (>> [-0.8.5-4),-] {+0.8.5-5),+} edisplay (<< [-0.8.5-4),-] {+0.8.5-5),+} exactimage (>> [-0.8.5-4),-] {+0.8.5-5),+} exactimage (<< [-0.8.5-4),-] {+0.8.5-5),+} libexactimage-perl (>> [-0.8.5-4),-] {+0.8.5-5),+} libexactimage-perl (<< [-0.8.5-4),-] {+0.8.5-5),+} php5-exactimage (>> [-0.8.5-4),-] {+0.8.5-5),+} php5-exactimage (<< [-0.8.5-4),-] {+0.8.5-5),+} python-exactimage (>> [-0.8.5-4),-] {+0.8.5-5),+} python-exactimage (<< [-0.8.5-4)-] {+0.8.5-5)+}
Installed-Size: [-86460-] {+86283+}
Maintainer: [-Debian QA Group <packages@qa.debian.org>-] {+Daniel Stender <daniel@danielstender.com>+}
Version: [-0.8.5-4-] {+0.8.5-5+}

Control files of package libexactimage-perl: lines which differ (wdiff format)
------------------------------------------------------------------------------
Installed-Size: [-1554-] {+1555+}
Maintainer: [-Debian QA Group <packages@qa.debian.org>-] {+Daniel Stender <daniel@danielstender.com>+}
Version: [-0.8.5-4-] {+0.8.5-5+}

Control files of package php5-exactimage: lines which differ (wdiff format)
---------------------------------------------------------------------------
Maintainer: [-Debian QA Group <packages@qa.debian.org>-] {+Daniel Stender <daniel@danielstender.com>+}
Version: [-0.8.5-4-] {+0.8.5-5+}

Control files of package python-exactimage: lines which differ (wdiff format)
-----------------------------------------------------------------------------
Maintainer: [-Debian QA Group <packages@qa.debian.org>-] {+Daniel Stender <daniel@danielstender.com>+}
Version: [-0.8.5-4-] {+0.8.5-5+}
diff -Nru exactimage-0.8.5/debian/changelog exactimage-0.8.5/debian/changelog
--- exactimage-0.8.5/debian/changelog	2012-05-30 06:31:38.000000000 +0200
+++ exactimage-0.8.5/debian/changelog	2012-07-01 15:55:21.000000000 +0200
@@ -1,3 +1,20 @@
+exactimage (0.8.5-5) unstable; urgency=low
+
+  * debian/control:
+    - Add Daniel Stender and Sven Eckelmann as new maintainer (Closes: #587062)
+    - Depend on libpng-dev instead of libpng12-dev (Closes: #662317)
+    - Depend on libjpeg8-dev to avoid hiccups with other libjpeg versions
+  * debian/patches:
+    - Add edentify_tga_mismatch.patch, Fix misidentification of PNM as TGA
+      (Closes: #575324)
+    - missing_include_vector.patch, Add missing includes for std::vector
+    - Add libjpeg8_compat.patch, Build jpeg functionality for libjpeg8 to avoid
+      crashes and other hiccups (Closes: #679775)
+    - Add optimize2bw_denoise.patch, Fix optimize2bw denoise crash on 64-bit
+      systems (Closes: #679772)
+
+ -- Sven Eckelmann <sven@narfation.org>  Sun, 01 Jul 2012 15:55:10 +0200
+
 exactimage (0.8.5-4) unstable; urgency=low
 
   * QA upload.
diff -Nru exactimage-0.8.5/debian/control exactimage-0.8.5/debian/control
--- exactimage-0.8.5/debian/control	2011-06-16 15:27:33.000000000 +0200
+++ exactimage-0.8.5/debian/control	2012-07-01 15:55:21.000000000 +0200
@@ -1,12 +1,13 @@
 Source: exactimage
 Section: graphics
 Priority: optional
-Maintainer: Debian QA Group <packages@qa.debian.org>
+Maintainer: Daniel Stender <daniel@danielstender.com>
+Uploaders: Sven Eckelmann <sven@narfation.org>
 Build-Depends: debhelper (>= 7), dpkg-dev (>= 1.15.7~),
  libexpat-dev, libfreetype6-dev,
  libx11-dev, libxrender-dev, libevas-dev,
- libgif-dev, libjasper-dev, libjpeg-dev, liblcms1-dev, libtiff-dev,
- libopenexr-dev, libagg-dev, libpng12-dev,
+ libgif-dev, libjasper-dev, libjpeg8-dev, liblcms1-dev, libtiff-dev,
+ libopenexr-dev, libagg-dev, libpng-dev,
  libperl-dev, php5-dev, pkg-config, python-all-dev (>= 2.5), python-support, swig,
  docbook-xsl, docbook-xml, xsltproc, libxml2-utils
 XS-Python-Version: >= 2.5
diff -Nru exactimage-0.8.5/debian/patches/edentify_tga_mismatch.patch exactimage-0.8.5/debian/patches/edentify_tga_mismatch.patch
--- exactimage-0.8.5/debian/patches/edentify_tga_mismatch.patch	1970-01-01 01:00:00.000000000 +0100
+++ exactimage-0.8.5/debian/patches/edentify_tga_mismatch.patch	2012-07-01 15:55:21.000000000 +0200
@@ -0,0 +1,136 @@
+Description: Fix misidentification of PNM as TGA
+ TARGA files have nearly no magic values that can be used to distinguish them
+ from other files. Therefore, it is important to test the other file codec
+ handlers before testing for TARGA.
+Bug-Debian: http://bugs.debian.org/575324
+Author: Sven Eckelmann <sven@narfation.org>
+
+---
+diff --git a/codecs/Codecs.cc b/codecs/Codecs.cc
+index 803e3e2e8f92ee8118a2512529c718e848241984..054548ff61db2f7dc82d24a32f40d8f512cb2dfb 100644
+--- a/codecs/Codecs.cc
++++ b/codecs/Codecs.cc
+@@ -22,7 +22,7 @@
+ #include <iostream>
+ #include <fstream>
+ 
+-std::vector<ImageCodec::loader_ref>* ImageCodec::loader = 0;
++std::list<ImageCodec::loader_ref>* ImageCodec::loader = 0;
+ 
+ ImageCodec::ImageCodec ()
+   : _image (0)
+@@ -78,7 +78,7 @@ int ImageCodec::Read (std::istream* stream, Image& image,
+ {
+   std::transform (codec.begin(), codec.end(), codec.begin(), tolower);
+   
+-  std::vector<loader_ref>::iterator it;
++  std::list<loader_ref>::iterator it;
+   if (loader)
+   for (it = loader->begin(); it != loader->end(); ++it)
+     {
+@@ -116,7 +116,7 @@ bool ImageCodec::Write (std::ostream* stream, Image& image,
+   std::transform (codec.begin(), codec.end(), codec.begin(), tolower);
+   std::transform (ext.begin(), ext.end(), ext.begin(), tolower);
+   
+-  std::vector<loader_ref>::iterator it;
++  std::list<loader_ref>::iterator it;
+   if (loader)
+   for (it = loader->begin(); it != loader->end(); ++it)
+     {
+@@ -150,7 +150,7 @@ ImageCodec* ImageCodec::MultiWrite (std::ostream* stream,
+   std::transform (codec.begin(), codec.end(), codec.begin(), tolower);
+   std::transform (ext.begin(), ext.end(), ext.begin(), tolower);
+   
+-  std::vector<loader_ref>::iterator it;
++  std::list<loader_ref>::iterator it;
+   if (loader)
+   for (it = loader->begin(); it != loader->end(); ++it)
+     {
+@@ -222,14 +222,17 @@ bool ImageCodec::Write (std::string file, Image& image,
+ }
+ 
+ void ImageCodec::registerCodec (const char* _ext, ImageCodec* _loader,
+-				bool _via_codec_only)
++				bool _via_codec_only, bool push_back)
+ {
+   static ImageCodec* last_loader = 0;
+   if (!loader)
+-    loader = new std::vector<loader_ref>;
++    loader = new std::list<loader_ref>;
+   
+   loader_ref ref = {_ext, _loader, _loader != last_loader, _via_codec_only};
+-  loader->push_back(ref);
++  if (push_back)
++    loader->push_back(ref);
++  else
++    loader->push_front(ref);
+   last_loader = _loader;
+ }
+ 
+@@ -241,7 +244,7 @@ void ImageCodec::unregisterCodec (ImageCodec* _loader)
+   }
+   
+   // remove from array
+-  std::vector<loader_ref>::iterator it;
++  std::list<loader_ref>::iterator it;
+   for (it = loader->begin(); it != loader->end();)
+     if (it->loader == _loader)
+       it = loader->erase (it);
+diff --git a/codecs/Codecs.hh b/codecs/Codecs.hh
+index e30a6b681cf6acc58173d41be023ea72852cb3d6..08790a14be44e9dde8721c1057a96d0b43a85e9d 100644
+--- a/codecs/Codecs.hh
++++ b/codecs/Codecs.hh
+@@ -18,7 +18,7 @@
+ /* The Image decoder and coder collection.
+  *
+  * The class itself has static methods to perform the de- and
+- * encoding. These methods search thru a loader vector to match the
++ * encoding. These methods search thru a loader list to match the
+  * file magick (on decoding) or the specified codec / file extension
+  * on encoding.
+  *
+@@ -36,7 +36,7 @@
+ 
+ #include <stdio.h>
+ 
+-#include <vector>
++#include <list>
+ #include <algorithm>
+ #include <iosfwd>
+ 
+@@ -111,11 +111,12 @@ protected:
+     bool via_codec_only;
+   };
+   
+-  static std::vector<loader_ref>* loader;
++  static std::list<loader_ref>* loader;
+   
+   static void registerCodec (const char* _ext,
+ 			     ImageCodec* _loader,
+-			     bool _via_codec_only = false);
++			     bool _via_codec_only = false,
++			     bool push_back = false);
+   static void unregisterCodec (ImageCodec* _loader);
+   
+   // freestanding instance, attached to an image
+diff --git a/codecs/tga.hh b/codecs/tga.hh
+index 9652176cd176de7ab2a3763d2d83a1e2c03e3235..2d5eb7d97e967718ba11923e2cc7a33d5d7c1dfc 100644
+--- a/codecs/tga.hh
++++ b/codecs/tga.hh
+@@ -21,11 +21,11 @@ class TGACodec : public ImageCodec {
+ public:
+   
+   TGACodec () {
+-    registerCodec ("tga", this);
+-    registerCodec ("tpic", this);
+-    registerCodec ("vda", this);
+-    registerCodec ("icb", this);
+-    registerCodec ("vst", this);
++    registerCodec ("tga", this, false, true);
++    registerCodec ("tpic", this, false, true);
++    registerCodec ("vda", this, false, true);
++    registerCodec ("icb", this, false, true);
++    registerCodec ("vst", this, false, true);
+   };
+   
+   virtual std::string getID () { return "TARGA"; };
diff -Nru exactimage-0.8.5/debian/patches/libjpeg8_compat.patch exactimage-0.8.5/debian/patches/libjpeg8_compat.patch
--- exactimage-0.8.5/debian/patches/libjpeg8_compat.patch	1970-01-01 01:00:00.000000000 +0100
+++ exactimage-0.8.5/debian/patches/libjpeg8_compat.patch	2012-07-01 15:55:21.000000000 +0200
@@ -0,0 +1,682 @@
+Description: Build jpeg functionality for libjpeg8
+Bug-Debian: http://bugs.debian.org/679775
+Author: Sven Eckelmann <sven@narfation.org>
+
+---
+diff --git a/codecs/jpegint.h b/codecs/jpegint.h
+index 95b00d405caeca1dc971b37a94bbadc566f3074b..c0d5c142022830a8d52a96dc8c38051dffa8cc91 100644
+--- a/codecs/jpegint.h
++++ b/codecs/jpegint.h
+@@ -2,6 +2,7 @@
+  * jpegint.h
+  *
+  * Copyright (C) 1991-1997, Thomas G. Lane.
++ * Modified 1997-2011 by Guido Vollbeding.
+  * This file is part of the Independent JPEG Group's software.
+  * For conditions of distribution and use, see the accompanying README file.
+  *
+@@ -99,14 +100,16 @@ struct jpeg_downsampler {
+ };
+ 
+ /* Forward DCT (also controls coefficient quantization) */
++typedef JMETHOD(void, forward_DCT_ptr,
++		(j_compress_ptr cinfo, jpeg_component_info * compptr,
++		 JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
++		 JDIMENSION start_row, JDIMENSION start_col,
++		 JDIMENSION num_blocks));
++
+ struct jpeg_forward_dct {
+   JMETHOD(void, start_pass, (j_compress_ptr cinfo));
+-  /* perhaps this should be an array??? */
+-  JMETHOD(void, forward_DCT, (j_compress_ptr cinfo,
+-			      jpeg_component_info * compptr,
+-			      JSAMPARRAY sample_data, JBLOCKROW coef_blocks,
+-			      JDIMENSION start_row, JDIMENSION start_col,
+-			      JDIMENSION num_blocks));
++  /* It is useful to allow each component to have a separate FDCT method. */
++  forward_DCT_ptr forward_DCT[MAX_COMPONENTS];
+ };
+ 
+ /* Entropy encoding */
+@@ -210,10 +213,6 @@ struct jpeg_entropy_decoder {
+   JMETHOD(void, start_pass, (j_decompress_ptr cinfo));
+   JMETHOD(boolean, decode_mcu, (j_decompress_ptr cinfo,
+ 				JBLOCKROW *MCU_data));
+-
+-  /* This is here to share code between baseline and progressive decoders; */
+-  /* other modules probably should not use it */
+-  boolean insufficient_data;	/* set TRUE after emitting warning */
+ };
+ 
+ /* Inverse DCT (also performs dequantization) */
+@@ -303,7 +302,7 @@ struct jpeg_color_quantizer {
+ #define jinit_downsampler	jIDownsampler
+ #define jinit_forward_dct	jIFDCT
+ #define jinit_huff_encoder	jIHEncoder
+-#define jinit_phuff_encoder	jIPHEncoder
++#define jinit_arith_encoder	jIAEncoder
+ #define jinit_marker_writer	jIMWriter
+ #define jinit_master_decompress	jIDMaster
+ #define jinit_d_main_controller	jIDMainC
+@@ -312,7 +311,7 @@ struct jpeg_color_quantizer {
+ #define jinit_input_controller	jIInCtlr
+ #define jinit_marker_reader	jIMReader
+ #define jinit_huff_decoder	jIHDecoder
+-#define jinit_phuff_decoder	jIPHDecoder
++#define jinit_arith_decoder	jIADecoder
+ #define jinit_inverse_dct	jIIDCT
+ #define jinit_upsampler		jIUpsampler
+ #define jinit_color_deconverter	jIDColor
+@@ -322,14 +321,41 @@ struct jpeg_color_quantizer {
+ #define jinit_memory_mgr	jIMemMgr
+ #define jdiv_round_up		jDivRound
+ #define jround_up		jRound
++#define jzero_far		jZeroFar
+ #define jcopy_sample_rows	jCopySamples
+ #define jcopy_block_row		jCopyBlocks
+-#define jzero_far		jZeroFar
+ #define jpeg_zigzag_order	jZIGTable
+ #define jpeg_natural_order	jZAGTable
++#define jpeg_natural_order7	jZAG7Table
++#define jpeg_natural_order6	jZAG6Table
++#define jpeg_natural_order5	jZAG5Table
++#define jpeg_natural_order4	jZAG4Table
++#define jpeg_natural_order3	jZAG3Table
++#define jpeg_natural_order2	jZAG2Table
++#define jpeg_aritab		jAriTab
+ #endif /* NEED_SHORT_EXTERNAL_NAMES */
+ 
+ 
++/* On normal machines we can apply MEMCOPY() and MEMZERO() to sample arrays
++ * and coefficient-block arrays.  This won't work on 80x86 because the arrays
++ * are FAR and we're assuming a small-pointer memory model.  However, some
++ * DOS compilers provide far-pointer versions of memcpy() and memset() even
++ * in the small-model libraries.  These will be used if USE_FMEM is defined.
++ * Otherwise, the routines in jutils.c do it the hard way.
++ */
++
++#ifndef NEED_FAR_POINTERS	/* normal case, same as regular macro */
++#define FMEMZERO(target,size)	MEMZERO(target,size)
++#else				/* 80x86 case */
++#ifdef USE_FMEM
++#define FMEMZERO(target,size)	_fmemset((void FAR *)(target), 0, (size_t)(size))
++#else
++EXTERN(void) jzero_far JPP((void FAR * target, size_t bytestozero));
++#define FMEMZERO(target,size)	jzero_far(target, size)
++#endif
++#endif
++
++
+ /* Compression module initialization routines */
+ EXTERN(void) jinit_compress_master JPP((j_compress_ptr cinfo));
+ EXTERN(void) jinit_c_master_control JPP((j_compress_ptr cinfo,
+@@ -344,7 +370,7 @@ EXTERN(void) jinit_color_converter JPP((j_compress_ptr cinfo));
+ EXTERN(void) jinit_downsampler JPP((j_compress_ptr cinfo));
+ EXTERN(void) jinit_forward_dct JPP((j_compress_ptr cinfo));
+ EXTERN(void) jinit_huff_encoder JPP((j_compress_ptr cinfo));
+-EXTERN(void) jinit_phuff_encoder JPP((j_compress_ptr cinfo));
++EXTERN(void) jinit_arith_encoder JPP((j_compress_ptr cinfo));
+ EXTERN(void) jinit_marker_writer JPP((j_compress_ptr cinfo));
+ /* Decompression module initialization routines */
+ EXTERN(void) jinit_master_decompress JPP((j_decompress_ptr cinfo));
+@@ -357,7 +383,7 @@ EXTERN(void) jinit_d_post_controller JPP((j_decompress_ptr cinfo,
+ EXTERN(void) jinit_input_controller JPP((j_decompress_ptr cinfo));
+ EXTERN(void) jinit_marker_reader JPP((j_decompress_ptr cinfo));
+ EXTERN(void) jinit_huff_decoder JPP((j_decompress_ptr cinfo));
+-EXTERN(void) jinit_phuff_decoder JPP((j_decompress_ptr cinfo));
++EXTERN(void) jinit_arith_decoder JPP((j_decompress_ptr cinfo));
+ EXTERN(void) jinit_inverse_dct JPP((j_decompress_ptr cinfo));
+ EXTERN(void) jinit_upsampler JPP((j_decompress_ptr cinfo));
+ EXTERN(void) jinit_color_deconverter JPP((j_decompress_ptr cinfo));
+@@ -375,12 +401,20 @@ EXTERN(void) jcopy_sample_rows JPP((JSAMPARRAY input_array, int source_row,
+ 				    int num_rows, JDIMENSION num_cols));
+ EXTERN(void) jcopy_block_row JPP((JBLOCKROW input_row, JBLOCKROW output_row,
+ 				  JDIMENSION num_blocks));
+-EXTERN(void) jzero_far JPP((void FAR * target, size_t bytestozero));
+ /* Constant tables in jutils.c */
+ #if 0				/* This table is not actually needed in v6a */
+ extern const int jpeg_zigzag_order[]; /* natural coef order to zigzag order */
+ #endif
+ extern const int jpeg_natural_order[]; /* zigzag coef order to natural order */
++extern const int jpeg_natural_order7[]; /* zz to natural order for 7x7 block */
++extern const int jpeg_natural_order6[]; /* zz to natural order for 6x6 block */
++extern const int jpeg_natural_order5[]; /* zz to natural order for 5x5 block */
++extern const int jpeg_natural_order4[]; /* zz to natural order for 4x4 block */
++extern const int jpeg_natural_order3[]; /* zz to natural order for 3x3 block */
++extern const int jpeg_natural_order2[]; /* zz to natural order for 2x2 block */
++
++/* Arithmetic coding probability estimation tables in jaricom.c */
++extern const INT32 jpeg_aritab[];
+ 
+ /* Suppress undefined-structure complaints if necessary. */
+ 
+diff --git a/codecs/transupp.c b/codecs/transupp.c
+index e6bb936a5b05aa608f5440ff6e92c6dc79c04c01..016f383d4f388db01840dff72e2dfe43c1b7e8ef 100644
+--- a/codecs/transupp.c
++++ b/codecs/transupp.c
+@@ -1,7 +1,7 @@
+ /*
+  * transupp.c
+  *
+- * Copyright (C) 1997-2001, Thomas G. Lane.
++ * Copyright (C) 1997-2011, Thomas G. Lane, Guido Vollbeding.
+  * This file is part of the Independent JPEG Group's software.
+  * For conditions of distribution and use, see the accompanying README file.
+  *
+@@ -133,7 +133,8 @@ do_flip_h_no_crop (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+    * mirroring by changing the signs of odd-numbered columns.
+    * Partial iMCUs at the right edge are left untouched.
+    */
+-  MCU_cols = srcinfo->image_width / (dstinfo->max_h_samp_factor * DCTSIZE);
++  MCU_cols = srcinfo->output_width /
++    (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
+ 
+   for (ci = 0; ci < dstinfo->num_components; ci++) {
+     compptr = dstinfo->comp_info + ci;
+@@ -198,7 +199,8 @@ do_flip_h (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+    * different rows of a single virtual array simultaneously.  Otherwise,
+    * this is essentially the same as the routine above.
+    */
+-  MCU_cols = srcinfo->image_width / (dstinfo->max_h_samp_factor * DCTSIZE);
++  MCU_cols = srcinfo->output_width /
++    (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
+ 
+   for (ci = 0; ci < dstinfo->num_components; ci++) {
+     compptr = dstinfo->comp_info + ci;
+@@ -262,7 +264,8 @@ do_flip_v (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+    * of odd-numbered rows.
+    * Partial iMCUs at the bottom edge are copied verbatim.
+    */
+-  MCU_rows = srcinfo->image_height / (dstinfo->max_v_samp_factor * DCTSIZE);
++  MCU_rows = srcinfo->output_height /
++    (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);
+ 
+   for (ci = 0; ci < dstinfo->num_components; ci++) {
+     compptr = dstinfo->comp_info + ci;
+@@ -389,7 +392,8 @@ do_rot_90 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+    * at the (output) right edge properly.  They just get transposed and
+    * not mirrored.
+    */
+-  MCU_cols = srcinfo->image_height / (dstinfo->max_h_samp_factor * DCTSIZE);
++  MCU_cols = srcinfo->output_height /
++    (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
+ 
+   for (ci = 0; ci < dstinfo->num_components; ci++) {
+     compptr = dstinfo->comp_info + ci;
+@@ -469,7 +473,8 @@ do_rot_270 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+    * at the (output) bottom edge properly.  They just get transposed and
+    * not mirrored.
+    */
+-  MCU_rows = srcinfo->image_width / (dstinfo->max_v_samp_factor * DCTSIZE);
++  MCU_rows = srcinfo->output_width /
++    (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);
+ 
+   for (ci = 0; ci < dstinfo->num_components; ci++) {
+     compptr = dstinfo->comp_info + ci;
+@@ -536,8 +541,10 @@ do_rot_180 (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+   JCOEFPTR src_ptr, dst_ptr;
+   jpeg_component_info *compptr;
+ 
+-  MCU_cols = srcinfo->image_width / (dstinfo->max_h_samp_factor * DCTSIZE);
+-  MCU_rows = srcinfo->image_height / (dstinfo->max_v_samp_factor * DCTSIZE);
++  MCU_cols = srcinfo->output_width /
++    (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
++  MCU_rows = srcinfo->output_height /
++    (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);
+ 
+   for (ci = 0; ci < dstinfo->num_components; ci++) {
+     compptr = dstinfo->comp_info + ci;
+@@ -645,8 +652,10 @@ do_transverse (j_decompress_ptr srcinfo, j_compress_ptr dstinfo,
+   JCOEFPTR src_ptr, dst_ptr;
+   jpeg_component_info *compptr;
+ 
+-  MCU_cols = srcinfo->image_height / (dstinfo->max_h_samp_factor * DCTSIZE);
+-  MCU_rows = srcinfo->image_width / (dstinfo->max_v_samp_factor * DCTSIZE);
++  MCU_cols = srcinfo->output_height /
++    (dstinfo->max_h_samp_factor * dstinfo->min_DCT_h_scaled_size);
++  MCU_rows = srcinfo->output_width /
++    (dstinfo->max_v_samp_factor * dstinfo->min_DCT_v_scaled_size);
+ 
+   for (ci = 0; ci < dstinfo->num_components; ci++) {
+     compptr = dstinfo->comp_info + ci;
+@@ -762,7 +771,7 @@ jt_read_integer (const char ** strptr, JDIMENSION * result)
+  * The routine returns TRUE if the spec string is valid, FALSE if not.
+  *
+  * The crop spec string should have the format
+- *	<width>x<height>{+-}<xoffset>{+-}<yoffset>
++ *	<width>[f]x<height>[f]{+-}<xoffset>{+-}<yoffset>
+  * where width, height, xoffset, and yoffset are unsigned integers.
+  * Each of the elements can be omitted to indicate a default value.
+  * (A weakness of this style is that it is not possible to omit xoffset
+@@ -784,14 +793,22 @@ jtransform_parse_crop_spec (jpeg_transform_info *info, const char *spec)
+     /* fetch width */
+     if (! jt_read_integer(&spec, &info->crop_width))
+       return FALSE;
+-    info->crop_width_set = JCROP_POS;
++    if (*spec == 'f' || *spec == 'F') {
++      spec++;
++      info->crop_width_set = JCROP_FORCE;
++    } else
++      info->crop_width_set = JCROP_POS;
+   }
+-  if (*spec == 'x' || *spec == 'X') {	
++  if (*spec == 'x' || *spec == 'X') {
+     /* fetch height */
+     spec++;
+     if (! jt_read_integer(&spec, &info->crop_height))
+       return FALSE;
+-    info->crop_height_set = JCROP_POS;
++    if (*spec == 'f' || *spec == 'F') {
++      spec++;
++      info->crop_height_set = JCROP_FORCE;
++    } else
++      info->crop_height_set = JCROP_POS;
+   }
+   if (*spec == '+' || *spec == '-') {
+     /* fetch xoffset */
+@@ -822,10 +839,10 @@ trim_right_edge (jpeg_transform_info *info, JDIMENSION full_width)
+ {
+   JDIMENSION MCU_cols;
+ 
+-  MCU_cols = info->output_width / (info->max_h_samp_factor * DCTSIZE);
++  MCU_cols = info->output_width / info->iMCU_sample_width;
+   if (MCU_cols > 0 && info->x_crop_offset + MCU_cols ==
+-      full_width / (info->max_h_samp_factor * DCTSIZE))
+-    info->output_width = MCU_cols * (info->max_h_samp_factor * DCTSIZE);
++      full_width / info->iMCU_sample_width)
++    info->output_width = MCU_cols * info->iMCU_sample_width;
+ }
+ 
+ LOCAL(void)
+@@ -833,10 +850,10 @@ trim_bottom_edge (jpeg_transform_info *info, JDIMENSION full_height)
+ {
+   JDIMENSION MCU_rows;
+ 
+-  MCU_rows = info->output_height / (info->max_v_samp_factor * DCTSIZE);
++  MCU_rows = info->output_height / info->iMCU_sample_height;
+   if (MCU_rows > 0 && info->y_crop_offset + MCU_rows ==
+-      full_height / (info->max_v_samp_factor * DCTSIZE))
+-    info->output_height = MCU_rows * (info->max_v_samp_factor * DCTSIZE);
++      full_height / info->iMCU_sample_height)
++    info->output_height = MCU_rows * info->iMCU_sample_height;
+ }
+ 
+ 
+@@ -852,59 +869,89 @@ trim_bottom_edge (jpeg_transform_info *info, JDIMENSION full_height)
+  * Hence, this routine must be called after jpeg_read_header (which reads
+  * the image dimensions) and before jpeg_read_coefficients (which realizes
+  * the source's virtual arrays).
++ *
++ * This function returns FALSE right away if -perfect is given
++ * and transformation is not perfect.  Otherwise returns TRUE.
+  */
+ 
+-GLOBAL(void)
++GLOBAL(boolean)
+ jtransform_request_workspace (j_decompress_ptr srcinfo,
+ 			      jpeg_transform_info *info)
+ {
+-  jvirt_barray_ptr *coef_arrays = NULL;
++  jvirt_barray_ptr *coef_arrays;
+   boolean need_workspace, transpose_it;
+   jpeg_component_info *compptr;
+-  JDIMENSION xoffset, yoffset, width_in_iMCUs, height_in_iMCUs;
++  JDIMENSION xoffset, yoffset;
++  JDIMENSION width_in_iMCUs, height_in_iMCUs;
+   JDIMENSION width_in_blocks, height_in_blocks;
+   int ci, h_samp_factor, v_samp_factor;
+ 
+   /* Determine number of components in output image */
+   if (info->force_grayscale &&
+       srcinfo->jpeg_color_space == JCS_YCbCr &&
+-      srcinfo->num_components == 3) {
++      srcinfo->num_components == 3)
+     /* We'll only process the first component */
+     info->num_components = 1;
+-  } else {
++  else
+     /* Process all the components */
+     info->num_components = srcinfo->num_components;
++
++  /* Compute output image dimensions and related values. */
++  jpeg_core_output_dimensions(srcinfo);
++
++  /* Return right away if -perfect is given and transformation is not perfect.
++   */
++  if (info->perfect) {
++    if (info->num_components == 1) {
++      if (!jtransform_perfect_transform(srcinfo->output_width,
++	  srcinfo->output_height,
++	  srcinfo->min_DCT_h_scaled_size,
++	  srcinfo->min_DCT_v_scaled_size,
++	  info->transform))
++	return FALSE;
++    } else {
++      if (!jtransform_perfect_transform(srcinfo->output_width,
++	  srcinfo->output_height,
++	  srcinfo->max_h_samp_factor * srcinfo->min_DCT_h_scaled_size,
++	  srcinfo->max_v_samp_factor * srcinfo->min_DCT_v_scaled_size,
++	  info->transform))
++	return FALSE;
++    }
+   }
++
+   /* If there is only one output component, force the iMCU size to be 1;
+    * else use the source iMCU size.  (This allows us to do the right thing
+    * when reducing color to grayscale, and also provides a handy way of
+    * cleaning up "funny" grayscale images whose sampling factors are not 1x1.)
+    */
+-
+   switch (info->transform) {
+   case JXFORM_TRANSPOSE:
+   case JXFORM_TRANSVERSE:
+   case JXFORM_ROT_90:
+   case JXFORM_ROT_270:
+-    info->output_width = srcinfo->image_height;
+-    info->output_height = srcinfo->image_width;
++    info->output_width = srcinfo->output_height;
++    info->output_height = srcinfo->output_width;
+     if (info->num_components == 1) {
+-      info->max_h_samp_factor = 1;
+-      info->max_v_samp_factor = 1;
++      info->iMCU_sample_width = srcinfo->min_DCT_v_scaled_size;
++      info->iMCU_sample_height = srcinfo->min_DCT_h_scaled_size;
+     } else {
+-      info->max_h_samp_factor = srcinfo->max_v_samp_factor;
+-      info->max_v_samp_factor = srcinfo->max_h_samp_factor;
++      info->iMCU_sample_width =
++	srcinfo->max_v_samp_factor * srcinfo->min_DCT_v_scaled_size;
++      info->iMCU_sample_height =
++	srcinfo->max_h_samp_factor * srcinfo->min_DCT_h_scaled_size;
+     }
+     break;
+   default:
+-    info->output_width = srcinfo->image_width;
+-    info->output_height = srcinfo->image_height;
++    info->output_width = srcinfo->output_width;
++    info->output_height = srcinfo->output_height;
+     if (info->num_components == 1) {
+-      info->max_h_samp_factor = 1;
+-      info->max_v_samp_factor = 1;
++      info->iMCU_sample_width = srcinfo->min_DCT_h_scaled_size;
++      info->iMCU_sample_height = srcinfo->min_DCT_v_scaled_size;
+     } else {
+-      info->max_h_samp_factor = srcinfo->max_h_samp_factor;
+-      info->max_v_samp_factor = srcinfo->max_v_samp_factor;
++      info->iMCU_sample_width =
++	srcinfo->max_h_samp_factor * srcinfo->min_DCT_h_scaled_size;
++      info->iMCU_sample_height =
++	srcinfo->max_v_samp_factor * srcinfo->min_DCT_v_scaled_size;
+     }
+     break;
+   }
+@@ -920,7 +967,7 @@ jtransform_request_workspace (j_decompress_ptr srcinfo,
+       info->crop_yoffset = 0;	/* default to +0 */
+     if (info->crop_xoffset >= info->output_width ||
+ 	info->crop_yoffset >= info->output_height)
+-      ERREXIT(srcinfo, "Invalid crop request"); /* was: JERR_BAD_CROP_SPEC */
++      ERREXIT(srcinfo, JERR_BAD_CROP_SPEC);
+     if (info->crop_width_set == JCROP_UNSET)
+       info->crop_width = info->output_width - info->crop_xoffset;
+     if (info->crop_height_set == JCROP_UNSET)
+@@ -930,7 +977,7 @@ jtransform_request_workspace (j_decompress_ptr srcinfo,
+ 	info->crop_height <= 0 || info->crop_height > info->output_height ||
+ 	info->crop_xoffset > info->output_width - info->crop_width ||
+ 	info->crop_yoffset > info->output_height - info->crop_height)
+-      ERREXIT(srcinfo, "Invalid crop request"); /* was: JERR_BAD_CROP_SPEC */
++      ERREXIT(srcinfo, JERR_BAD_CROP_SPEC);
+     /* Convert negative crop offsets into regular offsets */
+     if (info->crop_xoffset_set == JCROP_NEG)
+       xoffset = info->output_width - info->crop_width - info->crop_xoffset;
+@@ -941,13 +988,19 @@ jtransform_request_workspace (j_decompress_ptr srcinfo,
+     else
+       yoffset = info->crop_yoffset;
+     /* Now adjust so that upper left corner falls at an iMCU boundary */
+-    info->output_width =
+-      info->crop_width + (xoffset % (info->max_h_samp_factor * DCTSIZE));
+-    info->output_height =
+-      info->crop_height + (yoffset % (info->max_v_samp_factor * DCTSIZE));
++    if (info->crop_width_set == JCROP_FORCE)
++      info->output_width = info->crop_width;
++    else
++      info->output_width =
++        info->crop_width + (xoffset % info->iMCU_sample_width);
++    if (info->crop_height_set == JCROP_FORCE)
++      info->output_height = info->crop_height;
++    else
++      info->output_height =
++        info->crop_height + (yoffset % info->iMCU_sample_height);
+     /* Save x/y offsets measured in iMCUs */
+-    info->x_crop_offset = xoffset / (info->max_h_samp_factor * DCTSIZE);
+-    info->y_crop_offset = yoffset / (info->max_v_samp_factor * DCTSIZE);
++    info->x_crop_offset = xoffset / info->iMCU_sample_width;
++    info->y_crop_offset = yoffset / info->iMCU_sample_height;
+   } else {
+     info->x_crop_offset = 0;
+     info->y_crop_offset = 0;
+@@ -966,14 +1019,14 @@ jtransform_request_workspace (j_decompress_ptr srcinfo,
+     break;
+   case JXFORM_FLIP_H:
+     if (info->trim)
+-      trim_right_edge(info, srcinfo->image_width);
++      trim_right_edge(info, srcinfo->output_width);
+     if (info->y_crop_offset != 0)
+       need_workspace = TRUE;
+     /* do_flip_h_no_crop doesn't need a workspace array */
+     break;
+   case JXFORM_FLIP_V:
+     if (info->trim)
+-      trim_bottom_edge(info, srcinfo->image_height);
++      trim_bottom_edge(info, srcinfo->output_height);
+     /* Need workspace arrays having same dimensions as source image. */
+     need_workspace = TRUE;
+     break;
+@@ -985,8 +1038,8 @@ jtransform_request_workspace (j_decompress_ptr srcinfo,
+     break;
+   case JXFORM_TRANSVERSE:
+     if (info->trim) {
+-      trim_right_edge(info, srcinfo->image_height);
+-      trim_bottom_edge(info, srcinfo->image_width);
++      trim_right_edge(info, srcinfo->output_height);
++      trim_bottom_edge(info, srcinfo->output_width);
+     }
+     /* Need workspace arrays having transposed dimensions. */
+     need_workspace = TRUE;
+@@ -994,22 +1047,22 @@ jtransform_request_workspace (j_decompress_ptr srcinfo,
+     break;
+   case JXFORM_ROT_90:
+     if (info->trim)
+-      trim_right_edge(info, srcinfo->image_height);
++      trim_right_edge(info, srcinfo->output_height);
+     /* Need workspace arrays having transposed dimensions. */
+     need_workspace = TRUE;
+     transpose_it = TRUE;
+     break;
+   case JXFORM_ROT_180:
+     if (info->trim) {
+-      trim_right_edge(info, srcinfo->image_width);
+-      trim_bottom_edge(info, srcinfo->image_height);
++      trim_right_edge(info, srcinfo->output_width);
++      trim_bottom_edge(info, srcinfo->output_height);
+     }
+     /* Need workspace arrays having same dimensions as source image. */
+     need_workspace = TRUE;
+     break;
+   case JXFORM_ROT_270:
+     if (info->trim)
+-      trim_bottom_edge(info, srcinfo->image_width);
++      trim_bottom_edge(info, srcinfo->output_width);
+     /* Need workspace arrays having transposed dimensions. */
+     need_workspace = TRUE;
+     transpose_it = TRUE;
+@@ -1026,10 +1079,10 @@ jtransform_request_workspace (j_decompress_ptr srcinfo,
+ 		SIZEOF(jvirt_barray_ptr) * info->num_components);
+     width_in_iMCUs = (JDIMENSION)
+       jdiv_round_up((long) info->output_width,
+-		    (long) (info->max_h_samp_factor * DCTSIZE));
++		    (long) info->iMCU_sample_width);
+     height_in_iMCUs = (JDIMENSION)
+       jdiv_round_up((long) info->output_height,
+-		    (long) (info->max_v_samp_factor * DCTSIZE));
++		    (long) info->iMCU_sample_height);
+     for (ci = 0; ci < info->num_components; ci++) {
+       compptr = srcinfo->comp_info + ci;
+       if (info->num_components == 1) {
+@@ -1048,9 +1101,11 @@ jtransform_request_workspace (j_decompress_ptr srcinfo,
+ 	((j_common_ptr) srcinfo, JPOOL_IMAGE, FALSE,
+ 	 width_in_blocks, height_in_blocks, (JDIMENSION) v_samp_factor);
+     }
+-  }
++    info->workspace_coef_arrays = coef_arrays;
++  } else
++    info->workspace_coef_arrays = NULL;
+ 
+-  info->workspace_coef_arrays = coef_arrays;
++  return TRUE;
+ }
+ 
+ 
+@@ -1062,8 +1117,17 @@ transpose_critical_parameters (j_compress_ptr dstinfo)
+   int tblno, i, j, ci, itemp;
+   jpeg_component_info *compptr;
+   JQUANT_TBL *qtblptr;
++  JDIMENSION jtemp;
+   UINT16 qtemp;
+ 
++  /* Transpose image dimensions */
++  jtemp = dstinfo->image_width;
++  dstinfo->image_width = dstinfo->image_height;
++  dstinfo->image_height = jtemp;
++  itemp = dstinfo->min_DCT_h_scaled_size;
++  dstinfo->min_DCT_h_scaled_size = dstinfo->min_DCT_v_scaled_size;
++  dstinfo->min_DCT_v_scaled_size = itemp;
++
+   /* Transpose sampling factors */
+   for (ci = 0; ci < dstinfo->num_components; ci++) {
+     compptr = dstinfo->comp_info + ci;
+@@ -1296,10 +1360,10 @@ jtransform_adjust_parameters (j_decompress_ptr srcinfo,
+   }
+ 
+   /* Correct the destination's image dimensions as necessary
+-   * for crop and rotate/flip operations.
++   * for rotate/flip, resize, and crop operations.
+    */
+-  dstinfo->image_width = info->output_width;
+-  dstinfo->image_height = info->output_height;
++  dstinfo->jpeg_width = info->output_width;
++  dstinfo->jpeg_height = info->output_height;
+ 
+   /* Transpose destination image parameters */
+   switch (info->transform) {
+@@ -1326,12 +1390,12 @@ jtransform_adjust_parameters (j_decompress_ptr srcinfo,
+     /* Suppress output of JFIF marker */
+     dstinfo->write_JFIF_header = FALSE;
+     /* Adjust Exif image parameters */
+-    if (dstinfo->image_width != srcinfo->image_width ||
+-	dstinfo->image_height != srcinfo->image_height)
++    if (dstinfo->jpeg_width != srcinfo->image_width ||
++	dstinfo->jpeg_height != srcinfo->image_height)
+       /* Align data segment to start of TIFF structure for parsing */
+       adjust_exif_parameters(srcinfo->marker_list->data + 6,
+ 	srcinfo->marker_list->data_length - 6,
+-	dstinfo->image_width, dstinfo->image_height);
++	dstinfo->jpeg_width, dstinfo->jpeg_height);
+   }
+ 
+   /* Return the appropriate output data set */
+@@ -1415,8 +1479,8 @@ jtransform_execute_transform (j_decompress_ptr srcinfo,
+  * (after reading source header):
+  *   image_width = cinfo.image_width
+  *   image_height = cinfo.image_height
+- *   MCU_width = cinfo.max_h_samp_factor * DCTSIZE
+- *   MCU_height = cinfo.max_v_samp_factor * DCTSIZE
++ *   MCU_width = cinfo.max_h_samp_factor * cinfo.block_size
++ *   MCU_height = cinfo.max_v_samp_factor * cinfo.block_size
+  * Result:
+  *   TRUE = perfect transformation possible
+  *   FALSE = perfect transformation not possible
+diff --git a/codecs/transupp.h b/codecs/transupp.h
+index 981b1cee7d61235d5537289848cd54e0edbfaac2..9aa0af385a8d0a749a53606c649aa0a34fc93845 100644
+--- a/codecs/transupp.h
++++ b/codecs/transupp.h
+@@ -1,7 +1,7 @@
+ /*
+  * transupp.h
+  *
+- * Copyright (C) 1997-2001, Thomas G. Lane.
++ * Copyright (C) 1997-2011, Thomas G. Lane, Guido Vollbeding.
+  * This file is part of the Independent JPEG Group's software.
+  * For conditions of distribution and use, see the accompanying README file.
+  *
+@@ -57,10 +57,16 @@
+  * corner up and/or left to make it so, simultaneously increasing the region
+  * dimensions to keep the lower right crop corner unchanged.  (Thus, the
+  * output image covers at least the requested region, but may cover more.)
++ * The adjustment of the region dimensions may be optionally disabled.
+  *
+- * If both crop and a rotate/flip transform are requested, the crop is applied
+- * last --- that is, the crop region is specified in terms of the destination
+- * image.
++ * We also provide a lossless-resize option, which is kind of a lossless-crop
++ * operation in the DCT coefficient block domain - it discards higher-order
++ * coefficients and losslessly preserves lower-order coefficients of a
++ * sub-block.
++ *
++ * Rotate/flip transform, resize, and crop can be requested together in a
++ * single invocation.  The crop is applied last --- that is, the crop region
++ * is specified in terms of the destination image after transform/resize.
+  *
+  * We also offer a "force to grayscale" option, which simply discards the
+  * chrominance channels of a YCbCr image.  This is lossless in the sense that
+@@ -101,13 +107,15 @@ typedef enum {
+ 
+ /*
+  * Codes for crop parameters, which can individually be unspecified,
+- * positive, or negative.  (Negative width or height makes no sense, though.)
++ * positive or negative for xoffset or yoffset,
++ * positive or forced for width or height.
+  */
+ 
+ typedef enum {
+-	JCROP_UNSET,
+-	JCROP_POS,
+-	JCROP_NEG
++        JCROP_UNSET,
++        JCROP_POS,
++        JCROP_NEG,
++        JCROP_FORCE
+ } JCROP_CODE;
+ 
+ /*
+@@ -128,9 +136,9 @@ typedef struct {
+    * These can be filled in by jtransform_parse_crop_spec().
+    */
+   JDIMENSION crop_width;	/* Width of selected region */
+-  JCROP_CODE crop_width_set;
++  JCROP_CODE crop_width_set;	/* (forced disables adjustment) */
+   JDIMENSION crop_height;	/* Height of selected region */
+-  JCROP_CODE crop_height_set;
++  JCROP_CODE crop_height_set;	/* (forced disables adjustment) */
+   JDIMENSION crop_xoffset;	/* X offset of selected region */
+   JCROP_CODE crop_xoffset_set;	/* (negative measures from right edge) */
+   JDIMENSION crop_yoffset;	/* Y offset of selected region */
+@@ -143,8 +151,8 @@ typedef struct {
+   JDIMENSION output_height;
+   JDIMENSION x_crop_offset;	/* destination crop offsets measured in iMCUs */
+   JDIMENSION y_crop_offset;
+-  int max_h_samp_factor;	/* destination iMCU size */
+-  int max_v_samp_factor;
++  int iMCU_sample_width;	/* destination iMCU size */
++  int iMCU_sample_height;
+ } jpeg_transform_info;
+ 
+ 
+@@ -154,7 +162,7 @@ typedef struct {
+ EXTERN(boolean) jtransform_parse_crop_spec
+ 	JPP((jpeg_transform_info *info, const char *spec));
+ /* Request any required workspace */
+-EXTERN(void) jtransform_request_workspace
++EXTERN(boolean) jtransform_request_workspace
+ 	JPP((j_decompress_ptr srcinfo, jpeg_transform_info *info));
+ /* Adjust output image parameters */
+ EXTERN(jvirt_barray_ptr *) jtransform_adjust_parameters
diff -Nru exactimage-0.8.5/debian/patches/missing_include_vector.patch exactimage-0.8.5/debian/patches/missing_include_vector.patch
--- exactimage-0.8.5/debian/patches/missing_include_vector.patch	1970-01-01 01:00:00.000000000 +0100
+++ exactimage-0.8.5/debian/patches/missing_include_vector.patch	2012-07-01 15:55:21.000000000 +0200
@@ -0,0 +1,41 @@
+Description: Add missing includes for std::vector
+Author: Sven Eckelmann <sven@narfation.org>
+
+---
+diff --git a/codecs/pdf.hh b/codecs/pdf.hh
+index 6beec621f75e18d4438866d80c8c41a0fd382f8f..0bf3f553494c5ae0ffcd1fe7ea4b7c6dc71a1145 100644
+--- a/codecs/pdf.hh
++++ b/codecs/pdf.hh
+@@ -16,6 +16,8 @@
+  * copyright holder ExactCODE GmbH Germany.
+  */
+ 
++#include <vector>
++
+ #include "Codecs.hh"
+ 
+ struct PDFContext; // fwd
+diff --git a/codecs/xpm.cc b/codecs/xpm.cc
+index 7736e3e70e1000a181c4e018e8595ebaf42e7cfa..0bf04b2ae2980acca0a5f9feb22d14fca37f8543 100644
+--- a/codecs/xpm.cc
++++ b/codecs/xpm.cc
+@@ -19,6 +19,7 @@
+ #include <iostream>
+ #include <string>
+ #include <sstream>
++#include <vector>
+ 
+ #include "xpm.hh"
+ 
+diff --git a/lib/Colorspace.cc b/lib/Colorspace.cc
+index c5ee5b303832d9b97b23cb72d6155b77e1cc9c59..ee517092ea6d93e90df8257133fda56bc6025b98 100644
+--- a/lib/Colorspace.cc
++++ b/lib/Colorspace.cc
+@@ -19,6 +19,7 @@
+ 
+ #include <iostream>
+ #include <map>
++#include <vector>
+ 
+ #include "Image.hh"
+ #include "ImageIterator2.hh"
diff -Nru exactimage-0.8.5/debian/patches/optimize2bw_denoise.patch exactimage-0.8.5/debian/patches/optimize2bw_denoise.patch
--- exactimage-0.8.5/debian/patches/optimize2bw_denoise.patch	1970-01-01 01:00:00.000000000 +0100
+++ exactimage-0.8.5/debian/patches/optimize2bw_denoise.patch	2012-07-01 15:55:21.000000000 +0200
@@ -0,0 +1,17 @@
+Description: Fix denoise crash on 64-bit systems
+Author: René Rebe <rene@exactcode.de>
+
+---
+diff --git a/lib/Colorspace.cc b/lib/Colorspace.cc
+index ee517092ea6d93e90df8257133fda56bc6025b98..0b7e7cbefdb76503570e5761eb7e099ae7d75717 100644
+--- a/lib/Colorspace.cc
++++ b/lib/Colorspace.cc
+@@ -198,7 +198,7 @@ void colorspace_gray8_denoise_neighbours (Image &image, bool gross)
+   struct compare_and_set
+   {
+     const Image& image;
+-    const unsigned int stride;
++    const long stride;
+     compare_and_set (const Image& _image)
+       : image(_image), stride (image.stride())
+     {
diff -Nru exactimage-0.8.5/debian/patches/series exactimage-0.8.5/debian/patches/series
--- exactimage-0.8.5/debian/patches/series	2012-05-30 06:25:10.000000000 +0200
+++ exactimage-0.8.5/debian/patches/series	2012-07-01 15:55:21.000000000 +0200
@@ -6,3 +6,7 @@
 libpng15
 
 g++-4.7.patch
+missing_include_vector.patch
+edentify_tga_mismatch.patch
+libjpeg8_compat.patch
+optimize2bw_denoise.patch

Attachment: signature.asc
Description: This is a digitally signed message part.


Reply to: