Re: dpx file length assertion

Bob Friesenhahn <[email protected]> Wed, 1 Feb 2006 13:22:29 -0600 (CST)
Newsgroups gmane.comp.video.graphicsmagick.bugs
Message-ID <[email protected]>
On Wed, 1 Feb 2006, darby johnston wrote:

> Running this command:
>
>> gm convert
> ~/pics/gm_dpx/flowers-1920x1080-LinearLuma-10.dpx
> -resize 1919x1080 tmp.dpx
>
> Prints this:
>
> ### File length 2768896, TellBlob says 2770332
>
> Looks like some sort of assertion in the code. The
> resulting image looks ok though.

Thanks for the report.  There is an issue with 10-bit gray DPX files 
when the width is not evenly divisible by three.  The problem is that 
the DPX specification implies that a row could then be split across 
one 32-bit storage word because one 32-bit word may contain three luma 
samples and one or two of them may belong to the next row.  Currently 
GM cheats and pads the row out to the next 32-bit word.  I do plan to 
continue working on this issue.  A simple work-around is for it to 
parse three rows at a time rather than one.

You will find that most applications which handle DPX do not handle 
gray/luma files well at all.  It does not help that luma files from 
Thompson's Sprit (one of the only sources) seem to be technically 
incorrect.  So even though it is much more space efficient, 
single-channel luma files are rarely used by the industry.

In the mean time, if you do chose to use this format, you are well 
advised to make sure that the width is evenly divisible by three.

Likewise, for 16-bit DPX, for best compatibility, it is advisable that 
the width be evenly divisible by 2, and for 8-bit DPX, the width is 
best evenly divisible by 4.

Bob
======================================
Bob Friesenhahn
[email protected], http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642