Custom Metadata Panel - missing variable?

Started by twofid, December 20, 2024, 11:14:59 PM

Previous topic - Next topic

twofid

Hello All,

Working on creating a custom panel within the Metadata browser and cannot figure out how to display a file's "FileType" and "FileTypeExtension" (not to be confused with its' Windows file Extension.

I have looked thru both VarToy and the Tag Selector but have only found reference to the file's extension {File.MD.file.ext} and (photools.com::IMatch\101200\file.ext\0) respectively.

All of my scripts' (Powershell/Exiftool) use FileType to ensure the correct Metadata is extracted. Using the Window's file extension is problematic, given that these two fields do no always match. Being able to see/find these outliers in the Metadata Browser would be very useful.

Many thanks in advance for any help in pointing me in the right direction.
DJ

PandDLong


I use {File.Format} as a means of identifying the file type independent of the name.  

Not sure if the values used for this variable match your needs but it is working for me (so far).



Michael

Mario

#2
QuoteWorking on creating a custom panel within the Metadata browser and cannot figure out how to display a file's "FileType" and "FileTypeExtension" (not to be confused with its' Windows file Extension.
What do you consider a "FileType"?
Mime type? Something Windows and PowerShell maintain? Or what Windows Explorer shows as the "type" of a file?
What do you mean by "FileTypeExtensiion"? Never heard that.

IMatch does no need or maintain mime type.
IMatch works with the file extension and groups files into file format groups, see File Formats.
That's all it needs.

QuoteAll of my scripts' (Powershell/Exiftool) use FileType (...)
I don't know what your scripts do or where they get this FileType from, sorry. Never had a need for that.

As PandDLong explained, you can access the internal file format group name IMatch uses via the {File.Format} variable. And the extension via {File.Ext}. That's it.

If Windows maintains additional "file type" information and makes it available via PowerShell, that's a Windows thing. This information is not available in IMatch.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook

twofid

I use the following Exiftool command:

exiftool -s -G -r .  (dumps the Metadata of all files in the current directory and subs)

included in the extracted Metadata are the fields I am working with:

[File]  FileType            : M2T
[File]  FileTypeExtension]  : m2t

The file that this info was pulled from (wedding1.m2ts) has the wrong extension and the reason I use FileType when organizing/de-duplicating over 10 years of media files (from multiple cameras) before cleaning them up in iMatch. It tends to be more consistent.

DJ


Mario

MT2 and MT2S is the "same" format. A transport stream, which can contain video, audio and other data. Some applications use a four-letter extension, others stick to the .3 format for wider compatibility. For IMatch, this is not relevant.

ExifTool uses a hard-coded list of file extensions in \lib\Image\ExifTool.pm in the fileTypeLookup map.
IMatch uses a hard-coded list in an XML configuration type to determine which plug-in to use when processing a file format.
It groups both .M2T and .M2TS containers into the "multimedia" MCI group.
-- Mario
IMatch Developer
Forum Administrator
http://www.photools.com  -  Contact & Support - Follow me on 𝕏 - Like photools.com on Facebook