140 Commits

Author SHA1 Message Date
Lawrence Lee
1885f5d489
Improve proc params clear when XMP sync enabled
Always check the rank and color label in the XMP if XMP sync is enabled
when clearing the processing parameters. Allows the pp3 to be deleted
whenever possible, even if the rank or color label has been edited.
2025-01-20 12:53:07 -08:00
Lawrence Lee
367041e2e6
Fix processing params clear when XMP sync enabled
Fix caching of XMP when clearing processing parameters so that it knows
if the pp3 can be deleted without affecting the rank and color labels.
2025-01-20 12:49:36 -08:00
Lawrence Lee
187a0318d3
Fix pp3 deletion when clearing processing params
Fix comparison of original vs. current rank. The rank value can be -1,
which should be interpreted as 0. This allows proper assessment if the
rank has been changed. The pp3 is deleted if and only if the rank, color
label, and trash status are unchanged. pp3s were not getting deleted
because of the mismatch between the original rank (-1) and current rank
(0).

Also consider the rank and color label in the metadata and XMP sidecars.
If the rank and color label have not been edited in the current session
and the current values match the ones in the metadata and XMP sidecars,
the pp3 can be deleted.
2025-01-18 18:01:30 -08:00
Lawrence37
98752a2433
Merge pull request #7257 from Beep6581/fix-warnings-5.12
Compiler warning fixes
2024-12-26 22:26:11 -08:00
Lawrence37
ed7f2d0690
Merge pull request #7255 from digitalcarp/cleanup-includes
Get rid of relative include paths
2024-12-26 22:25:58 -08:00
Lawrence Lee
cf20964b59
Fix compiler warnings 2024-11-17 15:39: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
Lawrence Lee
b16287ff6f
Fix rank, color label, and trash status reset
The rank, color label, and trash status from a previous session would
reset after editing an image or clearing the processing profile.
2024-10-20 15:14:50 -07:00
xiota
02e8d3f33c Change order of image/raw loading to generate thumbnails 2024-06-16 02:32:38 +00:00
Lawrence37
59e8832dfb
Merge pull request #6367 from xiota/jxl-import
Add ability to import JXL images
2024-06-08 17:12:13 -07:00
xiota
4d715cf281 Make requested changes 2024-04-16 17:28:32 +00:00
xiota
320859bf92 Remove unnecessary thumbnail loading code 2024-04-10 11:47:28 +00:00
xiota
dd01cc110b Add error code to returns
Fix conditional libjxl compilation
2024-04-10 11:32:42 +00:00
xiota
dfc82c403c Add ability to import JXL images 2024-04-10 10:17:42 +00: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
Simone Gotti
68fd35d881 thumbnail: decouple proc params rank/color/trash
Add a Properties type that contains values for rank, color and trashed
Each value will also contain an edited flag.

The properties variable is used to store rank, color and trashed. They
are fetched from the proc params and will update the proc params when
needed.

This is the base for future implementations where some properties (like
rank) will be also retrieved from other sources like xmp sidecar files.
2024-03-30 09:46:02 +01:00
Simone Gotti
dcc983331d thumbnail: rename get/setStage to get/setTrashed
Also return a bool in getTrashed since it's already used as a bool in
setTrash and in all the checks.
2024-03-30 09:46:02 +01:00
Lawrence Lee
0fdac3797a
Merge branch 'dev' into browser-preview-applied-pparams 2023-08-29 22:58:51 -07:00
Stephen Shkardoon
23f2a2fc9f Use _WIN32 instead of WIN32 to detect Windows
`WIN32` is not defined when building a 64-bit executable on Windows with Clang. `_WIN32` is the more appropriate option here.
http://web.archive.org/web/20191012035921/http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_system contains a handy table/matrix of the options and why this is best.
2023-08-13 17:09:49 +12:00
Lawrence Lee
c5a0067eee
Merge branch 'dev' into metadata-exiv2 2023-08-06 10:25:49 -07:00
Lawrence Lee
b0c53be783
Render abstract profile and white level in browser
Enable rendering of abstract profile adjustments in the file browser
thumbnail.

