40 Commits

Author SHA1 Message Date
Lawrence37
98752a2433
Merge pull request #7257 from Beep6581/fix-warnings-5.12
Compiler warning fixes
2024-12-26 22:26:11 -08:00
Lawrence Lee
2a91962c48
Fix usage of deprecated Exiv2 function
Exiv2::enableBMFF() is deprecated as of v0.28.3. Only the CMake flag
EXIV2_ENABLE_BMFF is required to enable BMFF support.
2024-11-19 23:35:07 -08:00
Daniel Gao
711f274403 Get rid of relative include paths
* Use target_include_directories to specify include paths
* Specify project root (parent of rtgui and rtengine) as include path
* Replace relative includes with normal includes
2024-11-16 17:20:02 -05:00
Lawrence37
f2c613c8f8
Merge pull request #7046 from blitzgneisserin/patch-5
Add correct DateTime (editing date) to Exif data
2024-05-27 11:13:54 -07:00
Anna
b7749c0719
Add correct DateTime to Exif date 2024-05-02 09:59:47 +02:00
Anna
1aea652fea
Add correct DateTime (editing date) to Exif data
Currently, RT does not save the editing date (Exif tag DateTime) in the exif data of the exported files, only DateTimeOriginal (the date/time the photo was captured). This patch fixes this.
2024-04-18 16:48:08 +02:00
Anna
a1eaa8f64e
fix ModifyDate 2024-04-18 15:12:42 +02:00
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
Lawrence Lee
0ac49e4d9a
Support Exiv2 >= v0.28.0
The various Datum classes no longer have the toLong method and must be
replaced with toInt64.
ErrorCode is an enum class instead of an enum.
Error classes are reduced to Exiv2::Error.
2023-05-13 16:43:47 -07: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
2ce81cccc5
metadata: fixed glitches in importing IPTC tags
(cherry picked from commit 3d03f654e22ca01f058492eab2c8fcbc564dc1b9)
2022-12-10 11:00:40 -08:00
Alberto Griggio
77d1bc2cb1
metadata: use exiv2 to handle BMFF files (e.g. CR3) if supported
(cherry picked from commit 1469a0a8225cb44fe7f130f375879aef23496a8b)
2022-12-10 10:53:23 -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
939315f67b
metadata: do not exclude tags that were explicitly selected by the user
(cherry picked from commit 60d862fa72046ecf8f44c2a1677f72237e86e838)
2022-12-10 10:43:55 -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
d16bc6f6ea
metadata: do not copy Exif tags with 0 count
Tentative fix for #147

(cherry picked from commit 12f699df10c1c0854c0e882db151560a1f4f3a26)
2022-12-10 10:39:11 -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
1e0cf45445
metadata: use copyXmpTo* instead of moveXmpTo*
(cherry picked from commit d3ac9618f8a3e2688f7a084419eeebbe24a76664)
2022-12-10 09:52:43 -08:00
Alberto Griggio
6cec805774
metadata: try to be more robust when saving
Tentative fix for #89

(cherry picked from commit a8b53fef753c7a1146013feeb66be87c688b8631)
2022-12-10 09:51:16 -08:00
Alberto Griggio
700eeccb39
metadata: don't raise error if exif is empty when opening an image for saving
Fixes #79 (regression introduced by 26b8860d4bb803cff0277c7b2353b58b5e02fbc6)

(cherry picked from commit 62ae8e15b8ca07cbe545ed42c323e986448c3213)
2022-12-10 09:50:50 -08:00
Alberto Griggio
6224921843
metadata: workaround for misbehaviour of exiv2 on ubuntu 20.04
(cherry picked from commit 26b8860d4bb803cff0277c7b2353b58b5e02fbc6)
2022-12-10 09:49:37 -08:00
Alberto Griggio
30e77ee96f
fixed compilation error with Apple Clang 7.0.0
(cherry picked from commit dd5b10d9dc8eb7447e37ac30ddd7545897c878b0)
2022-12-10 09:44:24 -08:00
David Hunt
7c9726ddbe
metadata: use std::unique_ptr instead of Exiv2::Image::AutoPtr
Fixes #55

(cherry picked from commit 9466fc133f1af465a784a7384cf0369d7c35b901)
2022-12-10 09:35:23 -08:00
Alberto Griggio
b92e77fb96
improved support for metadata editing
(cherry picked from commit 85da0b51ecf7ece768c0267aead71dd94404d4dc)
2022-12-09 22:35:26 -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
9735ba5768
metadata: preserve standard exif tags (accidentally broken by 7310eb64978bb1138edbdf02fa58fb64a9326e17)
(cherry picked from commit 75a49b8cb9db957dfe13e6911dcf6c83bb92045d)
2022-12-05 21:37:57 -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
dcc00b40d1
metadata: do not include makernotes on export
Fixes #31

(cherry picked from commit 3a8d8ece897eb4df61887160a30722bd07a77174)
2022-12-05 21:35:12 -08:00
Alberto Griggio
e205ff86cc
fixed compilation problem with exiv2 < 0.27
(cherry picked from commit b4d178fdab61814be8ab93f0ecd7d74f78c4087f)
2022-12-05 21:23:46 -08:00
Alberto Griggio
200779aa84
metadata: better error handling
(cherry picked from commit 0e26c15a730854883ae31d164b460d70393c2848)
2022-12-05 21:23:26 -08:00
Alberto Griggio
e90ffe979b
metadata: catch std::exception instead of Exiv2::AnyError for better robustness
(cherry picked from commit 0e2d9332f633b060bd4d5cbcd9d47009bab0c46c)
2022-12-05 21:19:21 -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
25d67c12c1
metadata: remove unwanted tags *after* merging XMP sidecars, not before
(cherry picked from commit b45666f61ac9c6083bdc22811351d72bf35497bb)
2022-12-04 17:09:15 -08:00
Alberto Griggio
7c39f35317
metadata: removed some harmful tags from the exported images
(cherry picked from commit 94c3e87113384f4c20b10f467a1c35e90709d161)
2022-12-04 17:08:53 -08:00
Alberto Griggio
38d87bae72
metadata: keep makernotes
(cherry picked from commit 494ae069d4f9d985b65375e104513f9c85453d5b)
2022-12-04 16:29:57 -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
2d412d7404
metadata: do not copy exif rotate info from the original image -- it might just be plain wrong
(cherry picked from commit 8f14684588b3c0aec1aab37f4225c99954f6f587)
2022-12-04 16:26:14 -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