Page 1 of 2

dpx:television.time.code causes corruption of the heap

Posted: 2007-07-23T08:02:20-07:00
by fournij
Hi

I'm using ImageMagick-6.3.5.3-Q16-Windows-dll and the librairies Magick++ under Microsoft visual studio. When I call the function :

img.attribute("dpx:television.time.code");

The fallowing error happen :

"Windows has triggered a breakpoint in ...

This may due to a corruption of the heap, and indicates a bug in ... or any DLLs it has loaded. "


When I break it, the software debug point to free.c.


If I don't use "img.attribute("dpx:television.time.code");" no error happened

Thanks

-Jimmy

Re: dpx:television.time.code causes corruption of the heap

Posted: 2007-07-23T11:16:44-07:00
by magick
The problem you reported is fixed in ImageMagick 6.3.5-4 Beta available sometime tomorrow. A release version will be available in about a week.

Re: dpx:television.time.code causes corruption of the heap

Posted: 2007-07-30T06:35:28-07:00
by fournij
Hi

I still have the same problem with the version 6.3.5.4 downloaded this morning.

Do you want to have print screen of the error ?

Thanks

-Jimmy

Re: dpx:television.time.code causes corruption of the heap

Posted: 2007-08-01T07:38:38-07:00
by magick
We wrote a short Magick++ demo that simply reads a DPX image and outputs image.attribute("dpx:television.time.code"). We ran the application on Windows XP with ImageMagick 6.3.5-3 and it ran without complaint (no heap corruption).

Re: dpx:television.time.code causes corruption of the heap

Posted: 2007-08-20T11:00:26-07:00
by fournij
Did you use Microsoft visual studio with MFC project ?

I could send you a small project in "Microsoft visual studio 2005" if you can handle it ?

Thanks

Re: dpx:television.time.code causes corruption of the heap

Posted: 2007-08-20T12:16:21-07:00
by magick
Post a URL to your sample project. The code should be as short as possible designed simply to illustrate the memory corruption and nothing else. Be sure to include a sample image since the problem could be image specific.

Re: dpx:television.time.code causes corruption of the heap

Posted: 2010-12-21T05:47:52-07:00
by bydersjoint
Hi everyone,
I am having a similar problem where I am trying to add time.code to a dpx image sequence. Effectively I have scripted in python a time.code generator that then uses the command

Code: Select all

convert C:\DPXTimecodeTest\Promo0023.dpx -define dpx:television.time.code=00:00:01:00 C:\DPXTimecodeTest\converted\Promo0023.dpx
to add timecode to each frame in a folder.

The problem occurs in that the time.code is added perfectly however the resulting dpx images are corrupt... the file sizes drop from 8108KB to 2708KB and nothing is willing to open them except when running a:

Code: Select all

identify -format "%%[dpx:television.time.code]"
clearly the time.code is being added however the actual image data is being lost somewhere along the line. Has anyone else experienced this or found a solution?!

Chris :D

Re: dpx:television.time.code causes corruption of the heap

Posted: 2010-12-21T06:43:15-07:00
by magick
We tried your command with several of our reference DPX image file and the conversion worked properly without complaint. Post a URL to your DPX image so we can download it and reproduce the problem.

Re: dpx:television.time.code causes corruption of the heap

Posted: 2010-12-21T07:49:38-07:00
by bydersjoint
Sure, no probs

Original:

Code: Select all

www.cunnington.co.za\files\dpx\Promo0000.dpx
Corrupt:

Code: Select all

www.cunnington.co.za\files\dpx\corrupt_Promo0000.dpx
Thanks :)

Re: dpx:television.time.code causes corruption of the heap

Posted: 2010-12-21T08:14:08-07:00
by magick
We can reproduce the problem you posted. We'll need a few days to investigate.

Re: dpx:television.time.code causes corruption of the heap

Posted: 2011-01-13T08:04:46-07:00
by bydersjoint
Any luck with those investigations?!
~C

Re: dpx:television.time.code causes corruption of the heap

Posted: 2011-01-13T10:14:02-07:00
by magick
We believe we patched the problem. Download the latest ImageMagick release, version 6.6.7-0. If it fails for you, let us know.

Re: dpx:television.time.code causes corruption of the heap

Posted: 2012-11-05T07:46:53-07:00
by pamies
I am facing the same issues described above by bydersjoint with a timecode header adjustment corrupting a DPX file. This is using version 6.8.0-2_0+q16 in a Mac terminal. If I run the following I see differing results on different image types:

Code: Select all

convert TEST.dpx -define dpx:television.time.code=01:00:00:00 TEST-OUT.dpx
On an RGB file with actual colour in the image, the operation seems to work successfully.

On an RGB file with only grayscale colour (e.g. all pixels are grey, such as a countdown leader at the head of an image sequence) the timecode data in the header is edited correctly, but the image file itself seems to be adjusted to grayscale, with the filesize shrinking from 8.3 MB to 2.8 MB.

How can I make this single header definition change without the rest of the file being converted in the process?

Re: dpx:television.time.code causes corruption of the heap

Posted: 2012-11-05T09:58:31-07:00
by magick
Add -type truecolor to your command line to force a RGB image type.

Re: dpx:television.time.code causes corruption of the heap

Posted: 2012-11-05T10:10:26-07:00
by pamies
magick wrote:Add -type truecolor to your command line to force a RGB image type.
Thanks! Tried it and it seems to work exactly as expected. :-)

On a side note, is the conversion to Grayscale the default behaviour for ImageMagick (I guess it's attempting to limit file size whenever possible, and sees a grayscale image as an ideal scenario for this) or is this a bug of some kind?

Certainly I can understand the behaviour for many file-types, but in the case of DPX it would be INCREDIBLY strange to see anything but an RGB image, and multiple applications I've tried will not open a grayscale DPX generated by IM. Additionally, when processing a large image sequence (which would be very common for DPX) to have some images down-converted to grayscale (for instance a credit roller at the end of a film) while the majority of frames are kept Truecolor, would be problematic.

Is there a way for me to suggest an IM enhancement to the DPX module to, by default, preserve the type of the source file in a convert operation?