INTERACT FORUM

Please login or register.

Login with username, password and session length
Advanced search  
Pages: [1]   Go Down

Author Topic: Accessing MC's photo data  (Read 7106 times)

jwaters

  • Regular Member
  • Recent member
  • *
  • Posts: 38
  • nothing more to say...
Accessing MC's photo data
« on: June 06, 2005, 03:17:23 pm »

I've just been working on getting my photos ready to upload to the web.  I haven't decided yet if I'm going to use my own website, or a sharing service (Flickr seems like my best choice, so far).   I have a large collection - several thousand photos -- all meticusouly tagged, captioned, and organized in MC.

I've been writing software that grabs the MC metadata and populates IPTC fields from my Media Center tags.  I'm writing the software in PHP -- running it on my personal web server.  The software currently writes to IPTC fields, but could just as easily write this metadata to a database, such as a MySQL Coppermine database.

By getting MC fields into IPTC fields, I can upload to a site like Flickr, and my keywords and captions are automatically with the photo.  I can also load the images into Photoshop Elements, Picasa,  or any other photo management application that uses industry standard metadata fields (IPTC, XMP), and all the captions, and categorization data is automatically there.

It has occured to me that this is a piece of software that the communicty at large could use.  I'm very happy to see open discussions around Photo sharing!
Logged

johnnyboy

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 626
Accessing MC's Photo Database
« Reply #1 on: June 06, 2005, 03:20:55 pm »

Funny... I've just been working on getting my photos ready to upload to the web.  I haven't decided yet if I'm going to use my own website, or a sharing service (Flickr seems like my best choice, so far).   I have a large collection - several thousand photos -- all meticusouly tagged, captioned, and organized in MC.

I've been writing software that grabs the MC metadata and populates IPTC fields from my Media Center tags.  I'm writing the software in PHP -- running it on my personal web server.  The software currently writes to IPTC fields, but could just as easily write this metadata to a database, such as a MySQL Coppermine database.

By getting MC fields into IPTC fields, I can upload to a site like Flickr, and my keywords and captions are automatically with the photo.  I can also load the images into Photoshop Elements, Picasa,  or any other photo management application that uses industry standard metadata fields (IPTC, XMP), and all the captions, and categorization data is automatically there.

It has occured to me that this is a piece of software that the communicty at large could use.  I'm very happy to see open discussions around Photo sharing!

I'd be hugely interested in that if you'd care to share it?

Could you extend it to do the opposite?
To read from those programs (or Adobe Photo Album, etc) and then save the tags to MC?
They're alot easier to tag in, but the panes could work great for browsing?

Logged

jwaters

  • Regular Member
  • Recent member
  • *
  • Posts: 38
  • nothing more to say...
Accessing MC's Photo Database
« Reply #2 on: June 06, 2005, 03:42:29 pm »

I'd be hugely interested in that if you'd care to share it?


I'd be happy to share, but right now it's nowhere near ready for general use.... For example, making it do anything currently requires me going into the code to specify what tags to look for, and where to write them to.

I would need to put some sort of front-end around it.  I've thought many times that this would make a great plug-in for MC.  The problem is that I'm not much of a programmer... more of a hacker, really (everything I've written basically comes from code snippets that I've found on various programming forums).  To make a plugin, I guess you'd need a real programming language - C, VB, etc.

I've been able to accomplish some cool things using PHP because there's some free libraries for reading/writing JPEG metadata.  I'm not sure if the same resources are available for other languages.

Could you extend it to do the opposite?
To read from those programs (or Adobe Photo Album, etc) and then save the tags to MC?
They're alot easier to tag in, but the panes could work great for browsing?

Using my PHP system... probably not.  If this were written as a plugin, using the SDK, this would be entirely possible.

I'm curious to find out how much interest there may be in such an effort... That is, a plugin to write MC metadata into IPTC fields or to a photo sharing database?
Logged

JustinChase

  • MC Beta Team
  • Citizen of the Universe
  • *****
  • Posts: 3276
  • Getting older every day
Accessing MC's Photo Database
« Reply #3 on: June 06, 2005, 11:41:12 pm »

I'm curious to find out how much interest there may be in such an effort... That is, a plugin to write MC metadata into IPTC fields or to a photo sharing database?

