diff options
author | Matthias Clasen <matthiasc@src.gnome.org> | 2007-03-06 04:16:24 +0000 |
---|---|---|
committer | Matthias Clasen <matthiasc@src.gnome.org> | 2007-03-06 04:16:24 +0000 |
commit | 3bffda30fd5e5aa4087eab60de7cfdd6c619c8ea (patch) | |
tree | 43cc5ee1da96fd0eaedcb9e00e10958ff9fcac46 /gdk-pixbuf | |
parent | 21119b48052bbfe8356bd07d93fe2f1c6fe0aeaa (diff) | |
download | gtk+-3bffda30fd5e5aa4087eab60de7cfdd6c619c8ea.tar.gz |
Flip some more images
svn path=/trunk/; revision=17393
Diffstat (limited to 'gdk-pixbuf')
-rw-r--r-- | gdk-pixbuf/ChangeLog | 5 | ||||
-rw-r--r-- | gdk-pixbuf/io-tga.c | 14 |
2 files changed, 17 insertions, 2 deletions
diff --git a/gdk-pixbuf/ChangeLog b/gdk-pixbuf/ChangeLog index 0ece5e3ad5..7072aadeba 100644 --- a/gdk-pixbuf/ChangeLog +++ b/gdk-pixbuf/ChangeLog @@ -1,3 +1,8 @@ +2007-03-05 Matthias Clasen <mclasen@redhat.com> + + * io-tga.c: (gdk_pixbuf__tga_stop_load): Flip rle-encoded + images even if they haven't been completely loaded. (#347106) + 2007-02-27 Felix Riemann <friemann@svn.gnome.org> * io-ico.c: (fill_info): Add image/x-ico to supported mime types. diff --git a/gdk-pixbuf/io-tga.c b/gdk-pixbuf/io-tga.c index 427fac4e08..79c661c01f 100644 --- a/gdk-pixbuf/io-tga.c +++ b/gdk-pixbuf/io-tga.c @@ -504,8 +504,9 @@ static guint parse_rle_data_pseudocolor(TGAContext *ctx) } } - if (ctx->pbuf_bytes_done == ctx->pbuf_bytes) + if (ctx->pbuf_bytes_done == ctx->pbuf_bytes) ctx->done = TRUE; + return n; } @@ -657,8 +658,10 @@ static gboolean parse_rle_data(TGAContext *ctx, GError **err) * perfect, but doing it during the rle decoding in place * is considerably more work. */ - if (!(ctx->hdr->flags & TGA_ORIGIN_UPPER)) + if (!(ctx->hdr->flags & TGA_ORIGIN_UPPER)) { pixbuf_flip_vertically (ctx->pbuf); + ctx->hdr->flags |= TGA_ORIGIN_UPPER; + } } @@ -933,6 +936,13 @@ static gboolean gdk_pixbuf__tga_stop_load(gpointer data, GError **err) TGAContext *ctx = (TGAContext *) data; g_return_val_if_fail(ctx != NULL, FALSE); + if (!(ctx->hdr->flags & TGA_ORIGIN_UPPER) && ctx->run_length_encoded) { + pixbuf_flip_vertically (ctx->pbuf); + if (ctx->ufunc) + (*ctx->ufunc) (ctx->pbuf, 0, 0, + ctx->pbuf->width, ctx->pbuf->height, + ctx->udata); + } if (ctx->hdr) g_free (ctx->hdr); if (ctx->cmap) { |