13 Commits

Author SHA1 Message Date
Simone Gotti
1098966a8b Add optional image rank/color load/save from/to xmp sidecar
Add optional ability to load/save image rank property from/to xmp
sidecar "xmp.Rating" and color property from xmp "xmp.Label" ignoring
the ones provided in the processing params file.

This behavior is disabled by default and an option under settings ->
file browser has been added to enable it.

When enabled:

* On load:
  * rank and color are not read from processing params.
  * rank is mapped from xmp sidecar file rating entry.
  * color is mapped from xmp sidecar file label entry.

* On save:
  * rank and color are saved to the xmp sidecar
  * rank and color are also saved to the processing param (pp3) files to
    keep them in sync

Rating mapping:

Since rating can be also -1 but rank only goes from 0 to 5, the -1 value
is ignored like already done when importing from embedded xmp data.

Color mapping:

XMP has no color concept, usually programs like digikam uses the label
field to write a color name ("Red", "Orange"). The problem is that this
isn't standardized and label can be any string. Additionally Rawtherapee
has 5 specific colors while other programs can have different colors
with different name so they won't be shown if they don't map to the 5
color names supported by rawtherapee. On save only the 5 color supported
by rawtherapee wil be saved.

Trash is kept only in the profile files for multiple reasons:

* There's no trash concept in xmp, there's the rejected concept assigned
  to a rating == -1.
* We could map rejected to trash but in rawtherapee rank and trash are two different values and
  an image can have both rank >= 0 and trashed set to true.
  Using an unique value like rating for rank and trash (when -1) will
  require changing the current rawtherapee logic.
* Also digikam only handles ratings from 0 to 5 (no -1) and handles
  trash in its own internal way without reflecting it in the xmp
  sidecar.
2024-04-03 20:06:14 +02:00
Alberto Griggio
09d72259e3
take care of some warnings
Fixes #223

(cherry picked from commit f5bc793aa1efcba183602de3eec4746f4da3db8e)
2022-12-10 11:54:44 -08:00
Alberto Griggio
b409e0bab2
fixed handling IPTC metadata that admit multiple values
(cherry picked from commit 8becb08ec1417215bf8f02c54000d37c2e6920f0)
2022-12-10 11:54:43 -08:00
Alberto Griggio
522f6f4473
metadata: make sure to include XResolution and YResolution when writing TIFFs
This is mandatory (according to http://dpfmanager.org), and in fact needed for
Photoshop compatibility

(cherry picked from commit 5d281810cc7a7f7dc563dde030cf90c78dbf55d0)
2022-12-10 10:46:29 -08:00
Alberto Griggio
3d209e687d
metadata: filter out unwanted tags when syncing with xmp sidecars
(cherry picked from commit 239f3f59b931efb15482134fffd5f6065616e574)
2022-12-10 10:41:15 -08:00
Alberto Griggio
92befa7e81
refactored code for extracting image dimensions from metadata
(cherry picked from commit 0ece9c5bfad09bc9052238d83fa696ef39effaaa)
2022-12-10 10:37:58 -08:00
Alberto Griggio
322e709bcb
metadata: do not accidentally remove exif tags when embedding the arp sidecar in XMP
Fixes #127

(cherry picked from commit 49cbe9bd19db558a4be36221472cbb5e78aa95a2)
2022-12-10 10:01:15 -08:00
Alberto Griggio
abb052e51b
metadata: allow to select which metadata tags to include in the output image
(cherry picked from commit ed64206cb8b4455870815e2c51aecbd5c09e4054)
2022-12-06 22:08:23 -08:00
Alberto Griggio
c1719fbd7d
metadata: better handling of makernote tags
Tentative fix for #37

(cherry picked from commit 7310eb64978bb1138edbdf02fa58fb64a9326e17)
2022-12-05 21:36:32 -08:00
Alberto Griggio
e7fdad875a
metadata: cache recent files for faster operation
(cherry picked from commit 6ee014ddb7ab77537289e1f41f13345e5db54710)
2022-12-04 17:27:02 -08:00
Alberto Griggio
77d7e633e5
metadata: erase also jpeg thumbnail
(cherry picked from commit 88661755506cd48393e69e809cf0559572cb213d)
2022-12-04 16:29:38 -08:00
Alberto Griggio
a4b0801646
fixed bugs in metadata saving
(cherry picked from commit 880b1d3d865a7820051cf3023cc58802daca28b0)
2022-12-04 16:13:04 -08:00
Alberto Griggio
1a771fa211
more work on synchronizing metadata with xmp sidecars
(cherry picked from commit 81bbff6e6ae87bd35e8050a1cc621297ca24939b)
2022-12-04 15:55:09 -08:00