From 733e71a5b17e35c127b2506b6827fdf98fac8c86 Mon Sep 17 00:00:00 2001 From: Hayaki Saito Date: Tue, 7 Oct 2014 22:26:36 +0900 Subject: [PATCH 1/3] Fix for animation GIF quality degradation --- converters/img2sixel.c | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/converters/img2sixel.c b/converters/img2sixel.c index 0232b70f..8411e1cc 100644 --- a/converters/img2sixel.c +++ b/converters/img2sixel.c @@ -413,16 +413,15 @@ convert_to_sixel(char const *filename, settings_t *psettings) } frames = malloc(sizeof(unsigned char *) * frame_count); - if (frames == NULL) { nret = -1; goto end; } - frame = pixels; + p = pixels; for (n = 0; n < frame_count; ++n) { - frames[n] = frame; - frame += sx * sy * 3; + frames[n] = p; + p += sx * sy * 3; } if (psettings->clipfirst) { @@ -506,6 +505,7 @@ convert_to_sixel(char const *filename, settings_t *psettings) nret = sixel_encode(frames[n], sx, sy, 3, dither, context); if (nret != 0) { + free(p); goto end; } @@ -587,6 +587,11 @@ convert_to_sixel(char const *filename, settings_t *psettings) /* create output context */ context = sixel_output_create(sixel_write_callback, stdout); sixel_output_set_8bit_availability(context, psettings->f8bit); + p = malloc(sx * sy * 3); + if (nret != 0) { + goto end; + } + for (c = 0; c != loop_count; ++c) { for (n = 0; n < frame_count; ++n) { if (frame_count > 1) { @@ -614,7 +619,8 @@ convert_to_sixel(char const *filename, settings_t *psettings) #endif } - nret = sixel_encode(frames[n], sx, sy, 3, dither, context); + memcpy(p, frames[n], sx * sy * 3); + nret = sixel_encode(p, sx, sy, 3, dither, context); if (nret != 0) { goto end; } @@ -653,6 +659,7 @@ convert_to_sixel(char const *filename, settings_t *psettings) free(pixels); free(delays); free(mappixels); + free(p); return nret; } From e6b3f40229ab3e31336744ea3515c55ab11e178e Mon Sep 17 00:00:00 2001 From: Hayaki Saito Date: Tue, 7 Oct 2014 22:28:32 +0900 Subject: [PATCH 2/3] Bump version --- configure | 20 ++++++++++---------- configure.ac | 2 +- package.json | 2 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/configure b/configure index cb082e08..dad679e4 100755 --- a/configure +++ b/configure @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.69 for sixel 1.1.4. +# Generated by GNU Autoconf 2.69 for sixel 1.1.5. # # Report bugs to . # @@ -589,8 +589,8 @@ MAKEFLAGS= # Identity of this package. PACKAGE_NAME='sixel' PACKAGE_TARNAME='sixel' -PACKAGE_VERSION='1.1.4' -PACKAGE_STRING='sixel 1.1.4' +PACKAGE_VERSION='1.1.5' +PACKAGE_STRING='sixel 1.1.5' PACKAGE_BUGREPORT='user@zuse.jp' PACKAGE_URL='' @@ -1350,7 +1350,7 @@ if test "$ac_init_help" = "long"; then # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures sixel 1.1.4 to adapt to many kinds of systems. +\`configure' configures sixel 1.1.5 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1420,7 +1420,7 @@ fi if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of sixel 1.1.4:";; + short | recursive ) echo "Configuration of sixel 1.1.5:";; esac cat <<\_ACEOF @@ -1551,7 +1551,7 @@ fi test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -sixel configure 1.1.4 +sixel configure 1.1.5 generated by GNU Autoconf 2.69 Copyright (C) 2012 Free Software Foundation, Inc. @@ -1966,7 +1966,7 @@ cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by sixel $as_me 1.1.4, which was +It was created by sixel $as_me 1.1.5, which was generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2909,7 +2909,7 @@ fi # Define the identity of the package. PACKAGE='sixel' - VERSION='1.1.4' + VERSION='1.1.5' cat >>confdefs.h <<_ACEOF @@ -14509,7 +14509,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by sixel $as_me 1.1.4, which was +This file was extended by sixel $as_me 1.1.5, which was generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -14575,7 +14575,7 @@ _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ -sixel config.status 1.1.4 +sixel config.status 1.1.5 configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" diff --git a/configure.ac b/configure.ac index 3e393d8a..a2fbe6e5 100644 --- a/configure.ac +++ b/configure.ac @@ -3,7 +3,7 @@ AC_PREREQ([2.60]) LT_PREREQ([2.4]) -AC_INIT([sixel], [1.1.4], [user@zuse.jp]) +AC_INIT([sixel], [1.1.5], [user@zuse.jp]) LS_LT_CURRENT=1 LS_LT_REVISION=0 LS_LT_AGE=1 diff --git a/package.json b/package.json index b4acf576..0e238f64 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "libsixel", - "version": "1.1.4", + "version": "1.1.5", "repo": "saitoha/libsixel", "description": "A lightweight, fast implementation of DEC SIXEL graphics codec", "keywords": ["terminal", "graphics", "image", "sixel"], From 476722121e1323caa1bc161e18d14a7c1ed8163d Mon Sep 17 00:00:00 2001 From: Hayaki Saito Date: Tue, 7 Oct 2014 22:29:00 +0900 Subject: [PATCH 3/3] Update ChangeLog --- ChangeLog | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/ChangeLog b/ChangeLog index d3c56ee2..925703c6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2014-10-07 Hayaki Saito + + * converters/img2sixel.c: Fix for animation GIF quality degradation + +2014-10-06 Hayaki Saito + + * LICENSE.sixel, README.md: Add a mention about the License of kmiya's sixel + 2014-10-05 Hayaki Saito * converters/stb_image.h: Skip an unknown code(0x3c) at GIF decoder