Why does iMatch change the case of a file name extension?

Started by afx, January 21, 2014, 08:27:37 PM

Previous topic - Next topic

afx

When I write back metadata file.xmp becomes file.XMP.
Is there an option to turn that off? So far I did not find any.

cheers
afx

Mario

IMatch does not change the extensions when writing back metadata. Just made a few tests to ascertain this.
Where did you see the 'changed' XMP file. Did you look at the files in Windows Explorer?
I noticed that Windows Explorer displays XMP files always with the .XMP extension, but when you do a rename, you see the extension in the real:



[attachment deleted by admin]
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

afx

For testing I had made a copy of the xmp file then pressed the pencil on the image and then tried to do a diff, this is when I realized that the file name changed.
I still have that bash terminal open:

afx@knipse ~/d/2013/12/2013-12-07-Espresso-Figures
$ dir
total 27376
drwxr-x---+ 1 afx Users        0 Dec 22 08:31 .
drwxr-x---+ 1 afx Users        0 Dec 31 06:51 ..
-rwxr-----+ 1 afx Users 13960057 Dec  7 12:36 Espresso-Figures-2013-12-07-033.nef
-rwxr-----+ 1 afx Users    31292 Dec  7 14:04 Espresso-Figures-2013-12-07-033.nef.xmp
-rwxr-----+ 1 afx Users     5330 Dec  8 12:45 Espresso-Figures-2013-12-07-033.xmp
-rwxr-----+ 1 afx Users 13968944 Dec  7 12:39 Espresso-Figures-2013-12-07-041.nef
-rwxr-----+ 1 afx Users    31290 Jan  3 19:02 Espresso-Figures-2013-12-07-041.nef.xmp
-rwxr-----+ 1 afx Users    13242 Dec 14 16:49 Espresso-Figures-2013-12-07-041.xmp

afx@knipse ~/d/2013/12/2013-12-07-Espresso-Figures
$ cp Espresso-Figures-2013-12-07-033.xmp Espresso-Figures-2013-12-07-033.xmp.PRE

afx@knipse ~/d/2013/12/2013-12-07-Espresso-Figures
$ dir Espresso-Figures-2013-12-07-033.xmp*
-rwxr-----+ 1 afx Users 5330 Dec  8 12:45 Espresso-Figures-2013-12-07-033.xmp
-rwxr-----+ 1 afx None  5330 Jan 21 20:11 Espresso-Figures-2013-12-07-033.xmp.PRE

Here I pressed the pencil icon.

afx@knipse ~/d/2013/12/2013-12-07-Espresso-Figures
$ diff Espresso-Figures-2013-12-07-033.xmp*
diff: missing operand after 'Espresso-Figures-2013-12-07-033.xmp.PRE'
diff: Try 'diff --help' for more information.

afx@knipse ~/d/2013/12/2013-12-07-Espresso-Figures
$ dir
total 27384
drwxr-x---+ 1 afx Users        0 Jan 21 20:15 .
drwxr-x---+ 1 afx Users        0 Dec 31 06:51 ..
-rwxr-----+ 1 afx Users 13960057 Dec  7 12:36 Espresso-Figures-2013-12-07-033.nef
-rwxr-----+ 1 afx Users    31292 Dec  7 14:04 Espresso-Figures-2013-12-07-033.nef.xmp
-rwx------+ 1 afx None      7188 Jan 21 20:15 Espresso-Figures-2013-12-07-033.XMP
-rwxr-----+ 1 afx None      5330 Jan 21 20:11 Espresso-Figures-2013-12-07-033.xmp.PRE
-rwxr-----+ 1 afx Users 13968944 Dec  7 12:39 Espresso-Figures-2013-12-07-041.nef
-rwxr-----+ 1 afx Users    31290 Jan  3 19:02 Espresso-Figures-2013-12-07-041.nef.xmp
-rwxr-----+ 1 afx Users    13242 Dec 14 16:49 Espresso-Figures-2013-12-07-041.xmp

afx@knipse ~/d/2013/12/2013-12-07-Espresso-Figures


cheers
afx
PS: My windows explorer does not hide the case of file names, see screenshot. And I added the log, just in case.

[attachment deleted by admin]

Mario

Where does the .nef.xmp extension come from? That's wrong.
And you work on Linux? Does IMatch run on Linux in a VM or are just your files on Linux?

When you write back a file, please check the ExifTool output panel. Enable the verbose mode under Edit > Preferences > Application before.
The output window shows the file names IMatch is sending to ExifTool. Anything unusual?
Since Windows file names are not case sensitive and extensions definitely aren't there may be some spots which don't care to carry the case of XMP extensions. Or when new XMP files are created, IMatch always uses the .XMP extension (all upper case).
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

afx

Quote from: Mario on January 22, 2014, 08:10:20 AM
Where does the .nef.xmp extension come from? That's wrong.
Just ignore them, they are from AfterShot.

QuoteAnd you work on Linux? Does IMatch run on Linux in a VM or are just your files on Linux?
Nope. This is a native Win7 system. I just use a Cygwin bash for commandline access as CMD is too much of a joke.

QuoteWhen you write back a file, please check the ExifTool output panel. Enable the verbose mode under Edit > Preferences > Application before.
The output window shows the file names IMatch is sending to ExifTool. Anything unusual?
I'll try this evening when I have access to the box again.

QuoteSince Windows file names are not case sensitive and extensions definitely aren't there may be some spots which don't care to carry the case of XMP extensions. Or when new XMP files are created, IMatch always uses the .XMP extension (all upper case).
Why default to uppercase? That is bloody ugly, feels like stone age IT. Even silly lightroom can be told to not produce that uglyness.

