Commit Graph

7515 Commits

Author SHA1 Message Date
Christoph Hasse
704ee571de fix: allow for FX.Y syntax in aperture regex 2021-06-22 09:47:02 +02:00
Daniel Vogelbacher
fa78ab3593 Use official Canon RF lens model names
The new RF line is named F2.8L instead of f/2.8L (for example).

This patch makes the model names identically to the official
Canon lens names and the same names exiftool uses.
2021-06-22 09:47:02 +02:00
Rosen Penev
4a654e4266 clang-tidy: do not use 0 for bool
Found with modernize-use-bool-literals

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-06-21 21:00:05 +02:00
Rosen Penev
99823a526c clang-tidy: replace virtual with override
Found with modernize-use-override

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-06-21 20:59:48 +02:00
Christoph Hasse
653c5696d4
Merge pull request #1714 from attilaolah/patch-1
fix: compilation with -Wunused-variable
2021-06-21 20:24:52 +02:00
Antonio Rojas
c069e36605 Fix build with gtest 1.11
INSTANTIATE_TYPED_TEST_CASE_P requires a non-empty prefix now
2021-06-20 23:05:34 +02:00
Christoph Hasse
2f83b7e0f6
Merge pull request #1692 from Exiv2/hassec_canon_lens_test
New Canon Lens Identification + Automatic Test of all Lenses
2021-06-20 22:28:34 +02:00
andyrtr
cfeceee416
add lens: Olympus M.ZUIKO DIGITAL ED 12-45mm F4.0 PRO (#1725)
* add lens ID for Olympus M.Zuiko Digital ED 12-45mm F4.0 Pro #1723

* add test for #1723 checking the Olympus M.Zuiko Digital ED 12-45mm F4.0 Pro recognized correctly
2021-06-20 22:15:01 +02:00
Attila Oláh
33419c8dd1
Fix compilation with -Wunused-variable
When compiling with -Wunused-variable, `EXT_STRERROR_R_CHAR_P` gets undefined because of a failing compilation check.

An alternative would be to mark `c` as `__attribute__((undefined))`, but MSVC doesn't have `__attribute__((undefined))`.
2021-06-14 12:41:47 +00:00
Rosen Penev
19000cd53c con/destructor fixes
Added = delete to make it explicit. Also made them public.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-06-10 18:08:11 +02:00
Rosen Penev
7a2b05e813 clang-tidy: use = default
Found with modernize-use-equals-default

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-06-10 18:01:48 +02:00
Rosen Penev
e53548a95a clang-tidy: use default member init
Found with modernize-use-default-member-init

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-06-10 18:00:23 +02:00
Rosen Penev
17a8d743a5 clang-tidy: do not use else after return
Found with llvm-else-after-return

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-06-10 17:45:29 +02:00
Rosen Penev
e9309f25ab clang-tidy: simplify bools
Found with readability-simplify-boolean-expr

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-06-10 17:45:02 +02:00
Rosen Penev
c20394b3fa remove old MSVC hacks
This is C++11 now.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-06-10 17:35:17 +02:00
nulllinie
23dbf4f51a
correct identification for Tamron SP 24-70mm G2 A032 (#1691)
* correct identification for Tamron SP 24-70mm G2 A032 with LensType 0E (14)

Existing entry with LensType 4E is kept as it's needed as well
Added testcase for LensType 0E for Tamron_SP_24-70mm_F2.8_Di_VC_USD_G2
2021-06-10 09:01:38 +02:00
Christoph Hasse
a6b1126f6d fix: workaround centos-8 bug-18212 2021-06-09 21:00:06 +02:00
Moshe Kaplan
aeb3ea9412 Update README.md
Fix typo
2021-06-09 08:17:44 +02:00
Christoph Hasse
efb0af8506 fix: make casts explicit to please msvc 2021-06-08 23:33:03 +02:00
Christoph Hasse
7867343611 fix: prefer symbolic boolean operators so windows is happy 2021-06-08 23:03:28 +02:00
Christoph Hasse
7bc9c01d95 fix: update tests following new canon lens identification 2021-06-08 22:35:45 +02:00
Christoph Hasse
20cff55cd8 fix: fix bash test following the new canon lens identification 2021-06-08 22:25:07 +02:00
Christoph Hasse
bdd8a386b5 feat: improve lens recognition of canon makernote
If multiple choices are possible they are now all reported. This
behaviour is now the same as it is in exiftool.

All lenses are tested in the new test_canon_lenses.py test
2021-06-08 21:56:04 +02:00
Christoph Hasse
f8962224fd fix: prevent creation of nightly release with draf==true
Sometime the nightly pre-release would be in "draft" status on github.
It's hard to reproduce but I had the guess that maybe the deletion of
old tag and release on the github side wasn't quite done when the
new release was being created. Of course only speculation...
But, moving the download of the artifacts in betweent these two steps
seems to have fixed the symptom.
2021-06-04 15:50:53 +02:00
Christoph Hasse
907fe2369e fix: readd some previously removed lenses now that we plan to trea ambiguous lenses 2021-06-03 21:40:05 +02:00
Christoph Hasse
cc89dca5a2 feat: rework lens test to account for ambiguous lenses
For each lens, its test target is now defined as the list of all lenses
which are possible given that lenses exif values.
2021-06-03 00:03:06 +02:00
Christoph Hasse
a70896c1ac refactor: use function to calculate raw exif value given aperture 2021-06-02 21:36:13 +02:00
Christoph Hasse
4ee8962d42 refactor!: use lensfun style nameing for lenses 2021-06-02 21:21:35 +02:00
Christoph Hasse
47d518bc65 refactor: move canon lens tests into new test directory
This commit does some restructuring to make common utils available
for future similar test for other brands
2021-06-02 21:21:35 +02:00
Alexander Steffen
56f9979a4b Improve detection of Canon lenses with TC
Lenses with and without a TC may share the same lens ID. Prefer entries
that explicitly mention the TC.
2021-06-02 21:21:35 +02:00
Alexander Steffen
9962b88db3 Fix misdetection of Tamron SP AF 300mm as Canon EF 75-300mm
When searching for the Tamron lens, only the string "300mm" is searched in
the lens description, which also happens to be present for the Canon lens.
Since the Canon lens comes first in the list, it wins. Fix this issue by
prefixing the search string with a single space so it always has to match
the full focal length specification.
2021-06-02 21:21:35 +02:00
Alexander Steffen
477150f067 Fix rounding error in fnumber calculation
The mathematical calculation of fnumbers does not always match the expected
values: For example for f/3.5 the precise mathematical value is 3.564...,
which gets rounded to 3.6. Fix this special case by returning a value
closer to the expected value.
2021-06-02 21:21:35 +02:00
Alexander Steffen
d7f613c48e Clean up Canon lens list
Fixes some small inconsistencies, so that all lenses use the same format,
that is also shared with other lens databases such as lensfun:
* Always prefix aperture with f/
* Never add .0 to aperture
* Always add mm to focal length
* Always use | A for Sigma Art lenses
2021-06-02 21:21:35 +02:00
Alexander Steffen
0d030eefdf Remove undetectable lenses
Lenses that have the exact same ID, focal length and aperture as some other
lens that comes earlier in the list (and thus always wins):
* 137, "Tamron SP 17-50mm f/2.8 XR Di II VC"
* 137, "Tamron SP 24-70mm f/2.8 Di VC USD"
* 161, "Sigma 28-70mm f/2.8 EX"
* 173, "Sigma 180mm EX HSM Macro f/3.5"
* 180, "Zeiss Milvus 50mm f/1.4"
* 183, "Sigma 150-600mm f/5-6.3 DG OS HSM | S"
* 254, "Tamron SP 90mm f/2.8 Di VC USD Macro 1:1 F004"
* 254, "Tamron SP 90mm f/2.8 Di VC USD Macro 1:1 F017"

Lenses that share their IDs with other lenses, but have no or an
unsupported focal length:
* 33, "Voigtlander or Carl Zeiss Lens"
* 131, "Sigma 4.5mm f/2.8 EX DC HSM Circular Fisheye"
2021-06-02 21:21:35 +02:00
Alexander Steffen
fa4ce38d77 Execute test commands always with shell
There is no need to handle tests on Windows and Unix differently here.
Always using a shell allows for more flexibility when writing tests.

(rebased by hassec)
2021-06-02 21:21:35 +02:00
Alexander Steffen
73efa4515c Add test for all known Canon lenses
Generates a test case for every known lens from canonCsLensType, that first
sets the corresponding lens metadata and then verifies that exiv2 maps it
to the expected lens description. Only metadata fields that are relevant
for lens identification are modified.
2021-06-02 21:21:35 +02:00
Luis Díaz Más
f30022d73d
Fix issues detected with PVS-Studio + other little improvements (#1689)
* avoid re-declaration of constant variables

* Replace pthreads critical section with std::mutex

* ci - better naming

* cmake - increase minimum version to 3.11. Use project DESCRIPTION

* fix - do not treat string::find() return type as bool

* remove conditions that were always true

* remove condition that were always false

* Remove EXV_HAVE_GMTIME_R which is not used anymore

* pixelWidth_ was inherited from Exiv2::Image

The width & height variables in the TiffImage class need to be mutable
to be able to change their values on the getters pixelHeight() and
pixelWidth() ... Do not ask me why ...

* Remove superfluous if

* pvs:V766 item with identical key added already

* pvs:V730 not all members were initialized (time)

* pvs:V730 not all members are initialized

* pvs:v668 no point in testing pointer against null after new

* pvs:V1048 variable assigned the same value

* replace c-style dynamic vector with std one

* pvs:547 fakeData is always true

* Remove useless constructor in derived class

* pvs:V690 modern way to disable copy-ctor

* Replace malloc/free with new/delete. No need to check for null

* pvs:V1028 cast operands and not result

* Remove custom MIN/MAX functions

* pvs:V595 pointer used before verified against null

* pvs: index used before being checked

* pvs:V1028 possible overflow. Cast operands

* pvs:v575 potential null pointer passed to other functions

* pvs:V547 deal with always true/false expressions

* pvs:V560 part of conditional expressions always false or true

* pvs:V701 possible break in realloc -> move to std::vector

* Make some classes 'final'

* Replace sprintf with std::to_string()

* fix compilation on windows
2021-06-01 12:39:10 +02:00
Christoph Hasse
024830a72c
feat: Setup github actions workflow to build tagged release and nightly pre-release (#1676) 2021-05-31 16:50:11 +02:00
Christoph Hasse
758dd6bbc6 refactor!: remove free() function from DataBuf to avoid potential problems, see #1542 2021-05-27 08:26:00 +02:00
Rosen Penev
2c57f214c5 clang-tidy: use nullptr
Found with modernize-use-nullptr

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-26 08:31:45 +02:00
Christoph Hasse
8c61962a09
docs: fix example command in man pages. closes #1685 (#1686) 2021-05-25 21:54:34 +02:00
Rosen Penev
86c71ae6c3 clang-tidy: avoid global non const variables
Found with cppcoreguidelines-avoid-non-const-global-variables

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-25 08:43:27 +02:00
Rosen Penev
d1e116a8ef remove some pointless std::set
Partially found by gcc's -fanalyzer

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-25 08:29:51 +02:00
Rosen Penev
4c4f8da338 remove initializers
these were moved outside the constructor body.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-22 10:02:20 +02:00
Rosen Penev
c7a41230f0 clang-tidy: remove pointless member init
Found with readability-redundant-member-init

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-19 23:32:29 -07:00
Rosen Penev
e5894d71e1 default con/destructors in headers
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-19 23:31:50 -07:00
Rosen Penev
7179300b7f clang-tidy: use dynamic cast
Found with cppcoreguidelines-pro-type-static-cast-downcast

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-19 23:31:22 -07:00
Rosen Penev
8d501fcf24 clang-tidy: no else after return
Found with readability-else-after-return

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-19 23:09:46 -07:00
Rosen Penev
ce47de67b5 use auto in template
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-19 23:09:05 -07:00
Rosen Penev
c44c289d76 clang-tidy: fix ending namespace comnments
Found with llvm-namespace-comment

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2021-05-19 23:08:08 -07:00