diff options
author | Pacho Ramos <pacho@gentoo.org> | 2010-07-18 18:06:08 +0000 |
---|---|---|
committer | Pacho Ramos <pacho@gentoo.org> | 2010-07-18 18:06:08 +0000 |
commit | 25ad75197a7ecbddf3ac9c44ddf1796f3b8fe3ee (patch) | |
tree | 910adf585962ef5d46e032efa1d4f58e51f71496 /media-gfx | |
parent | Remove everything except -j flags from MAKEOPTS wrt #259162 by Max Klinger. (diff) | |
download | gentoo-2-25ad75197a7ecbddf3ac9c44ddf1796f3b8fe3ee.tar.gz gentoo-2-25ad75197a7ecbddf3ac9c44ddf1796f3b8fe3ee.tar.bz2 gentoo-2-25ad75197a7ecbddf3ac9c44ddf1796f3b8fe3ee.zip |
Fix bug 309251. Remove old.
(Portage version: 2.1.8.3/cvs/Linux x86_64)
Diffstat (limited to 'media-gfx')
-rw-r--r-- | media-gfx/gthumb/ChangeLog | 10 | ||||
-rw-r--r-- | media-gfx/gthumb/files/gthumb-2.11.5-exif-rotation.patch | 143 | ||||
-rw-r--r-- | media-gfx/gthumb/files/gthumb-2.11.5-jpeg8-rotation.patch | 177 | ||||
-rw-r--r-- | media-gfx/gthumb/gthumb-2.11.5-r1.ebuild (renamed from media-gfx/gthumb/gthumb-2.11.5.ebuild) | 8 |
4 files changed, 336 insertions, 2 deletions
diff --git a/media-gfx/gthumb/ChangeLog b/media-gfx/gthumb/ChangeLog index 8f1bd3ae7099..566f7bbb4919 100644 --- a/media-gfx/gthumb/ChangeLog +++ b/media-gfx/gthumb/ChangeLog @@ -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: 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 index 000000000000..aa49ab47282b --- /dev/null +++ b/media-gfx/gthumb/files/gthumb-2.11.5-exif-rotation.patch @@ -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 index 000000000000..12a6ab52452f --- /dev/null +++ b/media-gfx/gthumb/files/gthumb-2.11.5-jpeg8-rotation.patch @@ -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 diff --git a/media-gfx/gthumb/gthumb-2.11.5.ebuild b/media-gfx/gthumb/gthumb-2.11.5-r1.ebuild index db6218593a8a..5b42d82bc096 100644 --- a/media-gfx/gthumb/gthumb-2.11.5.ebuild +++ b/media-gfx/gthumb/gthumb-2.11.5-r1.ebuild @@ -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 } |