Author Topic: Collapsible Metadata Viewer  (Read 18974 times)

Ferdinand

  • 100 years since I was shot and a war was started
  • Global Moderator
  • *****
  • Posts: 1670
Re: Collapsible Metadata Viewer
« Reply #50 on: July 16, 2013, 08:28:45 AM »
I am a bit puzzled by this.  I don't claim to be an expert, but my understanding is that these composite fields don't actually exist inside the file.  They are a construct used by ExifTool to handle the fact that different manufacturers store the same information in different fields.  Take ISO.  My understanding is that some store this in a standard EXIF field, but not other manufacturers, and Nikon store it in maker notes, of all places!  So ExifTool has these virtual fields called composite fields, which are programmed to output the information from the correct field for that camera make and model.  So composite fields should always work, if the metadata is in there.  Which is why I suggested to John that he might use them in a public release.

But in your case you have a situation where the EXIF field works but the composite doesn't.  I would have thought that this was a problem with ExifTool that Phil Harvey should be made aware of, if my understanding is correct.  Assuming of course that the method used to input the GPS coordinates followed the standard completely.

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 23189
Re: Collapsible Metadata Viewer
« Reply #51 on: July 16, 2013, 01:29:37 PM »
Composite fields are sometimes a big of a riddle. I know for sure that Phil knows what he is doing and there is always a good reason behind specific behaviors of ExifTool.

There is an list of Composite tags here:

http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Composite.html

which also explains from which sources they are filled. Not all Composite tags are on this list, though.

While setting up the Standard Tags for IMatch 5 I used Composite fields wherever possible. If no composite field was available I created 'lists' if tags to check for values, with a most likely available to esoteric ranking. If none of these tags contains a value, the Standard Tag will be empty.

It is sometimes just baffling how unnecessarily complicated camera vendors produce their metadata. And I'll never understand why vendors like Nikon use encryption (!) to hide tags like white balance or lens information in their maker notes. Or why they don't fill the standard EXIF ISO field but instead bury that data in their proprietary maker notes.

sinus

  • Global Moderator
  • *****
  • Posts: 3717
  • IMatch-User since 2001 (IMatch 3.6)
Re: Collapsible Metadata Viewer
« Reply #52 on: July 18, 2013, 09:07:53 PM »
This does also not work on my Computer!
Tomorrow, I will install IM and this script on my netbook and give it a try there.

Like the poor Michael ;) it is the same here:

Everything, what I do, does not work. I have the same box-error (library is missing) like Michael.

BUT, John, your scripts are running great!

And your app seems to be also very interesting.

Thanks a lot, not that important to me now (I have to go  8) in vacances now, I will miss IMatch5 and the forum  :-\ )  - but I wanted show, that Michael is  not the only one.

Have a nice weekend (comes soon)
Best wishes from Switzerland! :-)
Markus

picolo

  • Full Member
  • **
  • Posts: 207
Re: Collapsible Metadata Viewer
« Reply #53 on: July 18, 2013, 09:10:37 PM »
Quote
but I wanted show, that Michael is  not the only one
Michael is not alone ;D  Good to know!
Thanks Sinus...
Cheers, Michael
__________________________________________
Intel i7 | 8GB | ATI HD5770 | OS: Win8 (64 Bits)
http://picolo-photography.com

sinus

  • Global Moderator
  • *****
  • Posts: 3717
  • IMatch-User since 2001 (IMatch 3.6)
Re: Collapsible Metadata Viewer
« Reply #54 on: July 18, 2013, 09:13:16 PM »

It is sometimes just baffling how unnecessarily complicated camera vendors produce their metadata. And I'll never understand why vendors like Nikon use encryption (!) to hide tags like white balance or lens information in their maker notes.

OT:
Maybe because they want be sure, that Snowden does not find these very important secrets  :'( (could not resist, sorry)
Best wishes from Switzerland! :-)
Markus

JohnZeman

  • Global Moderator
  • *****
  • Posts: 1191
  • I'm too damn old to act my age.
Re: Collapsible Metadata Viewer
« Reply #55 on: July 20, 2013, 02:17:48 AM »
Michael would it be all right if I contact you by private message about debugging this app?  I'd like to start a step by step process of rebuilding the app from scratch until we find where it breaks for you.

Sinus I'd ask you too but it looks like you're doing better things right now, enjoy your vacation! ;)

picolo

  • Full Member
  • **
  • Posts: 207
