I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2010-01-05 18:55:52-08 by janmartin
How to write custom tag and value to GPS Group?
Hi Phil,

I am still trying to create a custom tag in the GPS group and write content to it.

The following does not work yet:
me@me-u904:~$ perl /home/me/scripts/custom_tag.pl
Sorry, MyNewTag is not writable

May I ask for your help?
Thanks,
Jan

#!/usr/bin/perl use warnings; # Most of this file copied from: # http://cpanforum.com/threads/7404#7424 # ============================== Load modules ==================================== use Image::ExifTool qw(:Public); my ($picFile); $picFile = '/home/me/image_001.jpg'; $tagvalue = <<END; Jipeee, it works! END # print $tagvalue; #define ExifTool object; my $ExifTool = new Image::ExifTool; # adapted from http://owl.phy.queensu.ca/~phil/exiftool/config.html %Image::ExifTool::UserDefined = ( 'Image::ExifTool::Exif::Main' => { 0xd000 => { Name => 'MyNewTag', Writable => 'int16u', WriteGroup + => 'GPS', }, } ); $ExifTool->SetNewValue('MyNewTag', $tagvalue); $ExifTool->WriteInfo($picFile); print "After mod=============================================== \n"; my $info = ImageInfo($picFile); foreach (keys %$info) { print "$_ => $$info{$_}\n"; } #end
Direct Responses: 12116 | Write a response
Posted on 2010-01-05 19:10:16-08 by exiftool in response to 12114
Re: How to write custom tag and value to GPS Group?
Hi Jan,

It works with this definition:

%Image::ExifTool::UserDefined = ( 'Image::ExifTool::GPS::Main' => { 0xd000 => { Name => 'MyNewTag', Writable => 'string', }, }, );

- Phil
Direct Responses: 12122 | Write a response
Posted on 2010-01-06 14:13:17-08 by janmartin in response to 12116
Re: How to write custom tag and value to GPS Group?
Thanks Phil,

now writing the user defined tag works.

However reading the MyNewTag tags content is a different thing:
Firefox Add-On "Exif Viewer" output:
Exif GPS IFD ... Unknown tag, Tagnum 0xd000 = data ===> Jipeee, it works!
This is no what I thought of.
Basically I am looking for a way to save a json string in a way that it can be accessed easyly and without tinkering from most programming languages. Especially perl, javascript, actionscript3.
Also I would like to avoid using existing tags, to not overwrite any existing content.

Do you have an idea how to achieve this, please?

Thanks,
Jan

P.S.:
I just added the MyNewTag tag to the source of the jquery library I am using, and now at least that works!
Direct Responses: 12123 | Write a response
Posted on 2010-01-06 14:30:32-08 by exiftool in response to 12122
Re: How to write custom tag and value to GPS Group?
Hi Jan,

I would suggest using XMP instead of EXIF if your software supports it. XMP is designed to be extensible so custom tags are sometimes handled a bit better than with EXIF.

- Phil
Direct Responses: Write a response