google-code-export / thebigpicture

Automatically exported from code.google.com/p/thebigpicture
1 stars 1 forks source link

It should be possible to set unknown tags #28

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently, each metainfo record checks whether a tag number is known when a
user wants to set it. However, almost per definition it is not possible to
know of each tag, so therefore it should be possible to override this
check. When loading metadata from a file, the check should always be
overridden.

On a higher interface level, the check can only be overridden if it is
specified to which record the tag belongs.

Original issue reported on code.google.com by p.edel...@gmail.com on 1 Apr 2007 at 7:39

GoogleCodeExporter commented 9 years ago
This adds some complication, because data type and count are unknown too -> 
alpha2

Original comment by p.edel...@gmail.com on 1 Apr 2007 at 7:56

GoogleCodeExporter commented 9 years ago
See also issue 8

Original comment by p.edel...@gmail.com on 1 Apr 2007 at 8:22

GoogleCodeExporter commented 9 years ago
See also issue 8

Original comment by p.edel...@gmail.com on 1 Apr 2007 at 8:52

GoogleCodeExporter commented 9 years ago

Original comment by p.edel...@gmail.com on 1 Apr 2007 at 10:29

GoogleCodeExporter commented 9 years ago
The question is whether we should set and retrieve binary data directly, or to 
set
payload, data type and count and encode it, or both.

It is at least necessary to set the binary data, because then we can load 
unknown
tags from an actual file. The image loaders should always suppress checking for 
tags
in this case.

It should be noted that in the case of IFD, it is always possible to decode it,
because the data type is stored in the IFD. This is not the case for IPTC.

Original comment by p.edel...@gmail.com on 2 Apr 2007 at 4:55

GoogleCodeExporter commented 9 years ago
This is fixed in revision 36.
All the getTag and setTag methods (from MetaInfoBlock up to IFD and IPTC) now 
accept
a variety of parameters. If the user wants to set an unspecified tag, the check
parameter needs to be set to False in setTag methods
- payload; encodes the data.
- payload, data_type (count); encodes the data with the specified data type.
- data; sets the binary data directly

For different situations, different things are needed.
- If tag is known; tag name/number, payload/data
- If tag is unknown; tag number, record name/number (if above record level), 
data
type, check = False

There are some differences between IPTC and Exif uin handling unknown tags. 
Setting
an Exif tag always needs a data type, even if binary data is specified. This is 
not
the case for IPTC. On the other hand, IPTC always needs a data type when 
decoding an
unknown tag, which is not the case for Exif.

Original comment by p.edel...@gmail.com on 2 Apr 2007 at 8:57