Re: Collapsible Metadata Viewer
« Reply #56 on: July 20, 2013, 07:50:32 AM »
Yes, I would be happy to help you, however, I am available not before Sunday night...
 
Cheers, Michael
__________________________________________
Intel i7 | 8GB | ATI HD5770 | OS: Win8 (64 Bits)
http://picolo-photography.com

JohnZeman

  • Global Moderator
  • *****
  • Posts: 1191
  • I'm too damn old to act my age.
Re: Collapsible Metadata Viewer
« Reply #57 on: July 20, 2013, 03:44:24 PM »
Thanks, and no hurry.  In fact I have several photo shoots coming up in the next couple weeks that'll keep me busy off and on so I'll be a bit erratic in working on this problem too.

I'll send you a PM later today or tomorrow.

JohnZeman

  • Global Moderator
  • *****
  • Posts: 1191
  • I'm too damn old to act my age.
Re: Collapsible Metadata Viewer
« Reply #58 on: July 24, 2013, 05:57:17 PM »
Just uploaded the latest version of the app which hopefully corrects the errors Michael (picolo) and Markus (sinus) were seeing.

picolo

  • Full Member
  • **
  • Posts: 207
Re: Collapsible Metadata Viewer
« Reply #59 on: July 24, 2013, 10:55:31 PM »
John,

The uploaded version Mod4 does not work here on my system... Same old problem!
Not sure what you have changed between the version you have send me and the version you uploaded.
Cheers, Michael
__________________________________________
Intel i7 | 8GB | ATI HD5770 | OS: Win8 (64 Bits)
http://picolo-photography.com

JohnZeman

  • Global Moderator
  • *****
  • Posts: 1191
  • I'm too damn old to act my age.
Re: Collapsible Metadata Viewer
« Reply #60 on: July 24, 2013, 11:06:47 PM »
Same error as before about the IMatch library not loading?

Back to square one again then.  I'll email you tomorrow morning and start with the version that did work for you.

jch2103

  • Super Hero
  • ****
  • Posts: 1778
Re: Collapsible Metadata Viewer
« Reply #61 on: July 24, 2013, 11:15:31 PM »
I'm also getting the same problem here (app can't find the js library). My work-around of changing
<script src="../../\lib/imatch_app.js" type="text/javascript"></script>
to
<script src="..\..\lib\imatch_app.js" type="text/javascript"></script>
still works, but I don't know why.

John

JohnZeman

  • Global Moderator
  • *****
  • Posts: 1191
  • I'm too damn old to act my age.
Re: Collapsible Metadata Viewer
« Reply #62 on: July 24, 2013, 11:32:24 PM »
I just uploaded mod 5, if that doesn't solve the problem then I'll be emailing Michael again tomorrow morning and I'd like to get your email address too jch since I can't attach files to private messages here.

jch2103

  • Super Hero
  • ****
  • Posts: 1778
Re: Collapsible Metadata Viewer
« Reply #63 on: July 25, 2013, 12:55:48 AM »
Sorry, same problem with mod 5. I've sent you a PM with my e-mail address.

John
John

JohnZeman

  • Global Moderator
  • *****
  • Posts: 1191
  • I'm too damn old to act my age.
Re: Collapsible Metadata Viewer
« Reply #64 on: July 25, 2013, 02:26:39 AM »
Got it, thanks.  I'll start over in the morning with the working version, at least it worked for Michael, and go from there via email with both of you.

How odd that virtually all of the problems seem to be related to trying embed and enable the IMatch imatch_app.js file. :o

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 23189
Re: Collapsible Metadata Viewer
« Reply #65 on: July 25, 2013, 08:00:44 AM »
All Apps I ship with IMatch use that JavaScript library. Do the standard Apps work?

picolo

  • Full Member
  • **
  • Posts: 207
Re: Collapsible Metadata Viewer
« Reply #66 on: July 25, 2013, 09:05:10 AM »
The standard app works...
Cheers, Michael
__________________________________________
Intel i7 | 8GB | ATI HD5770 | OS: Win8 (64 Bits)
http://picolo-photography.com

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 23189
Re: Collapsible Metadata Viewer
« Reply #67 on: July 25, 2013, 09:08:21 AM »
Very mysterious...  ???

picolo

  • Full Member
  • **
  • Posts: 207
