138 Commits

Author SHA1 Message Date
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
Alberto Griggio
1a771fa211
more work on synchronizing metadata with xmp sidecars
(cherry picked from commit 81bbff6e6ae87bd35e8050a1cc621297ca24939b)
2022-12-04 15:55:09 -08:00
Alberto Griggio
caa23df465
report "Unknown" for unknown lenses
(cherry picked from commit 36d7710ee270d776729d926b7c4ba028713bdb06)
2022-12-04 11:48:15 -08:00
Lawrence Lee
4223f114cb
Clean up merge 2022-12-03 21:24:17 -08:00
Bezierr
784625b5cc
Fix so E-Mount lens names are retrieved (#6437) 2022-03-26 12:02:50 +01:00
Bezierr
d86888e93f
Add resizing options "long edge" and "short edge" (#6263)
Introduces "long edge" and "short edge" options to resize an image. The GUI is made such that the relevant spinboxes only appear for the selected option. Unrelated values (e.g. for box-mode) are not updated.
2021-06-05 07:37:09 +02:00
Thanatomanic
badf92ba64 Fix for declared near() function, backport from ART. Various other minor changes. 2020-10-16 13:30:47 +02:00
Thanatomanic
8b4389ade9 Resolve exiv2 merge conflicts and merge with 2020-10-16 11:45:26 +02:00
Flössie
b311b5b6d2 Validate EXIF UTF-8 strings (fixes #5923) 2020-10-03 10:18:23 +02:00
Flössie
79278875da Use snprintf() instead of sprintf() (#5907) 2020-09-15 14:56:57 +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