cheers
afx

Mario

QuoteWhy default to uppercase? That is bloody ugly, feels like stone age IT. Even silly lightroom can be told to not produce that uglyness.

Well, the standard is named XMP and not xmp.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

afx

Quote from: Mario on January 22, 2014, 09:17:09 AM
QuoteWhy default to uppercase? That is bloody ugly, feels like stone age IT. Even silly lightroom can be told to not produce that uglyness.
Well, the standard is named XMP and not xmp.
What makes you think that?

Have a look at Adobes XMP Specification part 3, chapter "External storage of metadata".

QuoteIt is recommended that XMP metadata be embedded in the file that the metadata describes. There are cases where this is not appropriate or possible, such as database storage models, extremes of file size, or due to format and access issues. Small content intended to be frequently transmitted over the Internet might not tolerate the overhead of embedded metadata. Archival systems for video and audio might not have any means to represent the metadata. Some high-end digital cameras have a proprietary, non-extensible file format for "raw" image data and typically store Exif metadata as a separate file. If metadata is stored separately from content, there is a risk that the metadata can be lost. The question arises of how to associate the metadata with the file containing the content. Applications should:
➤ Write the external file as a complete well-formed XML document, including the leading XML
declaration.
➤ The file extension should be .xmp. For Mac OS, optionally set the file's type to 'TEXT'.
➤ If a MIME type is needed, use application/rdf+xml.
➤ Write external metadata as though it were embedded and then had the XMP packets extracted and
   catenated by a postprocessor.
➤ If possible, place the values of the xmpMM:DocumentID, xmpMM:InstanceID, or other appropriate
   properties within the file the XMP describes, so that format-aware applications can make sure they
  have the right metadata.
For applications that need to find external XMP files, look in the same directory for a file with the same
name as the main document but with an .xmp extension. (This is called a sidecar XMP file.)

cheers
afx

Mario

Thanks for educating me.
I checked my code and I use only lower-case .xmp extensions when IMatch renames or creates an XMP file.
Which brings us back to your initial report. I'm awaiting your feedback about what IMatch sends to ExifTool and under which conditions exactly the false case is introduced in the xmp extension on your system. If I can reproduce it here it will be a quick fix.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

afx

Quote from: Mario on January 22, 2014, 08:10:20 AMWhen you write back a file, please check the ExifTool output panel. Enable the verbose mode under Edit > Preferences > Application before.
The output window shows the file names IMatch is sending to ExifTool. Anything unusual?

I tried it on the other file in that directory and the extension turned to uppercase as well. Just added keywords and clicked on the pen icon once it showed up.

Here is the output from exiftool:
-overwrite_original
-m
-use
MWG
-ex
-sep

-XMP-lr:HierarchicalSubject=
-XMP-lr:HierarchicalSubject=coffee
-XMP-lr:HierarchicalSubject=coffee bean
-XMP-lr:HierarchicalSubject=coffee break
-XMP-lr:HierarchicalSubject=cup
-XMP-lr:HierarchicalSubject=Espresso
-XMP-lr:HierarchicalSubject=Kaffee
-XMP-lr:HierarchicalSubject=Kaffeebohne
-XMP-lr:HierarchicalSubject=Kaffeepause
-XMP-lr:HierarchicalSubject=otto
-XMP-lr:HierarchicalSubject=raw sugar
-XMP-lr:HierarchicalSubject=Rohrzucker
-XMP-lr:HierarchicalSubject=sugar
-XMP-lr:HierarchicalSubject=sugar cube
-XMP-lr:HierarchicalSubject=Tasse
-XMP-lr:HierarchicalSubject=Zucker
-XMP-lr:HierarchicalSubject=Zuckerwürfel
-XMP-dc:Subject=
-XMP-dc:Subject=coffee
-XMP-dc:Subject=coffee bean
-XMP-dc:Subject=coffee break
-XMP-dc:Subject=cup
-XMP-dc:Subject=Espresso
-XMP-dc:Subject=Kaffee
-XMP-dc:Subject=Kaffeebohne
-XMP-dc:Subject=Kaffeepause
-XMP-dc:Subject=otto
-XMP-dc:Subject=raw sugar
-XMP-dc:Subject=Rohrzucker
-XMP-dc:Subject=sugar
-XMP-dc:Subject=sugar cube
-XMP-dc:Subject=Tasse
-XMP-dc:Subject=Zucker
-XMP-dc:Subject=Zuckerwürfel
-XMP:CreatorTool=photools.com IMatch 5.0.0.132 (Windows)

-xmp:InstanceID=xmp.iid:3654fb0c-dec8-4c06-b110-fd26f8c39fc1

-MWG:ModifyDate=now
-XMP:MetadataDate=now
D:\2013\12\2013-12-07-Espresso-Figures\Espresso-Figures-2013-12-07-041.XMP
-execute9999

    1 image files updated

----- Runtime: 1 s.


So exiftool is given an uppercase extension.

Anything else I should check?

cheers
afx

Mario

This is not caused by ExifTool. The file name sent to ExifTool is

D:\2013\12\2013-12-07-Espresso-Figures\Espresso-Figures-2013-12-07-041.XMP

which means IMatch is getting an uppercase extension from somewhere. Is this a newly created XMP file or had the original image file already an XMP file before this write-back happened?
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

afx

The original xmp was created by AfterShot and then modified by Lightroom.
I am on the road right now, so i can't get to the machine. I'll get you a sample tomorrow. Maybe that can shed a light on this.

cheers
afx