Fix bug 309251. Remove old.
authorPacho Ramos <pacho@gentoo.org>
Sun, 18 Jul 2010 18:06:08 +0000 (18:06 +0000)
committerPacho Ramos <pacho@gentoo.org>
Sun, 18 Jul 2010 18:06:08 +0000 (18:06 +0000)
Package-Manager: portage-2.1.8.3/cvs/Linux x86_64

media-gfx/gthumb/ChangeLog
media-gfx/gthumb/Manifest
media-gfx/gthumb/files/gthumb-2.11.5-exif-rotation.patch [new file with mode: 0644]
media-gfx/gthumb/files/gthumb-2.11.5-jpeg8-rotation.patch [new file with mode: 0644]
media-gfx/gthumb/gthumb-2.11.5-r1.ebuild [moved from media-gfx/gthumb/gthumb-2.11.5.ebuild with 89% similarity]

index 8f1bd3ae7099fb0cfa0931c86934bf87539da50e..566f7bbb491953ec1d36113614d4be21fc9a7ada 100644 (file)
@@ -1,6 +1,14 @@
 # ChangeLog for media-gfx/gthumb
 # Copyright 1999-2010 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/media-gfx/gthumb/ChangeLog,v 1.114 2010/07/14 18:18:48 pacho Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-gfx/gthumb/ChangeLog,v 1.115 2010/07/18 18:06:07 pacho Exp $
+
+*gthumb-2.11.5-r1 (18 Jul 2010)
+
+  18 Jul 2010; Pacho Ramos <pacho@gentoo.org> -gthumb-2.11.5.ebuild,
+  +gthumb-2.11.5-r1.ebuild, +files/gthumb-2.11.5-exif-rotation.patch,
+  +files/gthumb-2.11.5-jpeg8-rotation.patch:
+  Revision bump applying upstream patches to fix jpeg8 rotation bug #309251.
+  Remove old.
 
   14 Jul 2010; Pacho Ramos <pacho@gentoo.org> gthumb-2.11.5.ebuild,
   +files/gthumb-2.11.5-configure-exiv2.patch:
index 9f22cff4212720c0eb52e3962ea16f9444583cc2..1eb7f1f103b5a7b5dbbbfca4d76f5ed663024124 100644 (file)
@@ -3,16 +3,18 @@ Hash: SHA1
 
 AUX gthumb-2.11.2.1-configure.patch 1030 RMD160 69f996cec1473ec0bcbe5f35822de09f1afdab2e SHA1 68151dfb026af923cf0a1f59a1c09942711a0fd3 SHA256 a146e4ea4df9763693182ee9d702fd263f5593912ba47d233b172d8adbf129c5
 AUX gthumb-2.11.5-configure-exiv2.patch 1510 RMD160 47c6af0ab917b7f9b979b533897ba3b1da22f450 SHA1 721283895e15b084b96b426c1579200c77d61481 SHA256 9a0de0322090c92f184bde1a3b3a04d411cf7a73ec9515e88e5657703fd3a189
+AUX gthumb-2.11.5-exif-rotation.patch 5297 RMD160 7561eb61b9eca34093f58c52645dc727d025657c SHA1 dea6494d8567f400f6f65244c8ca89846d7fd80b SHA256 3a8314b76913ef85b4669306767b5f6cd537170421edbd842a076270d6b49fe0
+AUX gthumb-2.11.5-jpeg8-rotation.patch 5155 RMD160 f5b60d9e3b3f3a5b96853f5f511141c1cba614e1 SHA1 e5c61c16a428a1673ff169616a77aab4cf7249ef SHA256 d60672b3cb443679aeeddddcafdfeeb90a22e520cef699d7575853e94636f918
 DIST gthumb-2.10.11.tar.bz2 2839510 RMD160 ceaef54c96cc6dbea23fe6c461d26b685b13778a SHA1 a9c133f3a652249329da8b5be8ff08dfec0ded9f SHA256 68ac6835afdbe32cba09504b4d61ad4f5d98a97776bfb58698338add56eb520e
 DIST gthumb-2.11.5.tar.bz2 4067761 RMD160 4f24f1273e2fb11dd1c7d77303bc14a15201011c SHA1 33ccc5940082ad869552a86886b5dad9c2458343 SHA256 5e5abfb9cb82eef929483b7daf57c3a50bba1949ad0563c09180704f8fa01544
 EBUILD gthumb-2.10.11.ebuild 1473 RMD160 1ee73d969206bd8eb6cce5379501b6ad4c6ce1af SHA1 029a81faecfd837fe0a4127fc4f0c8236d083459 SHA256 c2a936aa17b42d873b16efef7e0b0f9d632f3e2d377a59475bdf1ef4cfa53768
