Author Topic: Adding a custom tag shows up as null when all tags are queried  (Read 1923 times)

kpg

  • Newbie
  • *
  • Posts: 6
Adding a custom tag shows up as null when all tags are queried
« on: November 16, 2016, 05:57:36 PM »
Hello,

I added a new tag (AssetID) to a .jpg file using the following config,

%Image::ExifTool::UserDefined = (
    'Image::ExifTool::XMP::xmp' => {
        AssetID => { Writable => 'string', Groups => { 1 => 'XMP' } },
    },
);

Now, when I try to get all tags, the added tag shows up as nil, as follows,
 
"ExifByteOrder",
 "Orientation",
 "ModifyDate",
 "ImageUniqueID",
 "XMPToolkit",
nil,
 "ImageWidth",
 "ImageHeight",
 "EncodingProcess",


But, when I try to get file.AssetID, it gives the value I had given for AssetID. Can you please tell me what I am doing wrong.

Thanks,
kpg



Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 17049
    • ExifTool Home Page
Re: Adding a custom tag shows up as null when all tags are queried
« Reply #1 on: November 16, 2016, 07:20:57 PM »
I get this with ExifTool 10.33 using your config file:

Code: [Select]
> exiftool a.jpg -assetid=test
    1 image files updated
> exiftool a.jpg -G1 -a -assetid
[XMP-getty]     Asset ID                        : test
[XMP-xmp]       Asset ID                        : test

So it worked, but apparently AssetID was already defined in the XMP-getty group.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

kpg

  • Newbie
  • *
  • Posts: 6
Re: Adding a custom tag shows up as null when all tags are queried
« Reply #2 on: November 17, 2016, 12:57:07 AM »
I can retrieve AssetID but when I try to get all tag, I still get nil,

Code to get all tags:

      creative_xmp = MiniExiftool.new creative_file
      assetID = creative_xmp.to_hash
   
The result is as follows (The ID that I have added is ''c647a2ee3883241a6d1841b3addf6fb3''):

{"ExifToolVersion"=>9.27,
 "FileSize"=>"12 kB",
 "FileModifyDate"=>2016-11-16 21:47:30 -0800,
 "FileAccessDate"=>2016-11-16 21:52:56 -0800,
 "FileInodeChangeDate"=>2016-11-16 21:47:30 -0800,
 "FilePermissions"=>"rw-r--r--",
 "FileType"=>"JPEG",
 "MIMEType"=>"image/jpeg",
 "JFIFVersion"=>1.02,
 "ResolutionUnit"=>"None",
 "XResolution"=>1,
 "YResolution"=>1,
 "OcadRevision"=>20193,
 "ExifByteOrder"=>"Big-endian (Motorola, MM)",
 "Orientation"=>"Horizontal (normal)",
 "ModifyDate"=>2012-08-22 11:12:24 -0700,
 "ImageUniqueID"=>"BF3BEA942CA7482A8A1B0EE8E8679E12",
 "XMPToolkit"=>"Image::ExifTool 9.27",
nil=>"c647a2ee3883241a6d1841b3addf6fb3",
 "ImageWidth"=>445,
 "ImageHeight"=>269,
 "EncodingProcess"=>"Baseline DCT, Huffman coding",
 "BitsPerSample"=>8,
 "ColorComponents"=>3,
 "YCbCrSubSampling"=>"YCbCr4:2:0 (2 2)",
 "ImageSize"=>"445x269"}


Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 17049
    • ExifTool Home Page
Re: Adding a custom tag shows up as null when all tags are queried
« Reply #3 on: November 17, 2016, 07:11:13 AM »
Can you reproduce this from the command line version of ExifTool?  I don't know how MiniExifTool works, and I don't see the problem when I run from the command line.

But first I might suggest updating to a more recent version of ExifTool to see if the problem goes away.  The current version is 10.33, and the version you are running is more than 3 years old.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

kpg

  • Newbie
  • *
  • Posts: 6
Re: Adding a custom tag shows up as null when all tags are queried
« Reply #4 on: November 17, 2016, 01:36:21 PM »
Thank you so much :) I used ExifTool instead of MiniExifTool and I am able to see all the user defined tags :)
 
One more question:

Why is another file called _original getting created when I add a new tag? Is there a way to avoid it?

Phil Harvey

  • ExifTool Author
  • Administrator
  • ExifTool Freak
  • *****
  • Posts: 17049
    • ExifTool Home Page
Re: Adding a custom tag shows up as null when all tags are queried
« Reply #5 on: November 17, 2016, 01:46:28 PM »
Why is another file called _original getting created when I add a new tag? Is there a way to avoid it?

ExifTool automatically saves a your original file to act as a backup.  Add -overwrite_original to the command to avoid this.

- Phil
...where DIR is the name of a directory/folder containing the images.  On Mac/Linux, use single quotes (') instead of double quotes (") around arguments containing a dollar sign ($).

kpg

  • Newbie
  • *
  • Posts: 6
Re: Adding a custom tag shows up as null when all tags are queried
« Reply #6 on: November 17, 2016, 02:37:23 PM »
thank you so much for helping me with this. really appreciate your time and patience! you are awesome :)