Re: Collapsible Metadata Viewer
« Reply #68 on: July 25, 2013, 09:25:55 AM »
Can that be a "rights" problem?
Cheers, Michael
__________________________________________
Intel i7 | 8GB | ATI HD5770 | OS: Win8 (64 Bits)
http://picolo-photography.com

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 23189
Re: Collapsible Metadata Viewer
« Reply #69 on: July 25, 2013, 09:43:57 AM »
The browser inside the App panel is always run under the same user account.

The Basic App sample is also in the user folder and therefore accesses the imatch_lib.js file exactly as Johns script should. If this App runs, the user, path etc. is OK.

JohnZeman

  • Global Moderator
  • *****
  • Posts: 1191
  • I'm too damn old to act my age.
Re: Collapsible Metadata Viewer
« Reply #70 on: July 25, 2013, 03:05:18 PM »
Hopefully I'm making some progress here.  This morning all I did to the app was to change all the app file (and folder) names to 8 characters or less with no spaces and now Michael says it's working for him.  Still waiting to hear back from jch.

jch2103

  • Super Hero
  • ****
  • Posts: 1778
Re: Collapsible Metadata Viewer
« Reply #71 on: July 25, 2013, 03:39:05 PM »
Unfortunately, same problem with the latest (short) version. The Basic App seems to work OK:
"This sample app does nothing.
"It serves as a starting point for your own apps. Just copy the entire BasicApp folder to a new folder to begin with your new app."

But as before, if I change "/" to "\" in the viewer.htm script path, it does work properly(!??!)... Peculiar.
John

JohnZeman

  • Global Moderator
  • *****
  • Posts: 1191
  • I'm too damn old to act my age.
Re: Collapsible Metadata Viewer
« Reply #72 on: July 25, 2013, 03:59:24 PM »
I just sent you another app to try....

jch2103

  • Super Hero
  • ****
  • Posts: 1778
Re: Collapsible Metadata Viewer
« Reply #73 on: July 25, 2013, 06:24:20 PM »
Just tried it... Same error message...!
Very peculiar.
Maybe Mario's Basic App does enough nothing that it doesn't produce an error??
John

picolo

  • Full Member
  • **
  • Posts: 207
Re: Collapsible Metadata Viewer
« Reply #74 on: July 25, 2013, 07:55:14 PM »
Quote
Maybe Mario's Basic App does enough nothing that it doesn't produce an error??
;D ;D ;D ;D
Cheers, Michael
__________________________________________
Intel i7 | 8GB | ATI HD5770 | OS: Win8 (64 Bits)
http://picolo-photography.com

JohnZeman

  • Global Moderator
  • *****
  • Posts: 1191
  • I'm too damn old to act my age.
Re: Collapsible Metadata Viewer
« Reply #75 on: July 26, 2013, 01:07:45 AM »
Quote
Maybe Mario's Basic App does enough nothing that it doesn't produce an error??
;D ;D ;D ;D

The testapp gives you the same error as my collapsible metadata app? 
The testapp is simply Mario's basicapp with just a few extra lines added to it so it displays the selected image's folder and file name below his "This sample app does nothing" message.  I've attached that testapp to this message I hope Mario can take a quick look at it to see if he has any ideas regarding the problem because I don't where I could go from here.

[attachment deleted by admin]

jch2103

  • Super Hero
  • ****
  • Posts: 1778
Re: Collapsible Metadata Viewer
« Reply #76 on: July 26, 2013, 02:11:30 AM »
The testapp gives you the same error as my collapsible metadata app? 
Yes. And, again, it works properly if I change the "/" path characters to "\". I don't know why this happens on my computers (Win7/74, Win8/64) but not on others'.

John

jch2103

  • Super Hero
  • ****
  • Posts: 1778
Re: Collapsible Metadata Viewer
« Reply #77 on: July 26, 2013, 02:31:40 AM »
Good grief! Now they're working properly!

I really don't understand this. As far as I know, the only change on my computer between when they didn't/did work was my editing of the path in the .htm files. But even when I changed the path back to default, they continued to work properly.

If we were running Unix, I'd think the problem was caused by an ownership issue...
John

JohnZeman

  • Global Moderator
  • *****
  • Posts: 1191
  • I'm too damn old to act my age.
Re: Collapsible Metadata Viewer
« Reply #78 on: July 26, 2013, 02:40:26 AM »
Good grief! Now they're working properly!

That's weird all right.  I remember a few weeks ago when I first started writing the collapsible metadata viewer app, at first I had the same library errors too, and then all of a sudden the error disappeared.  At the time I chalked it up to something I might have changed in the app since I was writing a lot of JavaScript then.  But maybe something else is going on?