Fix updating of white level in the thumbnail.
2023-07-29 18:39:35 -07:00
Lawrence Lee
6787c53c9b
Show black level adjustments in file browser
File browser thumbnails for raw images start with a minimally-processed
images. These images are cached and image adjustments are applied on
top. The black level is "baked-into" the cached image. Therefore, to
reflect the black level adjustments in the thumbnail, one of two options
are required:
    1. Cache an image before the black level is applied and process the
       black level on top of this image.
    2. Recreate the base image with the new black level and cache it.
The first option yields better performance when the user changes the
black level. However, it requires other base adjustments to be applied
every time, such as the camera multipliers. The second option requires
the base image to be recreated every time the black level is changed.
This commit implements the second option. It minimizes code changes, and
therefore possible bugs. It does add a performance penalty when the
black level changes, but the black level adjustment is rarely used.
2023-07-29 17:37:13 -07:00
Lawrence Lee
c557b320c2
Refresh cached image data if sidecar is changed 2023-05-14 18:18:27 -07:00
Lawrence Lee
1eb58255ce
Merge branch 'dev' into tone-equalizer 2023-04-15 16:58:52 -07:00
Lawrence Lee
0729deec4b
Merge branch 'dev' into metadata-exiv2 2023-03-22 23:01:40 -07:00
Desmis
69c1caafa1
Whitebalance - Removed GUI Itcwb from whitebalance and preferences (#6710)
* Change Preferences for observer whitebalance

* Change label white balance preferences

* Added Preferences 2 parameters Whitebalance auto correlation

* Add Preference Temperature correlation - sort and tooltip

* Change to rtengine cmakelist

* Apply patch from Lawrence37

* Small comment code

* Change defaut order prefrences wba

* Added force extra algoritm to Preferences

* Harmonize itcwb sorted

* Add fields to Preferences Itcwb

* Change settings precision Itcwb in Preferences

* Change tooltip Itcwb preferences

* First stage Itwcwb settings in main with pp3 and selction in preferences

* Second stage Itwcwb settings in main with pp3 and selction in preferences

* Third stage Itwcwb settings in main with pp3 and selction in preferences

* Add itcwb_fgreen student - green optimize

* Add Itcwb green range

* Itcwb history msg - first tooltips

* Remove force-extra because always used

* reused force-extra to use entire CIExy for sampling datas

* Removed inwanted text in console

* Set sensitive for Itcwbframe

* Various change - comment ..

* Small code review - chnage tooltips

* Remove settings itcwb_delta in Rawimagesource.cc to simplify

* Remove Itcwb Observer - put a single observer for everything - general - itcwb

* Fixed conflicts in colortemp.cc

* Various change - fixed bug - simplify

* Fixed limits for settings pp3 - chnage tooltip

* Clean unused code

* Put itcwb_findgreen in GUI

* Added checkbox 'Low sampling' to find the settings of 5.9

* Set Observer to Observer 10° - preferences default

* Missing setting Low sampling

* Show white balance multipliers

* Change default settings - Itcwb_sorted

* Move observer from preferences to WB

* Make observer selectable for camera WB

* Ensure observer checkbox is in sync with PP3

* Set default ITCWB low sampling for PP3s from <=5.9

Ensure temperature correlation white balance algorithm 1 is used when
opening edits from versions 5.9 and earlier.

* Removed unused White-balance frame in Preferences

* Comment some GUI sliders checkbox

* Removed all GUI itcwb in preferences and whitebalance

* Removed forgotten code in preferences

* Remove labels tooltips history Itcwb

---------

Co-authored-by: Lawrence Lee <45837045+Lawrence37@users.noreply.github.com>
2023-03-19 07:47:58 +01:00
Lawrence Lee
f236a7edb7
Merge branch 'dev' into tone-equalizer 2023-02-05 18:39:23 -08:00
Lawrence Lee
3833c6e634
Merge branch 'dev' into metadata-exiv2 2023-02-05 12:29:58 -08:00
Niklas Haas
2101b846c3
Implement file sorting in thumbnail view (#6449)
* Use mtime as fallback timestamp for files without EXIF data

As suggested in #6449, with date-based sorting it can be useful to have
at least *some* sort of time-relevant information for EXIF-less files,
to prevent them from falling back to getting sorted alphabetically all
the time.

This commit simply defaults the file timestamp to the file's mtime as
returned by g_stat. For annoying reasons, it doesn't suffice to merely
forward the timestamp to the FileData structs - we also need to keep
track of it inside FilesData to cover the case of a file with 0 frames
in it.

* Add DateTime to Thumbnail

Putting it here facilitate easier sorting without having to re-construct
the DateTime on every comparison.

To simplify things moving forwards, use the Glib::DateTime struct right
away. This struct also contains timezone information, but we don't
currently care about timezone - so just use the local timezone as the
best approximation. (Nothing currently depends on getting the timezone
right, anyway)

In addition to the above, this commit also changes the logic to allow
generating datetime strings even for files with missing EXIF (which
makes sense as a result of the previous commit allowing the use of mtime
instead).

* Implement file sorting in thumbnail view

For simplicity, I decided to only implement the attributes that I could
verily easily reach from the existing metadata exported by Thumbnail.
Ideally, I would also like to be able to sort by "last modified" but I'm
not sure of the best way to reach this from this place in the code.

It's worth pointing out that, with the current implementation, the list
will not dynamically re-sort itself until you re-select the sorting
method - even if you make changes to the files that would otherwise
affect the sorting (e.g. changing the rank while sorting by rank). One
might even call this a feature, not a bug, since it prevents thumbnails
from moving around while you're trying to re-label them. You can always
re-select "sort by ..." from the context menu to force a re-sort.

Fixes #3317

Co-authored-by: Thanatomanic <6567747+Thanatomanic@users.noreply.github.com>
2023-01-02 21:27:12 +01:00
Nicolas Turlais
401727fba9
Add filter for Paths to dynamic profiles (#6284)
Work by @nicolas-t 
* Path filter in dynamic profile panel
* Pass filename as a function argument
* Removed unused include
* Clearer translation
2022-12-31 10:51:30 +01: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
b92e77fb96
improved support for metadata editing
(cherry picked from commit 85da0b51ecf7ece768c0267aead71dd94404d4dc)
2022-12-09 22:35: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
b01b0fbef0
metadata: initialize thumbnail rating from exif
(cherry picked from commit 96bd2db0d2e127678bded3bee7aa3275332826c0)
2022-12-04 17:02:33 -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
Lawrence Lee
4223f114cb
Clean up merge 2022-12-03 21:24:17 -08:00
Lawrence Lee
bd3bd809b5
Port tone equalizer from ART
Merge with local adjustments tone equalizer image processing function
for consistent results.

To-do: Enable for batch editing and add pivot/colormap to the local
adjustments version.
2022-05-01 16:13:27 -07:00
Ingo Weyrich
c9e58fea54 cppcheck clean rtgui/thumbnail.* 2021-05-23 14:35:59 +02:00
Thanatomanic
9fcf45dca5 Several fixes and changes made by Floessie earlier 2021-04-27 21:35:43 +02:00
Thanatomanic
ae754b2492 Merge branch 'dev' into metadata-exiv2 2021-04-27 09:59:52 +02:00
Floessie
1318935a87
Better handle thumbnail generation of extreme aspect ratio images (fixes #3794)
* Backport fix taken from ART
* Enforce minimal thumbnail size of 1x1 px in two places, prevents divison by zero and empty image generation
2020-10-25 18:24:30 +01:00
Thanatomanic
c8ef1ee628 Final changes, branch now buildable 2020-10-16 16:15:10 +02:00
Thanatomanic
8b4389ade9 Resolve exiv2 merge conflicts and merge with 2020-10-16 11:45:26 +02:00
Ingo Weyrich
beb8fd8f74 Merge branch 'dev' into newlocallab2 2020-06-14 22:03:26 +02:00
Ingo Weyrich
41675913d6 Cleanups and also some speedups for RT 5.9, to be continued 2020-05-31 17:27:44 +02:00
Desmis
e573de78b4 merge with dev 2020-03-19 13:40:11 +01:00
Ingo Weyrich
a9e2bde610 use autold instead of auto, #5676 2020-02-28 11:44:25 +01:00
Ingo Weyrich
67ca8e2c19 further aehistograms cleanup 2020-02-13 16:34:45 +01:00
Desmis
10c01928c8 merge with dev 2019-12-17 14:08:57 +01:00
Ingo Weyrich
abac9856e7 Apply internal default profile (neutral) instead of user defined default profiles for missing parts of existing profile when loading a raw file which already has a .pp3, fixes #5564 2019-12-17 00:44:01 +01:00