I would love the opposite too.  I am using Thumbs Plus to organizing/tagging/resizing etc.  I want to use MC, but it just isn't ther yet.  i do want to use it once everything is tagged though, and your app would be great to get me up and running.
Logged
pretend this is something funny

jwaters

  • Regular Member
  • Recent member
  • *
  • Posts: 38
  • nothing more to say...
Re: Accessing MC's photo data
« Reply #4 on: June 07, 2005, 10:12:50 am »

A couple months ago, I started on a project to digitize all my family's old photo albums.  I bought a  scanner with a negative feeder, and a automatic print feeder.  I have since scanned over 2000 photos.  Every photo in my library is tagged with captions and any best-known people, locations, dates.  Since many of these images are historic (people and places I don't recognize), the metadata associated to the photo is as important as the image itself.

I evaluated many photo managers, including Photoshop Elements, Picasa, and ThumbsPlus.  I really liked ThumbsPlus -- especially the MS Access database, and some advanced power-user features.

However, in the end, I found that Media Center was the my favorite strictly for tagging and organizing these photos.  There's alot of value-add features that the others have, areas that MC is lacking.  Ideally, I want to pick and choose what tools I use for what task, and when something new comes along, I want to be able to use it without being locked into a particular application, with full access to my image metadata.

That is the reason for this project... extracting the MC metadata tags and transforming them into metadata useable by other applications (most read IPTC fields -- so that's where I'm starting).  I'm quite happy with the process for entering the tags in MC, so I don't have much need for the reverse (importing IPTC to MC tags) -- although so far, it looks like I'm in the minority.
Logged

johnnyboy

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 626
Re: Accessing MC's photo data
« Reply #5 on: June 07, 2005, 11:58:22 am »

If you want to see a VERY good tagger - have a look at Microsoft's digital image suite - u just literally paint brush the tags onto each image - sooo intuitive, fast and easy. One click on a photo and it instantly has whatever your tagging with at that moment.
Logged

jwaters

  • Regular Member
  • Recent member
  • *
  • Posts: 38
  • nothing more to say...
Re: Accessing MC's photo data
« Reply #6 on: June 08, 2005, 03:32:27 pm »

I put a front end on my utility, so I'm almost ready to post it.   This is written in PHP -- it's not a regular Media Center plugin.  You need to be running a web server with PHP enabled.  I'm running Apache (using a WAMP installation)

marko / johnnyboy - Are either of you running a web server to try it out?
Logged

jwaters

  • Regular Member
  • Recent member
  • *
  • Posts: 38
  • nothing more to say...
Re: Accessing MC's photo data
« Reply #7 on: June 08, 2005, 04:21:24 pm »

OK -- remember that the image files that you want to write IPTC to needs to be on the webserver (or at least in the web publishing path)  In other words, you can't update files on your home pc if the utility is running on your web host.

I'll try to get a sample posted soon.
Logged

johnnyboy

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 626
Re: Accessing MC's photo data
« Reply #8 on: June 08, 2005, 05:27:09 pm »

I'm not running one at current but they are easy to setup and I planned to anyway.

Also, why do we need to be running a web server?
PHP by itself is fully capable of being called from a command line to parse a page, apache doesn't need to be used at all (or any other web server).

I'm definitely hugely interested in this, and also in the snippets you used for the code?
If it's PHP I presume its just going to be a simple page so extremely easy for us to tweak it ourselves?
Logged

IlPadrino

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 496
Re: Accessing MC's photo data
« Reply #9 on: June 09, 2005, 07:12:52 am »

OK -- remember that the image files that you want to write IPTC to needs to be on the webserver (or at least in the web publishing path)  In other words, you can't update files on your home pc if the utility is running on your web host.

I'll try to get a sample posted soon.

I'd love to try this out...  I have access to my webserver (which is on the same machine as MC) and am also running WAMP.  Will you please post the code somewhere publicly available?
Logged

IlPadrino

  • MC Beta Team
  • Galactic Citizen
  • *****
  • Posts: 496
Re: Accessing MC's photo data
« Reply #10 on: June 09, 2005, 07:18:53 am »

Bottom line for me:  getting my MC metadata embedded into the images as IPTC or XMP (which, if I understand correctly, is the "new" IPTC) is a huge benefit.  As much as I like MC, I don't want to be tied to a single application.  For example, if Coppermine has IPTC support (which it does), then I should be able to get at MC metadata once it's embedded as IPTC.