-EBUILD gthumb-2.11.5.ebuild 2094 RMD160 54718050a925f298d6707f065f87256ce3d733cf SHA1 9717e95f785204f7ffe8ebf2450247007af143e3 SHA256 c2dc10ba51a1d3e62e5313cf0e78988a68d798576cddd1cef3f83afa8c9c7ebd
-MISC ChangeLog 17178 RMD160 1d6363372469a4a38ad336e9c5fcc1dcce91deb8 SHA1 a07f7541528247a06ce0254f14ab8541ff254f83 SHA256 c53b2b1e385ef9156572edd46fceb62c2b5efee544ec98a5c6c4e1806be5081f
+EBUILD gthumb-2.11.5-r1.ebuild 2287 RMD160 445e69989ab333bcca5af763fb55c6cb3464aebd SHA1 2bbf592fb27778ace882e4ed7ec384de5c98dd58 SHA256 0e7ee56532fabf6360250b86fec818370d7b34a4bc2f047908f2ad149a5da850
+MISC ChangeLog 17487 RMD160 bdc372ce4ad65a3cd845d1ba872130743c0e7ead SHA1 bb8f258ca14bd6c7a65a98f97357de964c32779e SHA256 a51f734683525c0507f3e7788bee2f2ec0141a349ba3bf27d595a5ef9f9f951d
 MISC metadata.xml 380 RMD160 1db419c6ace42704ec134285fae7a01851af9780 SHA1 a159db2e96a5d77bad064cf61757863076bc598a SHA256 2e10ecfe504ae1d22a813720041534aadf04f25e3f6e18d3027910465b8ba4d8
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2.0.15 (GNU/Linux)
 
-iEYEARECAAYFAkw9/5EACgkQCaWpQKGI+9QiPACfayH69q4XSDOcMWqVqXJyeyIo
-ekMAn19O9uXZ1TkzSD660aRqhQMrU9P3
-=zl63
+iEYEARECAAYFAkxDQpUACgkQCaWpQKGI+9QQ0ACfbNp9iPC4EYuxkEDNA7NSkOmf
+V+oAnj59WpRkXvXCWkHcOX0AdIJpucs8
+=R9uj
 -----END PGP SIGNATURE-----