My guess is unless Mario finds something that's not right, that we won't really know the answer to this mystery until someone else writes a user app.  Whether he or she encounters the same issues or not could help shed some light on the source of the problems we've been having with this app.

jch2103

  • Super Hero
  • ****
  • Posts: 1778
Re: Collapsible Metadata Viewer
« Reply #79 on: July 26, 2013, 02:48:00 AM »
I poked around some more. It seems that all I actually need to do to get the apps to work is to make a very minor edit (e.g., add a space to a line) and save. After that, they seem to work properly.

That makes it seem even more like an ownership.permissions problem, but I don't understand why that would happen in Windows.
John

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 23189
Re: Collapsible Metadata Viewer
« Reply #80 on: July 26, 2013, 08:32:31 AM »
Well, since there is Internet Explorer involved, security is always an issue.
Or maybe this is again a character set encoding problem? The HTML file should be in UTF-8 and the header should specify as such. IMatch assumes that. Re-saving a file in an editor will not change the file system permissions but may change the character set encoding of the file...???  ??? :o

jch2103

  • Super Hero
  • ****
  • Posts: 1778
Re: Collapsible Metadata Viewer
« Reply #81 on: July 26, 2013, 04:01:53 PM »
For what it's worth, I used Notepad++ (will all default settings) to make my minor edits.
My Windows settings are English (United States), which I think is the same as for John.
John

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 23189
Re: Collapsible Metadata Viewer
« Reply #82 on: July 26, 2013, 06:29:23 PM »
I know that IE is very picky when it comes to the character set encoding used for the HTML page (e.g. if the file is stored in UTF-8 with BOM or ASCII or whatever). It must be stored in UTF-8 and the meta header in the file must also be UTF-8. See this thread above for more info (I needed to do these changes to make Johns script work on my system). The error message was always something like cannot find imatch_lib.js or just errors executing the JavaScript code. Maybe this has crept in somehow again.

I would try to copy my simple Basic HTML app (which does nothing) and then copy/paste the code from John's HTML page into that.

JohnZeman

  • Global Moderator
  • *****
  • Posts: 1191
  • I'm too damn old to act my age.
Re: Collapsible Metadata Viewer
« Reply #83 on: July 26, 2013, 10:39:48 PM »
Well, since there is Internet Explorer involved, security is always an issue.
Or maybe this is again a character set encoding problem? The HTML file should be in UTF-8 and the header should specify as such. IMatch assumes that. Re-saving a file in an editor will not change the file system permissions but may change the character set encoding of the file...???  ??? :o

Ummm it did.  >:(  :o  :-[
I still had the UTF-8 header in the htm file and I did have all text related files saved as UTF-8 before, but I just discovered my favorite text editor (NoteTab Pro) that I've used for 16 years now, has a bug in it that prevents it from saving files in the original format even though that's how I have the options set up to be.  So each time I saved the app htm file NoteTab was converting the format back to ANSI.  Sigh..  Well now that I know this I'll have to make sure I double check the actual format of the files before I actually upload a new version of the app which I'll do again shortly.

sinus

  • Global Moderator
  • *****
  • Posts: 3717
  • IMatch-User since 2001 (IMatch 3.6)
Re: Collapsible Metadata Viewer
« Reply #84 on: August 12, 2013, 12:03:33 PM »
Michael would it be all right if I contact you by private message about debugging this app?  I'd like to start a step by step process of rebuilding the app from scratch until we find where it breaks for you.

Sinus I'd ask you too but it looks like you're doing better things right now, enjoy your vacation! ;)

John, thanks a lot and you have been right  8)
I enyoyed my vacation and now I am back ... but as we know all: after vacation there is a lot to do. But I am slowly back into the IMatch-business.
Have a good day!
Best wishes from Switzerland! :-)
Markus

DavidOfMA

  • Sr. Member
  • **
  • Posts: 253
  • Writer/Photographer/Therapist
Re: Collapsible Metadata Viewer
« Reply #85 on: January 03, 2014, 03:03:53 AM »
Saw this and installed it. Works great! Took a look at the HTML and vars.js files, however, and I'm at a loss as to how you access the metadata. I'm particularly interested in accessing Attributes. I'm not a programmer and have only rudimentary knowledge of javascript and html, but this does seem like all I'll need to do is modify your vars.js and viewer.html files to suit my purposes.

How do I go about finding out how to access Attributes and display them?

