Quantcast
Channel: Adobe Community: Message List - XMP SDK
Viewing all 801 articles
Browse latest View live

SetProperty_Float(kXMP_NS_EXIF, "***", ***, 0) wrong behavior

$
0
0

I tested this  on the XMP original samples and had some issue

  • Here I just read the data, modify it and then again read it

double xxx;
meta.GetProperty_Float(kXMP_NS_EXIF, "BrightnessValue", &xxx, 0);
cout << xxx << endl;
meta.SetProperty_Float(kXMP_NS_EXIF, "BrightnessValue", 1, 0);
meta.GetProperty_Float(kXMP_NS_EXIF, "BrightnessValue", &xxx, 0);
cout << xxx << endl;

 

First time it works fine, but when running second time his fails on the first get function with the following error : ERROR: Invalid float string

 

  • Setting the property second time before actually getting it, fixes the issue

double xxx;

meta.SetProperty_Float(kXMP_NS_EXIF, "BrightnessValue", 0.8, 0);
meta.GetProperty_Float(kXMP_NS_EXIF, "BrightnessValue", &xxx, 0);
cout << xxx << endl;
meta.SetProperty_Float(kXMP_NS_EXIF, "BrightnessValue", 1, 0);
meta.GetProperty_Float(kXMP_NS_EXIF, "BrightnessValue", &xxx, 0);
cout << xxx << endl;

 

       Thought this works, it has no value, as it is meaningless to set a values then get the value that you just set.

 

Any thoughts ??

 

Thanks,

Mikayel


Re: SetProperty_Float(kXMP_NS_EXIF, "***", ***, 0) wrong behavior

$
0
0

Hi megibyan,

    The BrightnessValue which you are trying to get is string (numerator/denominator). So calling on GetProperty_float() which expect the value should have (.) but in this case there is ("/") not (".") you get an exception/crash. So instead of calling meta.GetProperty_Float(kXMP_NS_EXIF, "BrightnessValue", &xxx, 0) call meta.GetProperty(kXMP_NS_EXIF, "BrightnessValue", &yyy, 0); where yyy is type std::string.

 

    In the second case, when you set a value of float having (.), you don't get any crash.

 

-Sunil

How to set an EXIF tag value?

$
0
0

After setting up bits, reading the file, etc... I do following:

 

meta.SetProperty_Float(kXMP_NS_EXIF, "ApertureValue", 0.8, 0);

if (file.CanPutXMP(meta))

{

     file.PutXMP(meta);

}

 

, and then close the file and connections.

 

After this I suppose to overwrite the original value in the ApertureValue, but when trying to get it next time as follows:

 

std::string someString;

meta.GetProperty(kXMP_NS_EXIF, "ApertureValue", &someString, 0);

 

I have the old result (in my case 1/1) in the someString.

 

The same strategy works fine for Date&Time tags.

 

Am I doing anything wrong, or it is supposed to be so? If so, what is the right way to overwrite it?

 

 

Thanks,

Mikayel

Looking for answers on XMP files - where should they be stored as sidecar files? With the original raw file or in a separate folder?

$
0
0

Looking for answers on XMP files - where should they be stored as sidecar files?  With the original raw file or in a separate folder?

 

Relatively new user of Adobe LR5 and PS CC, about a year old. 

 

If they should be stored somewhere beside the folder that contains the originals, where and how to change the settings?

 

If I choose to write metadata to the original files, is that sidecar files or does the XMP file show separately?

 

To be honest, I usually find a video and I cannot figure this out.  I have never received an answer on any of my questions by the way. 

Re: Looking for answers on XMP files - where should they be stored as sidecar files? With the original raw file or in a separate folder?

$
0
0

XMP sidecar files are used with image file formats that do not support embedded XMP metadata.

 

Same folder, matching filename, but with extension "xmp". Example: image002.raw   <--> image002.xmp

 

Lightroom keeps an internal metadata database. Synchronizing the embedded XMP from that database may be "manual by user" or automated, subject to settings. The reason it is not always automatic is that an embedded metadata update may require a time consuming complete copy of the entire file. I suspect sidecars are handled by the same logic path.

 

Photoshop creates/updates embedded metadata at the "Save File ..." event. Clearly, any XMP sidecar would be created/updated at the "Save File ..." event as well.

Re: How to set an EXIF tag value?

$
0
0

Hi megibyan,

    XMP has categorization of exif properties. Some properties if not present can be only read but can't be deleted or modified. But if that is not present, you can add it. example of those properties are ApertureValue, BrightnessValue, ExposureBiasValue etc. As your file have already ApertureValue property present, you are not able to modify it.

 

   To know more about these properties and categorization of the property please have a look on toolkit\XMPFiles\source\FormatSupport\ReconcileTIFF.cpp\ReconcileTIFF.cpp in SDK.

 

    If you want to modify, delete it first (using some other utility e.g. exiftool) and add the same property with new value.

 

-Sunil

Re: How to set an EXIF tag value?

$
0
0

Sunil,

 

Thanks for the response.

 

1. Can't I delete the property using XMP SDK?

2. To add the new value and new property I need just to set it, and it will automatically add, right?

 

Thanks,

Mikayel

Re: How to set an EXIF tag value?

$
0
0

Hi Mikayel,


As mentioned by Sunil, XMP consider these set of properties as Inclusion only properties. So, if they are available user can't delete them via XMP SDK. For deletion, you have to use some other means e.g. Hex editing the file or exiftool. Regrading the second point, you are right. Addition is just setting a value for any property.


