Star Rating in Tags?

jeffmcclain

Joined: 2010-09-01
Posts: 105
Posted: Wed, 2011-04-27 04:13

Been trying to hack the XMP module to be able to parse out the xmp:Rating or the MicrosoftPhoto:Rating tag in the jpeg image to route it into the tags as (3Stars, 4Stars...etc), and have everything working, except the dang library won't pick up the XMP tag. I've heavily modified XMP module to make it much more stable and parse a lot more missing tags over the last 6 months. Fixed a bunch of bugs.

Anyway, let me know if anyone can help with this. Seems like this is the best way to get star ratings working short term...yeah, I could add the tags manually to the photos sorted by stars in WLPG, but that seems a bit extreme and could easily become "disjointed" from the actual star rating...

-Jeff

 
tkott

Joined: 2010-06-07
Posts: 225
Posted: Wed, 2011-04-27 14:03

Hi Jeff,

Glad to hear you've improved on the XMP module!

Quote:
except the dang library won't pick up the XMP tag

Could you explain that one a bit more? Or could you possibly post your work so that I could have a look at your implementation?

Thanks,

Tomek
----
Publish on Gallery 3 (WLPG Plugin) | XMP Module

 
jeffmcclain

Joined: 2010-09-01
Posts: 105
Posted: Wed, 2011-04-27 22:04

Yup. Tomek, I posted most of my changes (based on my JPG's trying to process) on the XMP Module thread. Never did see any response on trying to roll in the fixes/changes. I'll post an update of the work I'm trying to do to pick up the star rating from the <xmp:Rating> tag just recently. Appreciate any insight you have on the library JPEG module (I've had similar frustration getting it to pick up Microsoft Photo tags. Let me get the code when I get home...

Jeff

 
tkott

Joined: 2010-06-07
Posts: 225
Posted: Thu, 2011-04-28 01:06
Quote:
Never did see any response on trying to roll in the fixes/changes.

Oops. Sorry about that. I think at the time I put it in the back of my head to update, and then never got around to it. Sigh. I'll carve out some time this weekend at the latest to finally look through all that! Thanks.

Tomek

PS. Have you ever used Fossil for your version control? I'm growing to quite like it and am thinking of putting it on my site with the two projects as two repositories.

----
Publish on Gallery 3 (WLPG Plugin) | XMP Module

 
jeffmcclain

Joined: 2010-09-01
Posts: 105
Posted: Thu, 2011-04-28 03:39

Here is a zip of all the latest changes. Don't think I've broken the face tags, but not sure, as I don't use those. The "rating" sub call in the xmp.php file is where I started trying to have it fold in the star ratings to a tag...it all works, except it wont capture the jpg parse...

Jeff

AttachmentSize
xmp.zip134.48 KB
 
tkott

Joined: 2010-06-07
Posts: 225
Posted: Tue, 2011-05-03 16:00

Jeff,

I've merged most of your changes into the original code -- thanks for the updates to the xmp re-reading task. You can see the code and repository here: http://kott.fm/cgi-bin/fossil/xmp/home. This is a fossil repository.

The problem with finding the ratings was one of the two following things:
1) You were looking at "http://ns.adobe.com/xap/1.0/\x00" where you should have been looking at "http://ns.adobe.com/xap/1.0/"
2) OR, you needed Image_JpegXmpReader::MARKER_NS instead of MARKER_NS.

I'm not sure because I changes some things around to not have to modify the JpegXMPReader class at all. You can take a look at all the code changes by browsing the timeline (linked above). You will need to log in as an anonymous user to see the links.

The newest version is attached. If it works on all your test pictures, let me know, and I'll merge it with the trunk and release it!

Tomek
----
Publish on Gallery 3 (WLPG Plugin) | XMP Module

AttachmentSize
xmp.zip85.7 KB
 
jeffmcclain

Joined: 2010-09-01
Posts: 105
Posted: Tue, 2011-05-03 23:14

Thanks, Tomek.

I'm going to give that a shot right now. I suspect it was creating the local const definitions, as I had already tried changing the values (temporarily) in JpegXmpReader for the \x00 with no help. Next on the list (if this works) is probably helping to get me back on track parsing a LOT of things...namely, trying to see if I can get it to parse the WLPG "Geo Tag" places and put those into tags too! Yay! Will let you know how your edits go.

-JM

 
tkott

Joined: 2010-06-07
Posts: 225
Posted: Wed, 2011-05-04 01:15
Quote:
WLPG "Geo Tag" places and put those into tags too!

Out of curiosity, is there a reason you don't want to use EXIF-GPS for that? I set the GPS coordinates in WLPG and they seem to be interpreted fine by that!

Tomek

----
Publish on Gallery 3 (WLPG Plugin) | XMP Module

 
jeffmcclain

Joined: 2010-09-01
Posts: 105
Posted: Wed, 2011-05-04 03:58

Yeah, no, that is fine, I just thought WLPG interpreted the GPS location and put a nearby city/state/country tag on the photo (only because it seems to take WLPG a LONG time to have it updated the first time you tag a bunch of photos, but then it is always there). But I guess, it could be doing the Geo location dynamic from the GPS location every time? Hum. Well, then we need a module in Gallery 3 that does the same interpolation of the GPS to city that WLPG does. :)

 
jeffmcclain

Joined: 2010-09-01
Posts: 105
Posted: Fri, 2011-05-06 01:27

ok...now I probably want to add the year and month to the tag creation process to make it a searchable/filter option...grin.

 
tkott

Joined: 2010-06-07
Posts: 225
Posted: Fri, 2011-05-06 13:58
Quote:
ok...now I probably want to add the year and month to the tag creation process to make it a searchable/filter option...grin.

Does that mean that the current version works?

I think I need to develop an admin page that allows you to pick and choose which XMP items are scanned -- so that you can get the date and star information in tags, while I don't care about those, so I won't :)

Tomek

----
Publish on Gallery 3 (WLPG Plugin) | XMP Module

 
jeffmcclain

Joined: 2010-09-01
Posts: 105
Posted: Sat, 2011-05-14 23:42

Sorry, yes. It works great with my additions and with your fixes to the const XMP scan strings. Thanks!