diff --git a/media-gfx/gthumb/files/gthumb-2.11.5-exif-rotation.patch b/media-gfx/gthumb/files/gthumb-2.11.5-exif-rotation.patch
new file mode 100644 (file)
index 0000000..aa49ab4
--- /dev/null
@@ -0,0 +1,143 @@
+From c200cbf310109cba991bafa38d521c7a1af31360 Mon Sep 17 00:00:00 2001
+From: Paolo Bacchilega <paobac@src.gnome.org>
+Date: Fri, 16 Jul 2010 13:52:54 +0000
+Subject: preserve the exif data after a lossless rotation
+
+read the exif data from the input buffer to make sure that they are
+read correctly, instead of reading them from the output buffer after
+the transformation.
+---
+diff --git a/extensions/exiv2_tools/main.c b/extensions/exiv2_tools/main.c
+index a8dcf74..87dd411 100644
+--- a/extensions/exiv2_tools/main.c
++++ b/extensions/exiv2_tools/main.c
+@@ -24,6 +24,7 @@
+ #include <config.h>
+ #include <gtk/gtk.h>
+ #include <gthumb.h>
++#include <extensions/jpeg_utils/jpegtran.h>
+ #include "gth-edit-exiv2-page.h"
+ #include "gth-metadata-provider-exiv2.h"
+ #include "exiv2-utils.h"
+@@ -167,21 +168,19 @@ update_exif_dimensions (GFileInfo    *info,
+ static void
+-exiv2_jpeg_tran_cb (void         **out_buffer,
+-                  gsize         *out_buffer_size,
+-                  GthTransform  *transform)
++exiv2_jpeg_tran_cb (JpegTranInfo *tran_info)
+ {
+       GFileInfo *info;
+       info = g_file_info_new ();
+-      if (exiv2_read_metadata_from_buffer (*out_buffer, *out_buffer_size, info, NULL)) {
++      if (exiv2_read_metadata_from_buffer (tran_info->in_buffer, tran_info->in_buffer_size, info, NULL)) {
+               GthMetadata *metadata;
+-              update_exif_dimensions (info, *transform);
++              update_exif_dimensions (info, tran_info->transformation);
+               metadata = g_object_new (GTH_TYPE_METADATA, "raw", "1", NULL);
+               g_file_info_set_attribute_object (info, "Exif::Image::Orientation", G_OBJECT (metadata));
+-              exiv2_write_metadata_to_buffer (out_buffer, out_buffer_size, info, NULL, NULL);
++              exiv2_write_metadata_to_buffer (tran_info->out_buffer, tran_info->out_buffer_size, info, NULL, NULL);
+               g_object_unref (metadata);
+       }
+diff --git a/extensions/image_rotation/main.c b/extensions/image_rotation/main.c
+index 321ce7e..6a1195c 100644
+--- a/extensions/image_rotation/main.c
++++ b/extensions/image_rotation/main.c
+@@ -33,11 +33,10 @@ gthumb_extension_activate (void)
+       /**
+        * Called after successfully rotating a jpeg image
+        *
+-       * @out_buffer (void **): pointer to file data
+-       * @out_buffer_size (gsize *): pointer to file data size
+-       * @tranform (GthTransform *): the transformation applied to the file
++       * @info (JpegTranInfo *): the transformation info as described in
++       * extensions/jpeg_utils/jpegtran.h
+        **/
+-      gth_hook_register ("jpegtran-after", 3);
++      gth_hook_register ("jpegtran-after", 1);
+       gth_hook_add_callback ("gth-browser-construct", 10, G_CALLBACK (ir__gth_browser_construct_cb), NULL);
+       gth_hook_add_callback ("gth-browser-update-sensitivity", 10, G_CALLBACK (ir__gth_browser_update_sensitivity_cb), NULL);
+diff --git a/extensions/jpeg_utils/jpegtran.c b/extensions/jpeg_utils/jpegtran.c
+index 1aa302d..5484983 100644
+--- a/extensions/jpeg_utils/jpegtran.c
++++ b/extensions/jpeg_utils/jpegtran.c
+@@ -222,7 +222,6 @@ jpegtran_internal (struct jpeg_decompress_struct  *srcinfo,
+       /* Initialize destination compression parameters from source values */
+       jpeg_copy_critical_parameters (srcinfo, dstinfo);
+-
+       /* Do not output a JFIF marker for EXIF thumbnails.
+        * This is not the optimal way to detect the difference
+        * between a thumbnail and a normal image, but it works
+@@ -230,13 +229,6 @@ jpegtran_internal (struct jpeg_decompress_struct  *srcinfo,
+       if (option == JCOPYOPT_NONE)
+               dstinfo->write_JFIF_header = FALSE;
+-#if JPEG_LIB_VERSION < 80
+-      /* Adjust the markers to create a standard EXIF file if an EXIF marker
+-       * is present in the input. By default, libjpeg creates a JFIF file,
+-       * which is incompatible with the EXIF standard. */
+-      jcopy_markers_exif (srcinfo, dstinfo, option);
+-#endif
+-
+       /* Adjust destination parameters if required by transform options;
+        * also find out which set of coefficient arrays will hold the output.
+        */
+@@ -336,7 +328,14 @@ jpegtran (void           *in_buffer,
+       jpeg_destroy_decompress (&srcinfo);
+       if (success) {
+-              gth_hook_invoke ("jpegtran-after", out_buffer, out_buffer_size, &transformation);
++              JpegTranInfo info;
++
++              info.in_buffer = in_buffer;
++              info.in_buffer_size = in_buffer_size;
++              info.out_buffer = out_buffer;
++              info.out_buffer_size = out_buffer_size;
++              info.transformation = transformation;
++              gth_hook_invoke ("jpegtran-after", &info);
+       }
+       else {
+               g_free (*out_buffer);
+diff --git a/extensions/jpeg_utils/jpegtran.h b/extensions/jpeg_utils/jpegtran.h
+index 6c26139..80bafbe 100644
+--- a/extensions/jpeg_utils/jpegtran.h
++++ b/extensions/jpeg_utils/jpegtran.h
+@@ -46,6 +46,15 @@ typedef enum {
+ } JpegMcuAction;
++typedef struct {
++      void          *in_buffer;
++      gsize          in_buffer_size;
++      void         **out_buffer;
++      gsize         *out_buffer_size;
++      GthTransform   transformation;
++} JpegTranInfo;
++
++
+ gboolean   jpegtran  (void           *in_buffer,
+                     gsize           in_buffer_size,
+                     void          **out_buffer,
+diff --git a/extensions/jpeg_utils/transupp.h b/extensions/jpeg_utils/transupp.h
+index 104fa2e..5f0f69b 100644
+--- a/extensions/jpeg_utils/transupp.h
++++ b/extensions/jpeg_utils/transupp.h
+@@ -20,6 +20,8 @@
+  *  Foundation, Inc., 59 Temple Street #330, Boston, MA 02111-1307, USA.
+  */
++#include <config.h>
++
+ #ifdef HAVE_LIBJPEG
+ #include <jpeglib.h>
+--
+cgit v0.8.3.1
diff --git a/media-gfx/gthumb/files/gthumb-2.11.5-jpeg8-rotation.patch b/media-gfx/gthumb/files/gthumb-2.11.5-jpeg8-rotation.patch
new file mode 100644 (file)
index 0000000..12a6ab5
--- /dev/null
@@ -0,0 +1,177 @@
+From 607d43534519c2fcb7ad079b634d47e4ba22376e Mon Sep 17 00:00:00 2001
+From: Paolo Bacchilega <paobac@src.gnome.org>
+Date: Fri, 16 Jul 2010 13:49:43 +0000
+Subject: fixed lossless rotation with libjpeg8
+
+Simplified the jpeg memory source implementation. Copied the
+from the libjpeg8 source. This fixes a bug with the
+skip_input_data function implementation as well.
+
+[bug #612809]
+---
+diff --git a/extensions/jpeg_utils/jmemorysrc.c b/extensions/jpeg_utils/jmemorysrc.c
+index f6dc7a8..b8c2ca6 100644
+--- a/extensions/jpeg_utils/jmemorysrc.c
++++ b/extensions/jpeg_utils/jmemorysrc.c
+@@ -29,73 +29,62 @@
+ #include <gio/gio.h>
+-#define TMP_BUF_SIZE  4096
+ #define JPEG_ERROR(cinfo,code)  \
+   ((cinfo)->err->msg_code = (code), \
+    (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo)))
+-typedef struct {
+-      struct jpeg_source_mgr pub;
+-
+-      JOCTET  *in_buffer;
+-      gsize    in_buffer_size;
+-      goffset  bytes_read;
+-      JOCTET  *tmp_buffer;
+-} mem_source_mgr;
+-
+-typedef mem_source_mgr * mem_src_ptr;
+-
+-
+ static void
+ init_source (j_decompress_ptr cinfo)
+ {
+-      mem_src_ptr src = (mem_src_ptr) cinfo->src;
+-      src->bytes_read = 0;
++      /* void */
+ }
+ static gboolean
+ fill_input_buffer (j_decompress_ptr cinfo)
+ {
+-      mem_src_ptr src = (mem_src_ptr) cinfo->src;
+-      size_t      nbytes;
+-
+-      if (src->bytes_read + TMP_BUF_SIZE > src->in_buffer_size)
+-              nbytes = src->in_buffer_size - src->bytes_read;
+-      else
+-              nbytes = TMP_BUF_SIZE;
+-
+-      if (nbytes <= 0) {
+-              if (src->bytes_read == 0)
+-                      JPEG_ERROR (cinfo, G_IO_ERROR_NOT_FOUND);
+-
+-              /* Insert a fake EOI marker */
+-              src->tmp_buffer[0] = (JOCTET) 0xFF;
+-              src->tmp_buffer[1] = (JOCTET) JPEG_EOI;
+-              nbytes = 2;
+-      }
+-      else
+-              memcpy (src->tmp_buffer, src->in_buffer + src->bytes_read, nbytes);
++      static JOCTET mybuffer[4];
++
++      /* The whole JPEG data is expected to reside in the supplied memory
++       * buffer, so any request for more data beyond the given buffer size
++       * is treated as an error.
++       */
++
++      JPEG_ERROR (cinfo, G_IO_ERROR_NOT_FOUND);
+-      src->pub.next_input_byte = src->tmp_buffer;
+-      src->pub.bytes_in_buffer = nbytes;
+-      src->bytes_read += nbytes;
++      /* Insert a fake EOI marker */
++      mybuffer[0] = (JOCTET) 0xFF;
++      mybuffer[1] = (JOCTET) JPEG_EOI;
++
++      cinfo->src->next_input_byte = mybuffer;
++      cinfo->src->bytes_in_buffer = 2;
+       return TRUE;
+ }
+-static void
++void
+ skip_input_data (j_decompress_ptr cinfo,
+                long             num_bytes)
+ {
+-      mem_src_ptr src = (mem_src_ptr) cinfo->src;
+-
+-      src->bytes_read += num_bytes;
+-      if (src->bytes_read < 0)
+-              src->bytes_read = 0;
+-      fill_input_buffer (cinfo);
++      struct jpeg_source_mgr * src = cinfo->src;
++
++      /* Just a dumb implementation for now.  Could use fseek() except
++       * it doesn't work on pipes.  Not clear that being smart is worth
++       * any trouble anyway --- large skips are infrequent.
++       */
++      if (num_bytes > 0) {
++              while (num_bytes > (long) src->bytes_in_buffer) {
++                      num_bytes -= (long) src->bytes_in_buffer;
++                      (void) fill_input_buffer (cinfo);
++                      /* note we assume that fill_input_buffer will never return FALSE,
++                       * so suspension need not be handled.
++                       */
++              }
++              src->next_input_byte += (size_t) num_bytes;
++              src->bytes_in_buffer -= (size_t) num_bytes;
++      }
+ }
+@@ -111,28 +100,21 @@ _jpeg_memory_src (j_decompress_ptr  cinfo,
+                 void             *in_buffer,
+                 gsize             in_buffer_size)
+ {
+-      mem_src_ptr src;
++      struct jpeg_source_mgr *src;
+       if (cinfo->src == NULL) {
+               cinfo->src = (struct jpeg_source_mgr *)
+                       (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo,
+                                                   JPOOL_PERMANENT,
+-                                                  sizeof (mem_source_mgr));
+-              src = (mem_src_ptr) cinfo->src;
+-              src->tmp_buffer = (JOCTET *)
+-                      (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo,
+-                                                  JPOOL_PERMANENT,
+-                                                  TMP_BUF_SIZE * sizeof(JOCTET));
++                                                  sizeof (struct jpeg_source_mgr));
+       }
+-      src = (mem_src_ptr) cinfo->src;
+-      src->pub.init_source = init_source;
+-      src->pub.fill_input_buffer = fill_input_buffer;
+-      src->pub.skip_input_data = skip_input_data;
+-      src->pub.resync_to_restart = jpeg_resync_to_restart;
+-      src->pub.term_source = term_source;
+-      src->in_buffer = (JOCTET *) in_buffer;
+-      src->in_buffer_size = in_buffer_size;
+-      src->pub.bytes_in_buffer = 0;
+-      src->pub.next_input_byte = NULL;
++      src = cinfo->src;
++      src->init_source = init_source;
++      src->fill_input_buffer = fill_input_buffer;
++      src->skip_input_data = skip_input_data;
++      src->resync_to_restart = jpeg_resync_to_restart;
++      src->term_source = term_source;
++      src->bytes_in_buffer = (size_t) in_buffer_size;
++      src->next_input_byte = (JOCTET *) in_buffer;
+ }
+diff --git a/extensions/jpeg_utils/jpegtran.c b/extensions/jpeg_utils/jpegtran.c
+index 8a1721b..1aa302d 100644
+--- a/extensions/jpeg_utils/jpegtran.c
++++ b/extensions/jpeg_utils/jpegtran.c
+@@ -188,6 +188,9 @@ jpegtran_internal (struct jpeg_decompress_struct  *srcinfo,
+       transformoption.transform = transform;
+       transformoption.trim = (mcu_action == JPEG_MCU_ACTION_TRIM);
+       transformoption.force_grayscale = FALSE;
++#if JPEG_LIB_VERSION >= 80
++      transformoption.crop = 0;
++#endif
+       /* Enable saving of extra markers that we want to copy */
+       jcopy_markers_setup (srcinfo, option);
+--
+cgit v0.8.3.1
similarity index 89%
rename from media-gfx/gthumb/gthumb-2.11.5.ebuild
rename to media-gfx/gthumb/gthumb-2.11.5-r1.ebuild
index db6218593a8a9f6c27a44ac4814223bf9691598e..5b42d82bc0964caf4093dac5c95f02438960996b 100644 (file)
@@ -1,6 +1,6 @@
 # Copyright 1999-2010 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/media-gfx/gthumb/gthumb-2.11.5.ebuild,v 1.2 2010/07/14 18:18:48 pacho Exp $
+# $Header: /var/cvsroot/gentoo-x86/media-gfx/gthumb/gthumb-2.11.5-r1.ebuild,v 1.1 2010/07/18 18:06:07 pacho Exp $
 
 EAPI="3"
 
@@ -69,6 +69,12 @@ src_prepare() {
        # Do not link to the exiv2 extension if it's not built
        epatch "${FILESDIR}/${P}-configure-exiv2.patch"
 
+       # Fixed lossless rotation with libjpeg8
+       epatch "${FILESDIR}/${P}-jpeg8-rotation.patch"
+
+       # Preserve the exif data after a lossless rotation
+       epatch "${FILESDIR}/${P}-exif-rotation.patch"
+
        intltoolize --force --copy --automake || die "intltoolize failed"
        eautoreconf
 }