Re: XMP import patch - Best version yet :)



Hi Bengt,

I haven't had time to do a detailed code review, but I skimed the patch, applied it and played with it a bit. As written it doesn't let me do what I had originally written the patch for - take a set of photos from an app that doesn't support xmp, write a script to generate sidecars for each photo, and then import them into f-spot.

The only issue is that you added some code to not read sidecars for jpeg files. If I comment out this block in XmpTagsMetadata.cs:
      try {
        ImageFile img = ImageFile.Create (path);
        if (img is SemWeb.StatementSource) {
System.Console.WriteLine ("This was a JPG, will not check for a sidecar");
          return new XmpTagsMetadata (path, null, false);
        }

      } catch (System.Exception e) {
System.Console.WriteLine ("Error reading XMP headers for {0}\n{1}", path, e.ToString ());
      }

Then my use-case works fine.

Is there a reason that you disabled reading sidecars on jpegs? If they are there, what is the harm in reading them? In my use-case it's a lot easier to just generate a side-car than to try and find a tool that will embed the appropriate xmp data in the jpeg.

Unless there's a really good reason for not reading sidecars from jpegs, I'd appreciate it if you renabled this functionality.

Aside from that, the patch looks pretty good, and seemed to work fine...

Warren






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]