114 Commits (e41dd1d22732ca1d0c9d0bf9db625d39e8094799)

Author SHA1 Message Date
Rosen Penev 9ca7f861cf remove string_view from headers
This should allow usage with C++11 projects. It's also wrong. The only
user of this assigns an std::string from a string_view, which is not
safe.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Rosen Penev 5479792d50 remove pointless &*
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Rosen Penev b8eaae649d use some auto
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Rosen Penev 543c951bde clang-tidy: use '' for find
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Rosen Penev d59e1433c0 replace readlink with std::filesystem
Simpler.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Rosen Penev 043547cbd0 remove various usages of memset
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Luis Díaz Más 30bf563f4d Update .clang-format file & apply clang-format to whole project 3 years ago
Luis Diaz 7576a2757b More size_t for sizes 3 years ago
Luis Díaz Más 96f7f2e4c5 Convert Exiv2::ErrorCode into an enum class 3 years ago
Luis Díaz Más c146ae5215 Fix mac build 3 years ago
Luis Díaz Más bbc99ae581 Use auto for unique pointers 3 years ago
Luis Díaz Más 8b1fe379a1 Removing unused headers thanks to IWYU 3 years ago
Luis Díaz Más 23da0c3955 Do not define not needed stuff 3 years ago
Rosen Penev 5833101b9b manual nullptr conversions
Mostly not caught because I'm not running clang-tidy on Windows.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Luis Díaz Más b17828b454
Use SPDX for licenses (#2122)
* Use SPDX identifier in header files

* Use SPDX identifier in rest of source files

* Fix usage of SPDX for files with 2 licenses

* Add global license file

* Fix compilation
3 years ago
Luis Díaz Más 8b3da36f42 Improvements from code review 3 years ago
Luis Díaz Más 59f4d0de27 cppcheck: reduce scope of variables 3 years ago
Luis Díaz Más 0726104b1a Hide pathOfFileUrl in the only place where it is used 3 years ago
Luis Díaz Más 6f762b4e66 Use std::filesystem for fileExist 3 years ago
Luis Díaz Más f1ff3aaa4c Make urldecode in-place 3 years ago
Luis Díaz Más 3d370cc2ae Improvements in urlencode 3 years ago
Luis Díaz Más 7933ff401d Remove dead code around EXV_UNICODE_PATH 3 years ago
Evan Miller 04f4624718
Explicitly test for libproc.h (#1916)
This change adds support for ancient macOS lacking libproc. It also
eliminates a bug where exiv2 could not be built on case-sensitive
file systems (the header file is properly TargetConditionals.h).
4 years ago
Matthias Kuhn 5aafb351e5 Fix building on ios 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
Rosen Penev 2c57f214c5 clang-tidy: use nullptr
Found with modernize-use-nullptr

Signed-off-by: Rosen Penev <rosenp@gmail.com>
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 743da1a564 clang-tidy: use C++ casting
Found with google-readability-casting

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev b8712188bb clang-tidy: use auto
Found with modernize-use-auto

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev fdf9d3799c clang-tidy: don't use else after return
Found with llvm-else-after-return

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 143a1fbbe2 clang-tidy: don't use string compare
Found with readability-string-compare

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev bd6a996181 clang-tidy: use using
Found with modernize-use-using

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 4ceb325c8f clang-tidy: range for loop conversions
Found with modernize-loop-convert

Ran through git clang-format.

Also removed several questionable loops and replaced with simpler
algorithms.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Luis Díaz Más 94b87a8dec Remove deprecated SSH support 4 years ago
Robin Mills d632988bbd Massive code prolog cleanup. 4 years ago
Robin Mills 9e2ac47cf9
Merge pull request #1475 from 1div0/BMFF
Base Media File Format
4 years ago
Robin Mills 02477faf4e Following review by @hassec, I use static base64_encoding vector in both Exiv2::base64encode() and Exiv2::base64decode().
I'm a little uneasy about changes to the API of the shared object/DLL.  I will investigate #890 during the release process.  So I have a plan to identify this if it's an issue.  I think it's OK.

```
703 rmills@rmillsmm-local:~/gnu/github/exiv2/bmff/build $ nm --demangle lib/libexiv2.dylib  | grep base64
00000000000384a0 T Exiv2::base64decode(char const*, char*, unsigned long)
0000000000038340 T Exiv2::base64encode(void const*, unsigned long, char*, unsigned long)
00000000001c33a0 s Exiv2::base64_encode
704 rmills@rmillsmm-local:~/gnu/github/exiv2/bmff/build $ nm -g --demangle lib/libexiv2.dylib  | grep base64
00000000000384a0 T Exiv2::base64decode(char const*, char*, unsigned long)
0000000000038340 T Exiv2::base64encode(void const*, unsigned long, char*, unsigned long)
705 rmills@rmillsmm-local:~/gnu/github/exiv2/bmff/build $
```
4 years ago
clanmills 4c52861a74 Fix msvc build breaker. 4 years ago
clanmills f1303cbcda Another effort to fix base64decode and associated unit test. 4 years ago
clanmills 87e536dadf Fix #1358. This should be in a different PR. Keep changes to base64 encode/decode together. 4 years ago
clanmills 21c610e952 Restoring i < dataLength trigraph that I should not have removed. 4 years ago
clanmills c59c53acf5 Trick to avoid msvc issue with final line of base64 data. 4 years ago
clanmills 1eeeecea50 Replaced Exiv2::base64encode() because last effort failed unit test on msvc. 4 years ago
clanmills 80e20304cb Fix Linux build breakers. 4 years ago
clanmills 5410395576 Replaced the ugly code in Exiv2::base64encode() and update the test suite. 4 years ago
Ingo Weyrich a6a47346a8 Use a.rfind(b, 0) == 0 instead of a.find(b) == 0 to reduce processing time when checking that a starts wit b, #1459 4 years ago
Luis Díaz Más b9164d9f8b Revert "change implementation of Exiv2::base64encode() to adopt implementation from same URL as base64decode()."
This reverts commit b596f311f4.
5 years ago
clanmills b596f311f4 change implementation of Exiv2::base64encode() to adopt implementation from same URL as base64decode(). 5 years ago
clanmills c7bcfcfbf8 replace base64encode in src/futils.cpp 5 years ago
clanmills 0a06dc9ee4 Issue identified in #1101 master/MinGW/Qt. Apply the change here (although this is working on 0.27-maintenance) 5 years ago