[haiku-commits] haiku: hrev47507 - src/add-ons/translators/gif

  • From: jscipione@xxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 16 Jul 2014 21:21:35 +0200 (CEST)

hrev47507 adds 2 changesets to branch 'master'
old head: 92dd9f7360a9f664088b00c2bc0f34527b798730
new head: 5fa8801f3640853e279e91ee6edf1c927824113e
overview: http://cgit.haiku-os.org/haiku/log/?qt=range&q=5fa8801+%5E92dd9f7

----------------------------------------------------------------------------

66246a7: GIF Translator: tiny style fix

5fa8801: GIF Translator: Update default settings
  
  * Palette is set to Optimal which preserves colors of original
  * Write transparent gifs is on which preserves transparency
  * Transparent auto is on which automatically detects the transparent color
  * default transparent color is 255, 255, 255 (aka white) if you select a
    manual transparent color which seems like a more sane default than black.
  
  This allows ShowImage and other programs to save transparent gifs without
  removing transparency and without reducing the colors.

                                     [ John Scipione <jscipione@xxxxxxxxx> ]

----------------------------------------------------------------------------

2 files changed, 7 insertions(+), 7 deletions(-)
src/add-ons/translators/gif/GIFLoad.cpp       |  2 +-
src/add-ons/translators/gif/GIFTranslator.cpp | 12 ++++++------

############################################################################

Commit:      66246a75a1303e05f43186148cac9ae76db4eb51
URL:         http://cgit.haiku-os.org/haiku/commit/?id=66246a7
Author:      John Scipione <jscipione@xxxxxxxxx>
Date:        Wed Jul 16 01:19:41 2014 UTC

GIF Translator: tiny style fix

----------------------------------------------------------------------------

diff --git a/src/add-ons/translators/gif/GIFLoad.cpp 
b/src/add-ons/translators/gif/GIFLoad.cpp
index 5f061d8..3196e5f 100644
--- a/src/add-ons/translators/gif/GIFLoad.cpp
+++ b/src/add-ons/translators/gif/GIFLoad.cpp
@@ -205,7 +205,7 @@ GIFLoad::ReadGIFControlBlock()
        if (fInput->Read(data, 6) < 6)
                return false;
 
-       if (data[1] & 0x01) {
+       if ((data[1] & 0x01) != 0) {
                fPalette->usetransparent = true;
                fPalette->transparentindex = data[4];
                if (debug) {

############################################################################

Revision:    hrev47507
Commit:      5fa8801f3640853e279e91ee6edf1c927824113e
URL:         http://cgit.haiku-os.org/haiku/commit/?id=5fa8801
Author:      John Scipione <jscipione@xxxxxxxxx>
Date:        Wed Jul 16 01:22:36 2014 UTC

GIF Translator: Update default settings

* Palette is set to Optimal which preserves colors of original
* Write transparent gifs is on which preserves transparency
* Transparent auto is on which automatically detects the transparent color
* default transparent color is 255, 255, 255 (aka white) if you select a
  manual transparent color which seems like a more sane default than black.

This allows ShowImage and other programs to save transparent gifs without
removing transparency and without reducing the colors.

----------------------------------------------------------------------------

diff --git a/src/add-ons/translators/gif/GIFTranslator.cpp 
b/src/add-ons/translators/gif/GIFTranslator.cpp
index c8bab7b..98b4b95 100644
--- a/src/add-ons/translators/gif/GIFTranslator.cpp
+++ b/src/add-ons/translators/gif/GIFTranslator.cpp
@@ -96,14 +96,14 @@ static const TranSetting sDefaultSettings[] = {
        { B_TRANSLATOR_EXT_HEADER_ONLY, TRAN_SETTING_BOOL, false },
        { B_TRANSLATOR_EXT_DATA_ONLY, TRAN_SETTING_BOOL, false },
        { GIF_SETTING_INTERLACED, TRAN_SETTING_BOOL, false },
-       { GIF_SETTING_USE_TRANSPARENT, TRAN_SETTING_BOOL, false },
-       { GIF_SETTING_USE_TRANSPARENT_AUTO, TRAN_SETTING_BOOL, false },
+       { GIF_SETTING_USE_TRANSPARENT, TRAN_SETTING_BOOL, true },
+       { GIF_SETTING_USE_TRANSPARENT_AUTO, TRAN_SETTING_BOOL, true },
        { GIF_SETTING_USE_DITHERING, TRAN_SETTING_BOOL, false },
-       { GIF_SETTING_PALETTE_MODE, TRAN_SETTING_INT32, 0 },
+       { GIF_SETTING_PALETTE_MODE, TRAN_SETTING_INT32, 3 },
        { GIF_SETTING_PALETTE_SIZE, TRAN_SETTING_INT32, 8 },
-       { GIF_SETTING_TRANSPARENT_RED, TRAN_SETTING_INT32, 0 },
-       { GIF_SETTING_TRANSPARENT_GREEN, TRAN_SETTING_INT32, 0 },
-       { GIF_SETTING_TRANSPARENT_BLUE, TRAN_SETTING_INT32, 0 }
+       { GIF_SETTING_TRANSPARENT_RED, TRAN_SETTING_INT32, 255 },
+       { GIF_SETTING_TRANSPARENT_GREEN, TRAN_SETTING_INT32, 255 },
+       { GIF_SETTING_TRANSPARENT_BLUE, TRAN_SETTING_INT32, 255 }
 };
 
 const uint32 kNumInputFormats = sizeof(sInputFormats)


Other related posts:

  • » [haiku-commits] haiku: hrev47507 - src/add-ons/translators/gif - jscipione