GNOME Bugzilla – Bug 718542
Use new EXIF rating metadata fields
Last modified: 2013-05-01 06:38:00 UTC
---- Reported by shotwell-maint@gnome.bugs 2012-06-24 11:58:00 -0700 ---- Original Redmine bug id: 5451 Original URL: http://redmine.yorba.org/issues/5451 Searchable id: yorba-bug-5451 Original author: Roumano - Original description: If we note a raw+jgeg file, the note is never puch on the xmp tag of the jpeg file. Related issues: related to shotwell - 4156: Adding a tag to a RAW+JPEG image with metadata writing en... (Open) related to shotwell - 4372: metadata from RAW files is not displayed after they are f... (Fixed) related to shotwell - Feature #3103: view/edit all photo metadata (Open) ---- Additional Comments From shotwell-maint@gnome.bugs 2013-05-01 11:38:00 -0700 ---- ### History #### #1 Updated by Adam Dingle over 1 year ago * **Priority** changed from _Urgent_ to _High_ * **Target version** set to _0.13_ This appears to be related to (or perhaps the same as) 4156. #### #2 Updated by Lucas Beeler over 1 year ago * **Category** set to _4_ * **Assignee** set to _Lucas Beeler_ #### #3 Updated by Adam Dingle about 1 year ago * **Assignee** deleted (<strike>_Lucas Beeler_</strike>) #### #4 Updated by Adam Dingle about 1 year ago * **Target version** changed from _0.13_ to _0.14.0_ #### #5 Updated by Jim Nelson 11 months ago * **Category** set to _raw_ #### #6 Updated by Jim Nelson 11 months ago * **Status** changed from _Open_ to _Need Information_ Roumano, could you be more specific about what piece of metadata you think should be written to the JPEG in XMP? It would be best if you could say the exact XMP field you're asking for. It's quite likely this is fixed with #4372, which was committed earlier today. You can pull Shotwell from our git repo to try it yourself or, if you wait a day or two, install it from our Daily PPA: https://launchpad.net/~yorba/+archive/daily-builds/ #### #7 Updated by Roumano - 11 months ago Hi, Sorry i can't test anymore the git current version as i don't have gstreamer 1.0 (so the make & make isntall don't work actualy) & i don't use a ubuntu OS so your PPA ... For me, with other tools, i have : exiftool picture.jpg : Rating Percent : 40 Rating : 2 The most important is the "Rating". #### #8 Updated by Jim Nelson 11 months ago Roumano, could you upload a picture file that has the ratings set? This will let us see what fields your asking for. From what you say above, it looks to me like you want us to support certain EXIF rating fields, not XMP. Is that correct? #### #9 Updated by Roumano - 11 months ago * **File** shotwell#5451.jpg added As i known the field "Rating" is usual and common on lot of software As i known, shotwell (if not raw+jpg file), xnviewmp, darktable use the rating field I attach a exemple of a picture who is containt's rating xmp field #### #10 Updated by Jim Nelson 10 months ago * **Tracker** changed from _Bug_ to _Bite-sized_ * **Subject** changed from _Raw + Jpg Don't write xmp on the jpeg files_ to _Use new EXIF rating metadata fields_ * **Status** changed from _Need Information_ to _Open_ Ah-ha -- I understand what you're asking for. The attached photo has two new EXIF fields that were either undefined or unknown to use when we implemented Rating support a while back. These fields should be added to our PhotoMetadata class: Exif.Image.Rating SLong 1 2 Exif.Image.RatingPercent SLong 1 40 It looks like the RatingPercent field is simply a reflection of the Rating value (i.e. Rating 4 would be RatingPercent 80). A brief look at the code indicates to me that PhotoMetadata.get_rating() and set_rating() will need a little work to incorporate these, but it shouldn't be too difficult. #### #11 Updated by Jim Nelson 8 months ago * **Target version** changed from _0.14.0_ to _0.15.0_ #### #12 Updated by Jim Nelson 8 months ago * **Target version** changed from _0.15.0_ to _0.16.0_ #### #13 Updated by Joe Bylund 8 months ago * **File** exif_ratings.patch added Roumano, If you get a chance can you take a look at the behavior of this patch? In general how do we want to convert from percent ratings to 0-5 ratings? -Joe #### #14 Updated by Jim Nelson 8 months ago * **Status** changed from _Open_ to _Review_ * **Target version** changed from _0.16.0_ to _0.15.0_ We'll take a look at it too when we start diving into 0.15. Thanks! #### #15 Updated by Joe Bylund 8 months ago Actually, I'm not sure if I like the idea of reading or writing to the RatingPercent field because it's at such a different granularity. I.e. if a user rates a photo 75% in another application and then decides to rate it 3 stars in shotwell should we change the rating to 60%? The rest of it is pretty straight forward though. #### #16 Updated by Jim Nelson 8 months ago That seems about right to me. I don't really like that there's two Rating fields, as it feels like a kind of duplication of data, but so be it. My proposal is that it should work something like this: * When reading, Shotwell uses the Rating field as it does today. If not present, Shotwell falls back to the RatingPercent field, using a transformation that essentially rounds the percentage to a 0-5 scale. We need to investigate how RatingPercent marks rejection -- a negative percent? * When writing, Shotwell updates both fields, converting the stars to a percentage much as you said. When Shotwell has more fine-grained metadata reading and writing (#3103), the user will be free to tweak these values to their heart's content. #### #17 Updated by Joe Bylund 8 months ago * **File** _ratings_2.patch_ added If we do map stars to percents, this seems to make more sense than the first patch I put up. `return Rating.unserialize((int) Math.ceil(int.parse(rating_string)/20)); // convert a 0-100 rating to 0-5` #### #18 Updated by Joe Bylund 8 months ago * **File** deleted (<strike>_ratings_2.patch_</strike>) #### #19 Updated by Lucas Beeler 8 months ago * **Status** changed from _Review_ to _Open_ @Joe: Do you have a proposal for representing rejected photos via the RatingPercent field? If so, could you submit an updated patch that implements it? This is coming along really well so far and there's no question that we should use these standard EXIF fields. That said, "rejected" photos are a core concept in Shotwell and we really like to be able to represent this using the the two EXIF ratings fields, especially in a way that doesn't break interoperability with other applications. #### #20 Updated by Joe Bylund 8 months ago Quoting from here: http://u88.n24.queensu.ca/exiftool/forum/index.php?topic=3567.0 > If you change the rating of a file in Windows Explorer on Windows 7, the existing EXIF:rating is removed and instead an XMP rating is added. XMP:rating and XMP-microsoft:Rating Percent are set as follows: > > Rating / Rating Percent 1 / 1 2 / 25 3 / 50 4 / 75 5 / 99 > > you cannot reject (-1) a file in Windows Explorer. > > If you modify the rating for such a file in, for example, Adobe Bridge, the xmp-microsoft:RatingPercent rating is removed.. An existing EXIF:rating is not touched. So, Microsoft removes the EXIF:rating. Adobe removes the xmp:RatingPercent. So a) we should probably use that mapping (because it's the defacto standard), b) there is no provision for "rejected" photos, but negative numbers are still free, so it makes sense to use -1 for rejected in all fields, when I look at this I'll verify it doesn't behave badly in windows. #### #21 Updated by Lucas Beeler 8 months ago @Joe: > so it makes sense to use -1 for rejected in all fields, when I look at this I'll verify it doesn't behave badly in windows. Works for me! Feel free to submit a updated patch implementing this behavior whenever! #### #22 Updated by Lucas Beeler 8 months ago * **Category** changed from _raw_ to _metadata_ #### #23 Updated by Joe Bylund 7 months ago * **File** exif_ratings_1103.patch added * **% Done** changed from _0_ to _10_ This uses the conversion table above and writes -1 for rejected photos. #### #24 Updated by Lucas Beeler 7 months ago * **Status** changed from _Open_ to _Review_ #### #25 Updated by Lucas Beeler 7 months ago * **Tracker** changed from _Bite-sized_ to _Feature_ #### #26 Updated by Anonymous 7 months ago * **Status** changed from _Review_ to _5_ Applied in changeset 698131088d8c7ff2cfae4577e8104ca507e19b23. #### #27 Updated by Lucas Beeler 7 months ago * **Resolution** set to _fixed_ #### #28 Updated by Charles Lindsay 7 months ago * **Status** changed from _5_ to _Fixed_ --- Bug imported by chaz@yorba.org 2013-11-25 21:57 UTC --- This bug was previously known as _bug_ 5451 at http://redmine.yorba.org/show_bug.cgi?id=5451 Imported an attachment (id=262394) Imported an attachment (id=262395) Imported an attachment (id=262396) Unknown milestone "unknown in product shotwell. Setting to default milestone for this product, "---". Setting qa contact to the default for this product. This bug either had no qa contact or an invalid one. The original submitter of attachment 262395 [details] [review] was joseph.bylund+shotwell@gmail.com, but he doesn't have an account here. Reassigning to the person who moved it here: chaz@yorba.org. The original submitter of attachment 262396 [details] [review] was joseph.bylund+shotwell@gmail.com, but he doesn't have an account here. Reassigning to the person who moved it here: chaz@yorba.org.