Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

XMP, Image::ExifTool, strawberryperl

by mrkjell (Initiate)
on Nov 25, 2009 at 17:48 UTC ( #809375=perlquestion: print w/ replies, xml ) Need Help??
mrkjell has asked for the wisdom of the Perl Monks concerning the following question:

Hi. I wonder if anyone might help me with my problem. I want to create a crossplatform application to tag, register, scale and upload my images. I use ExifTool to create an XMP to store some metadata in the imagefiles. This works great in debian, but the metadata written in XP ( strawberryperl ) is not readable. I have hexdumped the images, and there is small changes in the data, but I cant see any notes of this in the changelog of exiftool. A quickfix would be to use system calls and use the exiv2-util, but I really want to native perl. Have anyone ever tried to work with XMP-data in a crossplatform setting with perl? Does there exists other alternatives to ExifTool? Thank you reading this. Any feedback would be great. Best regards.

Comment on XMP, Image::ExifTool, strawberryperl
Re: XMP, Image::ExifTool, strawberryperl
by Anonymous Monk on Nov 26, 2009 at 01:28 UTC
      Hi. Thank you for the reply. I have been looking on binmode. It was hard to find any options regarding this. Do you mean Binary? like this:
      $exifTool->Options( Binary => 1 );
      It did not do anything different. I have also looked at encoding. Bestregards.
Re: XMP, Image::ExifTool, strawberryperl
by boardhead (Novice) on Nov 26, 2009 at 17:26 UTC
    ExifTool should work just fine in XP. Why do you say the output is unreabable? What can't read it? I'm sure exiftool can. The only possible difference I could see is with the newline character, but XMP is perfectly valid when written with any newline sequence. - Phil
      Hi. Thank you for your reply. I really appreciate it. Yes, it looks like ExifTool works fine, but the XMP data is not readable when I try to dump this information with exiv2 ( on linux ). I did not make it work with "The PHP Metadata Toolkit".
      It might be that ExifTool is folowing the standards, but the files is not readable for other tools, so this is my problem.
      exampe:
      #I tag a file like this: my $exifTool = new Image::ExifTool; $exifTool->ExtractInfo($image); $exifTool->SetNewValue('XMP:Headline' => "heisannheisann"); $exifTool->WriteInfo($image);
      When I look at this file with the string util in linux, I get this block:
      http://ns.adobe.com/xap/1.0/ <?xpacket begin=' ' id='W5M0MpCehiHzreSzNTczkc9d'?> <x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='Image::ExifTool 7.89'> <rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'> <rdf:Description rdf:about='' xmlns:photoshop='http://ns.adobe.com/photoshop/1.0/'> <photoshop:Headline>heisannheisann</photoshop:Headline> </rdf:Description> </rdf:RDF> </x:xmpmeta> <?xpacket end='w'?> -- but the exiv2 tool says: $ exiv2 -p x Vannliljer.jpg Vannliljer.jpg: No XMP data found in the file When i do the same thing on a linux box, I get this: $ exiv2 -p x tmp.jpg Xmp.photoshop.Headline XmpText 14 heisannhei +sann $http://ns.adobe.com/xap/1.0/ <?xpacket begin=' ' id='W5M0MpCehiHzreSzNTczkc9d'?> <x:xmpmeta xmlns:x='adobe:ns:meta/' x:xmptk='Image::ExifTool 7.30'> <rdf:RDF xmlns:rdf='http://www.w3.org/1999/02/22-rdf-syntax-ns#'> <rdf:Description rdf:about='' xmlns:photoshop='http://ns.adobe.com/photoshop/1.0/'> <photoshop:Headline>heisannheisann</photoshop:Headline> </rdf:Description> </rdf:RDF> </x:xmpmeta>
      Any more clues? best regards. Kjell
        Thanks for the extra information.

        Just to point out that one obvious difference is that the linux box is running Image::ExifTool version 7.30, whilst windows is running a more recent 7.89. This is a possible factor.

        You could experimentally try backing out your Windows version using Image::ExifTool 7.30 from backpan, just to confirm this, or rule it out.

        Some more debugging discovered some embarrassing things.
        Being so focused on the borked metadata, I did not realize that the image also got resized using Image::Magick. I gues the problem is not Image::ExifTool after all. Ill gues I now suspect Image::Magick :)
        Thank you for all you help so far.
        Best regards.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://809375]
Approved by keszler
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (3)
As of 2014-09-18 01:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    How do you remember the number of days in each month?











    Results (103 votes), past polls