7657 Commits (aa86646f2717173f66369d86c6bc7bbbf4e8ceb8)
 

Author SHA1 Message Date
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))`.
4 years ago
Rosen Penev 19000cd53c con/destructor fixes
Added = delete to make it explicit. Also made them public.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 7a2b05e813 clang-tidy: use = default
Found with modernize-use-equals-default

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev e53548a95a clang-tidy: use default member init
Found with modernize-use-default-member-init

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
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>
4 years ago
Rosen Penev e9309f25ab clang-tidy: simplify bools
Found with readability-simplify-boolean-expr

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev c20394b3fa remove old MSVC hacks
This is C++11 now.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
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
4 years ago
Christoph Hasse a6b1126f6d fix: workaround centos-8 bug-18212 4 years ago
Moshe Kaplan aeb3ea9412 Update README.md
Fix typo
4 years ago
Christoph Hasse efb0af8506 fix: make casts explicit to please msvc 4 years ago
Christoph Hasse 7867343611 fix: prefer symbolic boolean operators so windows is happy 4 years ago
Christoph Hasse 7bc9c01d95 fix: update tests following new canon lens identification 4 years ago
Christoph Hasse 20cff55cd8 fix: fix bash test following the new canon lens identification 4 years ago
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
4 years ago
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.
4 years ago
Christoph Hasse 907fe2369e fix: readd some previously removed lenses now that we plan to trea ambiguous lenses 4 years ago
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.
4 years ago
Christoph Hasse a70896c1ac refactor: use function to calculate raw exif value given aperture 4 years ago
Christoph Hasse 4ee8962d42 refactor!: use lensfun style nameing for lenses 4 years ago
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
4 years ago
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.
4 years ago
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.
4 years ago
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.
4 years ago
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
4 years ago
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"
4 years ago
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)
4 years ago
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.
4 years ago
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
4 years ago
Christoph Hasse 024830a72c
feat: Setup github actions workflow to build tagged release and nightly pre-release (#1676) 4 years ago
Christoph Hasse 758dd6bbc6 refactor!: remove free() function from DataBuf to avoid potential problems, see #1542 4 years ago
Rosen Penev 2c57f214c5 clang-tidy: use nullptr
Found with modernize-use-nullptr

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Christoph Hasse 8c61962a09
docs: fix example command in man pages. closes #1685 (#1686) 4 years ago
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>
4 years ago
Rosen Penev d1e116a8ef remove some pointless std::set
Partially found by gcc's -fanalyzer

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 4c4f8da338 remove initializers
these were moved outside the constructor body.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev c7a41230f0 clang-tidy: remove pointless member init
Found with readability-redundant-member-init

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev e5894d71e1 default con/destructors in headers
Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 7179300b7f clang-tidy: use dynamic cast
Found with cppcoreguidelines-pro-type-static-cast-downcast

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 8d501fcf24 clang-tidy: no else after return
Found with readability-else-after-return

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev ce47de67b5 use auto in template
Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev c44c289d76 clang-tidy: fix ending namespace comnments
Found with llvm-namespace-comment

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev a74bceacb0 clang-tidy: remove pointless return
Found with readability-redundant-control-flow

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev ceed79c95e Jzon: algorithm conversions
Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 4d2bc3c752 some range loop conversions
Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 743da1a564 clang-tidy: use C++ casting
Found with google-readability-casting

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 8dbc699858 clang-tidy: add missing explicit
Found with google-explicit-constructor

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev ff39473c18 clang-tidy: convert to static
Found with readability-convert-member-functions-to-static

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 6da49fd29b more constexpr
Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev cdbee3c26c clang-tidy: init in member initializer
Found with cppcoreguidelines-prefer-member-initializer

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago