adding user data to a DPX header
adding user data to a DPX header
Can ImageMagick be used to set the value for the user-defined data field in a DPX header as documented in the DPX specifications: http://www.fileformat.info/format/dpx/egff.htm?
Re: adding user data to a DPX header
See http://www.imagemagick.org/script/motion-picture.php. It explains out to set DPX values. If there is a specific field you would like to set that is not currently available, let us know and we'll add support.
Re: adding user data to a DPX header
Sorry for the long delay on a response. I'm noticing in the source code in dpx.c there is a struct that is part of the header definition:
But the corresponding struct in the DPX specifications at http://www.fileformat.info/format/dpx/e ... PX-DMYID.2 includes a field for generic user data:
I'd appreciate support for this field in the next release very much.
Code: Select all
typedef struct _DPXUserInfo
{
char
id[32];
} DPXUserInfo;
Code: Select all
typedef struct _UserDefinedData
{
char UserId[32]; /* User-defined identification string */
BYTE *Data; /* User-defined data */
} USERDEFINEDDATA;
Re: adding user data to a DPX header
Support for user data is already built-in for the API but not the command line. Look for ImageMagick 6.6.2-0 Beta tomorrow and use this command:
- convert image.dpx -set profile dpx:userdata.txt new.dpx
Re: adding user data to a DPX header
Cool thanks a lot. The user.data field is working well now, however I did come across one issue. I noticed that when I wrote certain lengths of data to the user.data field the data would be truncated when I read it back in. For example any output 8161 to 8192 characters in length would get truncated to 8160 characters. In the following block where the user data block is read in from dpx.c I noticed that the size of user data is having the size of dpx.user.id subtracted away.
This subtraction didn't seem correct to me since the size of dpx.user.id was not being added on during the write process. I removed this subtraction - as seen below - and it seems to fix the problem:
Code: Select all
if ((dpx.file.user_size != ~0U) && ((size_t) dpx.file.user_size > sizeof(dpx.user.id)))
{
StringInfo *profile;
profile = AcquireStringInfo(dpx.file.user_size - sizeof(dpx.user.id));
offset += ReadBlob(image, GetStringInfoLength(profile), GetStringInfoDatum(profile));
(void) SetImageProfile(image, "dpx", profile);
profile = DestroyStringInfo(profile);
}
Code: Select all
if (dpx.file.user_size != ~0U)
{
StringInfo *profile;
profile = AcquireStringInfo(dpx.file.user_size);
offset += ReadBlob(image, GetStringInfoLength(profile), GetStringInfoDatum(profile));
(void) SetImageProfile(image, "dpx", profile);
profile = DestroyStringInfo(profile);
}
Re: adding user data to a DPX header
Thanks for the problem report and patch. We'll get it into ImageMagick 6.6.2-1 Beta by sometime tomorrow.
Re: adding user data to a DPX header
Hi Guys
I am not able to set any value for the user.data option.
When I run the following lines. I get an empty result to retrive the value I just set.
I've tried as suggested too the -set profile and I get a complaint for a input file:
Im on Linux using:
Version: ImageMagick 6.6.9-7 2012-08-17 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP
Can someone help me to get the right syntax where I could retrieve the value from the metadata afterwards?
I need to be able to add a comment in the metadata and retrive it later.
Thank you very much for your attention
Rodrigo Guimaraes
I am not able to set any value for the user.data option.
When I run the following lines. I get an empty result to retrive the value I just set.
Code: Select all
$convert des-098-289_comp_v04.0006.dpx -define dpx:user.data="SLATE_FLAG" des-098-289_comp_v04.0006.dpx
$identify -format "%[dpx:user.data]"$ des-098-289_comp_v04.0006.dpx
$
Code: Select all
$ convert des-098-289_comp_v04.0006.dpx -set profile dpx:user.data="SLATE_FLAG" des-098-289_comp_v04.0006.dpx
convert: unable to open file `user.data=SLATE_FLAG': @ error/blob.c/FileToBlob/925.
Version: ImageMagick 6.6.9-7 2012-08-17 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2011 ImageMagick Studio LLC
Features: OpenMP
Can someone help me to get the right syntax where I could retrieve the value from the metadata afterwards?
I need to be able to add a comment in the metadata and retrive it later.
Thank you very much for your attention
Rodrigo Guimaraes
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: adding user data to a DPX header
I do not know much about DPX data, but try
-set dpx:user.data "SLATE_FLAG"
not sure about the periods and colon, though.
see
http://www.imagemagick.org/Usage/basics/#set
-set dpx:user.data "SLATE_FLAG"
not sure about the periods and colon, though.
see
http://www.imagemagick.org/Usage/basics/#set
Re: adding user data to a DPX header
Hi Fred,
Thanks for your reply.
Your command seems to do something but still, I can't get the value back.
When I run the command below, to list all properties. user.data is not even there. Seems we need to add it first?
I had a look at the link you gave me but I couldn't find anything related.
$ identify -format %[*] des-098-289_comp_v04.0002.dpx
date:create=2012-10-24T10:00:33+11:00
date:modify=2012-10-24T10:00:33+11:00
dpx:file.creator=ImageMagick 6.6.9-7 2012-08-17 Q16 http://www.imagemagick.org
dpx:file.ditto.key=1
dpx:file.timestamp=2012-10-24T10:00:33+11:
dpx:file.version=V2.0
dpx:film.frame_position=0
dpx:film.held_count=0
dpx:film.sequence_extent=0
dpx:image.orientation=0
dpx:orientation.aspect_ratio=0x0
dpx:orientation.border=0x0+0+0
dpx:orientation.x_offset=0
dpx:orientation.x_size=0
dpx:orientation.y_offset=0
dpx:orientation.y_size=0
dpx:television.time.code=00:00:00:00
dpx:television.user.bits=00:00:00:00
software=ImageMagick 6.6.9-7 2012-08-17 Q16 http://www.imagemagick.org
Cheers
Rodrigo Guimaraes
Thanks for your reply.
Your command seems to do something but still, I can't get the value back.
When I run the command below, to list all properties. user.data is not even there. Seems we need to add it first?
I had a look at the link you gave me but I couldn't find anything related.
$ identify -format %[*] des-098-289_comp_v04.0002.dpx
date:create=2012-10-24T10:00:33+11:00
date:modify=2012-10-24T10:00:33+11:00
dpx:file.creator=ImageMagick 6.6.9-7 2012-08-17 Q16 http://www.imagemagick.org
dpx:file.ditto.key=1
dpx:file.timestamp=2012-10-24T10:00:33+11:
dpx:file.version=V2.0
dpx:film.frame_position=0
dpx:film.held_count=0
dpx:film.sequence_extent=0
dpx:image.orientation=0
dpx:orientation.aspect_ratio=0x0
dpx:orientation.border=0x0+0+0
dpx:orientation.x_offset=0
dpx:orientation.x_size=0
dpx:orientation.y_offset=0
dpx:orientation.y_size=0
dpx:television.time.code=00:00:00:00
dpx:television.user.bits=00:00:00:00
software=ImageMagick 6.6.9-7 2012-08-17 Q16 http://www.imagemagick.org
Cheers
Rodrigo Guimaraes
- fmw42
- Posts: 25562
- Joined: 2007-07-02T17:14:51-07:00
- Authentication code: 1152
- Location: Sunnyvale, California, USA
Re: adding user data to a DPX header
The link and my comments were about setting the information into your file.