152 Commits

Author SHA1 Message Date
Lawrence Lee
79d402c820
Improve lens identification for Sony ARWs
Let Exiv2 get the lens name if the lens spec is present. Otherwise, use
the lens ID.
2025-01-11 12:21:20 -08:00
Lawrence Lee
4e9ceff1e9
Merge remote-tracking branch 'origin/fix-warnings-5.9' into fix-warnings-5.12 2024-11-16 22:27:29 -08:00
Lawrence Lee
eac9cdaa00
Improve Sony Pixel Shift support
Detect images created by make_arq as pixel shift.
Add raw crop for Sony ILCE-7CR pixel shift.
2024-10-07 21:10:16 -07:00
Simone Gotti
4b78e16130 FramesData: add missing isDNG initialization.
FramesData isDNG wasn't initialized.

This will randomly cause images to be considered as dng files when the
underlying value is different than 0 since the metadata parsing could
exit before the code that checks for the Exif.Image.DNGVersion tag.
2024-08-03 11:11:15 -07:00
Lawrence Lee
79aaba1bcb
Refactor isDNG flag 2024-07-18 22:22:27 -07:00
Lawrence Lee
bb44729490
Merge branch 'dev' into libraw-copylib 2024-07-18 21:57:57 -07:00
Simone Gotti
5159de89cb imagedata: report if file is DNG 2024-07-08 10:29:43 +02:00
Lawrence Lee
51e52d9aba
Merge branch 'dev' into libraw-copylib 2024-03-02 21:01:34 -08:00
Lawrence Lee
d13badbbe0
Implement DNG bad pixels constant for LibRaw
Works if the FixBadPixelsConstant is zero, as implemented for dcraw.
Other constant values may be implemented in the future.
2024-01-06 21:40:00 -08:00
Lawrence Lee
f296991419
Implement DNG gain map for LibRaw 2023-12-17 16:00:30 -08:00
Lawrence Lee
f25659307c
Calculate focus distance for Nikon Z cameras 2023-11-11 14:57:24 -08:00
Alberto Griggio
e5d389e271
metadata: fixed focus distance computation
A wrong focus distance calculation was affecting lensfun vignetting correction
2023-11-09 21:22:37 -08: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
572a75f02a
Fix lens model reading for Sony ILMEs and ZV-E10
Use lens model from the EXIF group for these cameras.
2023-05-14 11:06:23 -07: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
Lawrence Lee
8c98925f3d
Get lens name from EXIF group for ILCE/NEX cameras
Fix incorrect lens name read in certain cases from Sony cameras (see
https://discuss.pixls.us/t/call-for-testing-rawtherapee-metadata-handling-with-exiv2-includes-cr3-support/36240/87).
2023-05-12 22:44:04 -07:00
Lawrence Lee
ab79a4fc3e
Refine lens name reading for Nikon Z and Sony
Fall back to other EXIF tags in case Exiv2 cannot interpret the lens ID.
2023-04-09 17:08:54 -07:00
Lawrence Lee
0bbcea8806
Fix Nikon Z series lens identification 2023-04-02 23:43:10 -07:00
Lawrence Lee
30025d2ac2
Get Sony image lens from Sony lens ID tag 2023-04-02 17:22:10 -07:00
Lawrence Lee
533a05cd9d
Get lens name from Nikon Z series images 2023-04-02 16:59:24 -07:00
Lawrence Lee
1e6cc85fe2
Add missing includes
Thanks to Benitoite
(https://github.com/Beep6581/RawTherapee/pull/5889#issuecomment-1475033091)
2023-03-18 18:15:38 -07:00
Lawrence Lee
a329e423ec
Remove outdated comments about ratings 2023-02-12 18:19:28 -08:00
Lawrence Lee
cf545abc87
Read serial number with Exiv2 2023-02-12 17:10:00 -08:00
Lawrence Lee
9c6dac5f25
Remove outdated comments
Validation of metadata is still needed for #5923.
2023-02-11 18:06:20 -08:00
Lawrence Lee
b8d25d542a
Fix crash reading Pentax metadata 2023-02-05 17:46:13 -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
Alberto Griggio
eb7c151260
metadata: fixed regression with older exiv2 versions
Fixes #246

(cherry picked from commit ac3e78c25ed5b14019661d5c6c58af15032e968d)
2022-12-10 11:54:45 -08:00
Alberto Griggio
2ac459e927
further tweaks to lens identification
(cherry picked from commit 4fd18fed00eb799b8d82f472a98f270617bc3fb4)
2022-12-10 11:54:44 -08:00
Alberto Griggio
00c13bf2af
tweaked lens identification for Canon RF cameras
(cherry picked from commit a7e4ef71f9b400ffd53532c91d2ecb4e17e5ce2a)
2022-12-10 11:54:44 -08:00
Alberto Griggio
9fd136c2f3
metadata: work around misidentification of some Canon RF lenses with teleconverter
(cherry picked from commit 3aae273f862f0c1611a134c6e84f460bba83bcf4)
2022-12-10 11:54:44 -08:00
Alberto Griggio
c7d5b5076d
metadata: fallback to Exif.Photo.LensModel for lenses unknown to exiv2
(cherry picked from commit 64e25471b003e302414d0cf48f64ccd1a988b454)
2022-12-10 11:54:44 -08:00
Alberto Griggio
f2248dce9d
metadata: detect pixelshift files from sony and fujifilm
(cherry picked from commit 6554778f7bc6ce50c3bb8a98ca1907cb945c2e34)
2022-12-10 10:55:38 -08:00
Alberto Griggio
a73e74f9cc
metadata: fixed bug in setting shutter speed in output jpgs
(cherry picked from commit b6a1a15a76c2091f6f940ae7d16d45caa93dbb99)
2022-12-10 10:55:25 -08:00
Alberto Griggio
c75296b910
metadata: properly set the value of Exif.Photo.ExposureBiasValue
(cherry picked from commit b0bdd1fda6759b8041a0cbf5ce977e947ea10cff)
2022-12-10 10:52:18 -08:00
Alberto Griggio
ba79d8b7f0
(hopefully) better metadata formatting
(cherry picked from commit 89be8ee8e71b1d56f5c6ce7ce4068ab330e19d68)
2022-12-10 10:43:41 -08:00
Alberto Griggio
7d5b9e9d65
metadata: fixed bug in transferring basic tags
(cherry picked from commit 89afbd90e154ddd5e6071c44990b68aa62227739)
2022-12-10 10:41:53 -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
0102fca563
improved metadata extraction from ancient Kodak DCS4xx cameras
(cherry picked from commit a2cc73f5f4769ad9ad2daaea9b5adbe7b158ad9e)
2022-12-10 10:05:25 -08:00
Alberto Griggio
a9aa17f153
metadata: small tweaks to expcomp and fnumber default values in "apply changes" mode
(cherry picked from commit af20ad37cceb3b4bf0a01e46b5cec023d4170300)
2022-12-10 09:25:23 -08:00
Alberto Griggio
e970562055
metadata: check for "Exif.Photo.ExposureBiasValue" in addition to "Exif.Image.ExposureBiasValue" for exposure compensation
Fixes #49

(cherry picked from commit a7cb9add3453c581347e738110461f0af15cb1cb)
2022-12-10 09:25:01 -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
5fdff8dab4
file browser: pick up star ratings from the image metadata if available
(cherry picked from commit 98f0675b2e419d18bd88259997b81bcbcc4e5c96)
2022-12-05 21:53:21 -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
e3f3b8ae91
Get date taken from time digitized
Used as the fallback if the original data-time isn't available.

Original commit message:
metadata: use exiftool as a fallback for files not yet supported by exiv2 (e.g cr3)

(cherry picked from commit bdcebdecef8cca82b0d8ad7a24d267308b12e04d)
2022-12-04 17:19:17 -08:00
Alberto Griggio
df39e13cf7
properly handle exif orientation
translate the tag value to string using the exiftool way, to be compatible with RT.
Fixes issue #4

(cherry picked from commit a4621f54b2ac82b679cf9d865a0a3e4a2ed9c468)
2022-12-04 17:08:34 -08:00
Alberto Griggio
e5c8ceac5f
metadata: fixed detection of Pentax DNG pixelshift images
(cherry picked from commit 2bdd3a6c5d79dc61fca39ea39ecd90ba9a12dee5)
2022-12-04 17:07:11 -08:00
Alberto Griggio
45acb120a6
improved lens info for fixed-lens cameras
(cherry picked from commit a1bcb1a2a65514ae1c8e0bcd3489f83f7a68ead5)
2022-12-04 17:04:43 -08:00
Alberto Griggio
0e019b745b
metadata: translate "----" to "Unknown" in lens identification
(cherry picked from commit 9b0dce535c7eeda2d20c0ef1fa342b00238a48a1)
2022-12-04 17:02:47 -08:00
Alberto Griggio
b01b0fbef0
metadata: initialize thumbnail rating from exif
(cherry picked from commit 96bd2db0d2e127678bded3bee7aa3275332826c0)
2022-12-04 17:02:33 -08:00