Thanks,
David

JohnZeman

  • Global Moderator
  • *****
  • Posts: 1191
  • I'm too damn old to act my age.
Re: Collapsible Metadata Viewer
« Reply #86 on: January 03, 2014, 03:38:41 AM »
That's a good question David and as far as I know you can't.

The collapsible metadata viewer, like the IMatch metadata panel itself, uses the metadata contained in metadata tags.  So unless you can find a metadata tag that has the attribute you want, I don't think you can do this.

On the other hand you can display attribute values in an html dialog that's launched by a script.  In the attached screen shot I display the latest value in an attribute set at the very bottom (indicated by the red arrow) of the html dialog.

[attachment deleted by admin]

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 23189
Re: Collapsible Metadata Viewer
« Reply #87 on: January 03, 2014, 08:26:44 AM »
HTML Templates use variables to access metadata. You can access Attributes in a HTML template via Variables as well. See the Attribute Variables section in the Variables help topic for details.

Tip: Use the VarToy app to try out variables and formatting functions.

An IMatch App combines HTML with JavaScript and has full access to the IMatch 5 object model, including metadata and Attributes. This allows or more complex things, e.g. iterating over all data sets in an Attribute set etc.

JohnZeman

  • Global Moderator
  • *****
  • Posts: 1191
  • I'm too damn old to act my age.
Re: Collapsible Metadata Viewer
« Reply #88 on: January 03, 2014, 03:23:27 PM »
An IMatch App combines HTML with JavaScript and has full access to the IMatch 5 object model, including metadata and Attributes. This allows or more complex things, e.g. iterating over all data sets in an Attribute set etc.

We can access attributes from an app? 
Obviously I missed something then, time to read the app page again in the help manual.

Mario

  • IMatch Developer
  • Administrator
  • *****
  • Posts: 23189
Re: Collapsible Metadata Viewer
« Reply #89 on: January 03, 2014, 04:30:24 PM »
An App has access to the IMatch 5 object model. You can do almost everything you can do from a normal script from an App as well. Instead of Basic you use JavaScript to access the object model, but the rest is the same.

This means you can work with the metadata classes, the file and IMImage classes and also the Attribute classes. Check out the sample Apps I provide for more info and the general use of the IMatchLib JavaScript library.

Form simple HTML Templates you can access Attributes via variables, without the need to program or learn the IMatch 5 object model.

If your files have an Attribute Note in the Attribute Set FileInfo, you can display the value of it in your HTML template like:

{File.AT.FileInfo.Note}

Syntax: {File.AT.<Set Name>.<Attribute Name>}

If the set has multiple records for the Attribute (e.g. multiple notes) they are returned in one string, separated by the standard ; separator. You can use a formatting expression to swap ; with something more useful like {cr} or <br/>

See also the Variables help topic for this and more details.

JohnZeman

  • Global Moderator
  • *****
  • Posts: 1191
  • I'm too damn old to act my age.
Re: Collapsible Metadata Viewer
« Reply #90 on: January 03, 2014, 05:47:12 PM »
Thanks for this Mario.  I will definitely look into this when I have some significant free time.  Right now I'm trying to meet an end of the week deadline.

JohnZeman

  • Global Moderator
  • *****
  • Posts: 1191
  • I'm too damn old to act my age.
Re: Collapsible Metadata Viewer
« Reply #91 on: January 04, 2014, 05:43:11 PM »
Got it now. ;)
This turned out to fit right into the way I was writing this script anyway, I just hadn't realized I could access attributes as well as metadata.
Thanks Mario!

JohnZeman

  • Global Moderator
  • *****
  • Posts: 1191
  • I'm too damn old to act my age.
Re: Collapsible Metadata Viewer
« Reply #92 on: January 05, 2014, 12:40:42 AM »
For anyone interested a second collapsible metadata viewer has been added to the zipfile now (the second one has less JavaScript and shows how to use attributes in the viewer).

sinus

  • Global Moderator
  • *****
  • Posts: 3717
  • IMatch-User since 2001 (IMatch 3.6)
Re: Collapsible Metadata Viewer
« Reply #93 on: April 23, 2015, 06:06:16 PM »
2014-01-05: Corrected some obsolete metadata tags in cmv2

Hey John

Your app is very nice, thanks a lot for sharing (though I have still an old version).
I will add some Attributes, so that your app fits my needs.

When I am finished (will take some time  ;)), I will post an image.

Best wishes from Switzerland! :-)
Markus