Hope this will help you.


Thanks,

Deepak Kumar Garg.



How to get EXIF tags like MakerNote?

$
0
0

When trying to get the MakerNote tag like the other tags:

 

meta.GetProperty(kXMP_NS_EXIF, "MakerNote", &tmp, 0);

 

I can see only an empty string. I pretty sure I am doing that wrong. Should it be a massive?

Can you please say the way that I can get the tag information of MakerNote, UserComment, etc...

 

p.s. I believe this relates to all tags that have Int*[n] or Float*[n] data structure, where *  = 8, 16, 32, 64, ... ; n - the number of elements.

 

Thanks,

Mikayel

Re: How to get EXIF tags like MakerNote?

$
0
0

Hi megibyan,

    MakerNote is not supported in xmp. However you should be able to Get/SET value of UserComment. As UserComment is of type langAlt, you have to call SetLocallizedText() and GetLocalizedText() API.

 

   Please let me know if you face any issue.

 

-Sunil

Re: How to get EXIF tags like MakerNote?

$
0
0

Sunsil,

 

Can you please provide all known EXIF tags, that are not supported within XMP?

 

Thanks,

Mikayel

Re: How to get EXIF tags like MakerNote?

$
0
0

Could you please provide an example how to get the UserComment?

 

Thanks,

Mikayel

Re: How to get EXIF tags like MakerNote?

$
0
0

Hi Mikayel,

   To get all the xmp supported exif tag please have a look on the xmp\toolkit\documents\LegacyReconcile\Specs\CIPA-ExifInXMP.pdf (present in your xmpsdk) . For all the exif tags you  can have a look non exif standard tags.

 

-Sunil

Re: How to get EXIF tags like MakerNote?

$
0
0

Shall that file be generated after build ? If yes, the build is not done locally, is there an online link to the document?

Re: Size limit for XMP metadata to be added externally to a file's metadata

$
0
0

Hi Amit,

Sorry for late reply.

Yes, your understanding is correct.

I have been able to add the data in document's metadata, but with following work around.

 

The each information unit I am inserting in metadata is of meta struct item. This meta struct item further includes 3 array items.

When I tried to find out, how many such unit can be added in document's meta-object, I found that upto 200 units, the addition was successful.

So I divided my data into chuncks of 200 units and performaed the insertion repeatedly.

 

If the array items are increased to e.g. 5, the limit of 200 units comes down.

 

Is there any information on limit of appending the meta struct items or array items in 'meta object'?


Re: How to get EXIF tags like MakerNote?

$
0
0

Sunsil,

 

When trying to get the UserComment like this : meta.GetLocalizedText(kXMP_NS_EXIF, "UserComment", "en", "en-US", NULL, &tmp, 0); it fails. Is anything wrong with this?

 

Can I somehow get the raw byte data in it, or in UserComment??

 

Thanks!

Re: How to get EXIF tags like MakerNote?

$
0
0

Hi megibyan,

     I used the API meta.GetLocalizedText(kXMP_NS_EXIF, "UserComment", "", "x-default", NULL, &value, 0); to get the UserComment.

 

    What I did, I had a file without UserComment, to embed I used exiftool.exe -f -exif:UserComment="othercomment" <file.jpg>  command (however you can create from code also)

     To verify it serialized the file content with the following code

     SXMPMeta meta;    

      myFile.Get(&meta)

 

     string buffer;

     meta.SerializeToBuffer(&buffer);

     cout << buffer;

 

    Following was the o/p on console

    -----------------

    --------------

  

     <exif:UserComment>
        <rdf:Alt>
           <rdf:li xml:lang="x-default">sunilcomment</rdf:li>
        </rdf:Alt>
     </exif:UserComment>

 

    ----------------------------

    ----------------------------

 

 

 

  To get the same I executed the code

   string value;

meta.GetLocalizedText(kXMP_NS_EXIF, "UserComment", "", "x-default", NULL, &value, 0);

 

-Sunil

Re: How to get EXIF tags like MakerNote?

$
0
0

Sunsil,

 

Thanks for explanation, that helped much!!

Can you get nor the text but raw byte data in it like {0, 0, 1, 1, 3 ,0 , ....}?

 

Thanks,

Mikayel

Is Flash supported in XMP?

$
0
0

                           std::string StrHexValue;

                           meta.GetProperty(kXMP_NS_EXIF, "Flash", &StrHexValue, 0);

 

This returns an empty string, when it should return a HEX value.

 

Whats' wrong in this syntax?

 

p.s. The same holds for InteroperabilityIndex Tag

 

Thanks,

Mikayel

Re: Is Flash supported in XMP?

$
0
0

Hi Mikayel,

     Flash is struct type so you need to use compose path. For your reference I am using following code to get Flash's Mode property the same you can do for other property

                bool ret = 0;

                ret = meta.DoesPropertyExist(kXMP_NS_EXIF, "Flash");

                if (ret) {

                    string path;

                    //compose the path

                    SXMPUtils::ComposeStructFieldPath(kXMP_NS_EXIF, "Flash", kXMP_NS_EXIF,    "Mode", &path);

                    string flashmode;

                    meta.GetProperty(kXMP_NS_EXIF, path.c_str(), &flashmode, NULL);

                }

 

-Sunil

Viewing all 801 articles
Browse latest View live