I'd hoped that JRiver would eventually get IPTC or XMP support - until then, I wasn't ready to do all my tagging in MC.  Now it sounds like I may not have to wait!
Logged

JimH

  • Administrator
  • Citizen of the Universe
  • *****
  • Posts: 72380
  • Where did I put my teeth?
Re: Accessing MC's photo data
« Reply #11 on: June 09, 2005, 07:20:40 am »

We'll revisit photo tagging after MC11 is released. 

Coppermine will read and display IPTC and EXIF tags so we'll see if we can get one of these working.
Logged

jwaters

  • Regular Member
  • Recent member
  • *
  • Posts: 38
  • nothing more to say...
Re: Accessing MC's photo data
« Reply #12 on: June 09, 2005, 09:57:00 am »


Also, why do we need to be running a web server?
PHP by itself is fully capable of being called from a command line to parse a page, apache doesn't need to be used at all (or any other web server).

I'm definitely hugely interested in this, and also in the snippets you used for the code?
If it's PHP I presume its just going to be a simple page so extremely easy for us to tweak it ourselves?

How can a PHP page be called from a command line without serving it from a web server?

But, yes it will be fully 'tweakable' for anyone that wants to get into the code.  I've tried to add comments as much as possible.  I've actually added a nice little interface, and I'm making some of the items configurable through simple XML files that can be edited with notepad.
Logged

johnnyboy

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 626
Re: Accessing MC's photo data
« Reply #13 on: June 09, 2005, 10:15:11 am »

You just call the actual path to the php program itself.

Say you've installed php in:  c:\php\php.exe for instance.
And your script is:  d:\scripts\mc_photos.php

U simply do the following in a command prompt:
c:\php\php.exe d:\scripts\mc_photos.php

and it'll process the php page.
php is primerily used as a web server programming language but it can also be used just as a stand alone programming language without needing a web server.

It's alot more powerful than people give it credit for.
Logged

jwaters

  • Regular Member
  • Recent member
  • *
  • Posts: 38
  • nothing more to say...
Re: Accessing MC's photo data
« Reply #14 on: June 09, 2005, 01:01:05 pm »

You just call the actual path to the php program itself.


This sounds interesting.  Can you pass it parameters through the command line?  My utility relies on HTML forms and POST data.  However, making it able to be launched from a command line would greatly expand the potential usefulness and audience for it.  We could add a Media Center "send to" option  where you selected some images, right click, select send to IPTC writer.

Anyway, I'm working on posting my code and some screenshots now.
Logged

jwaters

  • Regular Member
  • Recent member
  • *
  • Posts: 38
  • nothing more to say...
Re: Accessing MC's photo data
« Reply #15 on: June 09, 2005, 01:20:59 pm »

OK, here's a zipped copy of the files for anyone who would like to help me test this software.

Download file here - http://www.jasonwaters.net/MCIPTC/MCIPTC.zip

It is a web-based utility, written in PHP, and requires PHP 5+.  It will not work on earlier versions of PHP.  If anyone needs a web server to run this with, try out WAMP server - http://www.wampserver.com/en/index.php - that is what I'm using -- a very easy to install all-in-one package that sets up a web server on your PC.

Once you have a web server to run this on,  just unzip these files under the "www" directory, or wherever you root web directory is.   You will then need to place the image files that you want to work with somewhere under this directory.

Here are some screenshots:








Logged

Michel Lefebvre

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 281
Re: Accessing MC's photo data
« Reply #16 on: June 10, 2005, 02:08:56 pm »

I downloaded and installed both but not knowing anything about PHP, it's unclear to me how I can start the program.

When I fire up Index.htm in the root (www), I get the UI but when I go to step 2 to scan for images, it just stays there doing nothing. So I'm assuming I have to start some process...

Thanks!

Michel.
Logged

jwaters

  • Regular Member
  • Recent member
  • *
  • Posts: 38
  • nothing more to say...
Re: Accessing MC's photo data
« Reply #17 on: June 10, 2005, 03:55:05 pm »

There's no processes that need to be started up.  You're doing everything correct if you see the GUI.
Do you know what version of PHP you're running?  If it is 4.x, Page 1 stops after it reads " Scan for tagged images".  My internet host still runs version 4.3.10, and the same thing happens. You need to have PHP 5.x

I just tried a default install of the latest WAMP server, then unzipped my files into the www dir, and everything works OK.

Let me know if you need help determining the version.

