bugGnash - The GNU Flash player - Bugs: bug #34625, Bogus interpretation of 15-bit RGB...

 
 

bug #34625: Bogus interpretation of 15-bit RGB bitmaps (wrong colors in Camtasia videos)

Submitted by:  Gabriele Giacone <gg0>
Submitted on:  Sun 23 Oct 2011 01:53:38 AM UTC  
 
Category: parserSeverity: 3 - Normal
Release: masterStatus: Fixed
Privacy: PublicAssigned to: Sandro Santilli <strk>
Open/Closed: Closed

Add a New Comment (Rich MarkupRich Markup):
   

You are not logged in

Please log in, so followups can be emailed to you.

 

(Jump to the original submission Jump to the original submission)

Sat 10 Mar 2012 04:06:59 PM UTC, comment #11:

Added automated testcase:
http://git.savannah.gnu.org/cgit/gnash.git/commit/?id=031ebbf

Sandro Santilli <strk>
Project MemberIn charge of this item.
Sat 10 Mar 2012 03:00:02 PM UTC, comment #10:

Test added:
http://git.savannah.gnu.org/cgit/gnash.git/commit/?id=135f254

Next stop: write a text runner

I noticed gnash still renders it slightly wrong (there's an artefact on the boundary)

Sandro Santilli <strk>
Project MemberIn charge of this item.
Thu 16 Feb 2012 04:10:30 PM UTC, comment #9:

http://www.haxer.be/guests/gnash/colorspng/hxswfml/ by Jan_Flanders

Gabriele Giacone <gg0>
Project Member
Sun 23 Oct 2011 02:49:24 PM UTC, comment #8:

Fixed by cc0432d
http://git.savannah.gnu.org/cgit/gnash.git/commit/?id=cc0432d

Still needs an automated testcase.

Sandro Santilli <strk>
Project MemberIn charge of this item.
Sun 23 Oct 2011 01:52:46 PM UTC, comment #7:

Indeed the 16bit interpretation should be 15bit instead!
I have a working patch locally, just need to increase luminosity (I guess it's the 5bit vs. 8bit which would require multiplication of the value by a factor).

In any case I'd like to have a testcase setup first.
The testcase should contain a palette of colors, including
the full red, green, blue ones and white (a few others are fine as long as they are easily computed numerically, like 128/128/0 and the like).

I'll need such bitmaps to be encoded with the LOSSLESS format 4 (aka 15bit) and used as bitmap fills for shapes.

A single bitmap with multiple colors would be fine.
A single shape will be fine too.
The shape must be rendered big enough for pixel checking to be
possible (each square or circle must allow for containing a circle with 5 pixel radius at least).

Sandro Santilli <strk>
Project MemberIn charge of this item.
Sun 23 Oct 2011 12:36:03 PM UTC, comment #6:

Another possibility is that Gnash is write about no-palette and SWFTools is wrong, but the problem relies on interpretation of the color. This is a comment in gnash, on the code interpreting the colors:

// How is the data packed??? Whoever wrote this was
// just guessing here that it's 565!

This is in libcore/swf/DefineBitsTag.cpp:531

Sandro Santilli <strk>
Project MemberIn charge of this item.
Sun 23 Oct 2011 12:33:49 PM UTC, comment #5:

I was wrong, Gnash actually does have support for palette reading, but dosn't use it for the 16-bit case.

I guess it'd be time to prepare testcases for this.
The simplest testcase would be a single SWF with
different flavors of Bitmaps encoding, with simple colors,
with palette and no palette, and an accompaining test runner
using pixel checking.

Volunteers for this task ?

Sandro Santilli <strk>
Project MemberIn charge of this item.
Sun 23 Oct 2011 12:31:50 PM UTC, comment #4:

swfextract (from swftools) is unable to extract those bitmaps:

strk@gnash:/usr/src/gnash/tests/swf8$ swfextract -j 19145 IT_110929_xPC.swf
Object 19145 is not a JPEG picture!
strk@gnash:/usr/src/gnash/tests/swf8$ swfextract -p 19145 IT_110929_xPC.swf
Can't handle 16-bit palette images yet (image 19145)

Bitmap format 4 (as reported by Ming) means 16-bit RGB according to Gnash, but 16-bit palette according to swfextract.

Gnash surely doesn't support any palette, threating the 16-bit version like the 24-bit one (RGB).

Sandro Santilli <strk>
Project MemberIn charge of this item.
Sun 23 Oct 2011 12:25:40 PM UTC, comment #3:

The SWF contains custom tags (tag id: 700) which seem to be used to advertise the version of the software used:

TechSmit h Camtasia Studio 7.1.1

The video seems to be implemented by a sequence of bitmap fills, bitmaps being LOSSLESS (format 4).

Sandro Santilli <strk>
Project MemberIn charge of this item.
Sun 23 Oct 2011 12:16:56 PM UTC, comment #2:

The video was produced with http://www.techsmith.com/camtasia/

Sandro Santilli <strk>
Project MemberIn charge of this item.
Sun 23 Oct 2011 12:04:48 PM UTC, comment #1:

from the original bug item:

> the sound come out fine but the colors are somehow "inverted".


This is an SWF8, might be using bitmap filters (but I didn't check).

Sandro Santilli <strk>
Project MemberIn charge of this item.
Sun 23 Oct 2011 01:53:38 AM UTC, original submission:

Forwarding http://bugs.debian.org/634867

Attached debug script to reproduce it.

Gabriele Giacone <gg0>
Project Member

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #24188:  gnash-debug-6.sh added by gg0 (907B - text/x-sh)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by strk (Posted a comment)
  • -unavailable- added by gg0
  • -unavailable- added by gg0 (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 11 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Sat 10 Mar 2012 04:06:59 PM UTCstrkStatusReady For Test=>Fixed
      Open/ClosedOpen=>Closed
    Sun 23 Oct 2011 02:49:24 PM UTCstrkStatusIn Progress=>Ready For Test
    Sun 23 Oct 2011 02:21:08 PM UTCstrkCategoryrenderer=>parser
      Summarywrong colors=>Bogus interpretation of 15-bit RGB bitmaps (wrong colors in Camtasia videos)
    Sun 23 Oct 2011 01:52:46 PM UTCstrkStatusConfirmed=>In Progress
      Assigned toNone=>strk
    Sun 23 Oct 2011 12:04:48 PM UTCstrkCategoryNone=>renderer
      StatusNone=>Confirmed
    Sun 23 Oct 2011 02:10:35 AM UTCgg0Carbon-Copy-=>Added -unavailable-
    Sun 23 Oct 2011 01:53:38 AM UTCgg0Attached File-=>Added gnash-debug-6.sh, #24188

    Back to the top


    Powered by Savane 3.1-cleanup