Logged

johnnyboy

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 626
Re: Accessing MC's photo data
« Reply #18 on: June 11, 2005, 05:20:37 am »

To make it easier for everyone, you should probably make the script do a quick test of which version of php it is running.

if(phpversion() < 5) print "Sorry. You need to update your version of PHP. You are currently running v." . phpversion() ." and v5 or higher is needed."
Logged

jwaters

  • Regular Member
  • Recent member
  • *
  • Posts: 38
  • nothing more to say...
Re: Accessing MC's photo data
« Reply #19 on: June 11, 2005, 08:56:48 am »

johnnyboy - good idea. I'll try to get something like that in there.

Also, based on your comments earlier about running PHP from the command line, I'm exploring ways to get this to run w/out a web server.  I did some google-ing and even found a couple of PHP compliers that will turn PHP code into self-running EXE's, which I think eliminates the need to even have PHP installed.  This is pretty cool stuff, but I haven't tried anything yet.

If I could get this running with a simple EXE or command line script, is there anyone who could help me build the UI as a real MC plug-in?  I wouldn't even know where to begin. (the SDK is over my head -- I"m mostly just a web guy who has figured out some neat things to do with PHP)
Logged

johnnyboy

  • Regular Member
  • Citizen of the Universe
  • *****
  • Posts: 626
Re: Accessing MC's photo data
« Reply #20 on: June 13, 2005, 04:24:33 am »

You don't even need to get it running as an .exe as far as I know to build a proper GUI for it.
You can simply build a GUI for it now and have the GUI calling the php executable with the pages you want that contain the script. Obviously it makes it trickier as you'll have to read in the outputs etc.

I had a look over the weekend to see if I could find any components that were pre-built for reading and writing to these tags using VB.net but couldn't find any decent ones, all I could find were a few shareware ones :(
Logged

Michel Lefebvre

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 281
Re: Accessing MC's photo data
« Reply #21 on: June 13, 2005, 02:15:56 pm »

There's no processes that need to be started up.  You're doing everything correct if you see the GUI.
Do you know what version of PHP you're running?  If it is 4.x, Page 1 stops after it reads " Scan for tagged images".  My internet host still runs version 4.3.10, and the same thing happens. You need to have PHP 5.x

I just tried a default install of the latest WAMP server, then unzipped my files into the www dir, and everything works OK.

Let me know if you need help determining the version.



Thanks for your help.

I checked and PHP 5.x is installed. Maybe it's in how I start it. Should I double-clicking  C:\wamp\www\MCIPTC\index.html from Windows Explorer? That's what I do.

Or could it be that my pictures are in the wrong folder? I tried C:\wamp\www\0-pictures\year\event\PicName.jpg,

then C:\wamp\www\PicName.jpg

and finally C:\wamp\www\MCIPTC\0-pictures\year\event\PicName.jpg.

It never sees my pictures...

Michel
Logged

jwaters

  • Regular Member
  • Recent member
  • *
  • Posts: 38
  • nothing more to say...
Re: Accessing MC's photo data
« Reply #22 on: June 13, 2005, 08:11:41 pm »

Michael - try going to http://localhost/MCIPTC instead of clicking index.html from windows explorer.  You're opening the file, but your web server is not 'serving' it.

Here's some quick instructions once you have installed WAMP and extracted the zip file into the www directory.

Assuming your root web directory is at:
C:\wamp\www
And you extracted my files into
C:\wamp\www\MCIPTC
There are some test images in
C:\wamp\www\MCIPTC\images -- you can add yours here to make it easy.


Make sure WAMP Server is started.

Open your browser, and go to http://localhost/MCIPTC

Click Step 1.  Click Scan Now.

It should find the 3 test images.  Click Proceed to step 2.

Click Proceed to Step 3.

Now, you can open the files in Photoshop or your favoirte image editor, and view your MC metadata.
Logged

Michel Lefebvre

  • Regular Member
  • Galactic Citizen
  • ****
  • Posts: 281
Re: Accessing MC's photo data
« Reply #23 on: July 27, 2005, 09:28:32 am »

I finally had some some time to try this again last night and I may have found a clue why things are not working right for me.

Is it possible that the program does not like MC fields that have a "?" in them? I have several fields that are filled by "Y/N" such as "Cropped ?" or "Original?" etc...

Thanks.

Michel.
Logged
Pages: [1]   Go Up