109 Commits (1ae47bcfd8c20e862989b4f24f29278740349cfb)

Author SHA1 Message Date
Rosen Penev 9ae339d39f clang: fix various documentation errors
Found with -Wdocumentation

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years ago
Rosen Penev 22b12012a6 more SonarLint cleanups
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years ago
Rosen Penev 725875497b SonarLint cleanups 2 years ago
Rosen Penev 376638259d namespace enforce.hpp functions to Internal
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years ago
Rosen Penev 842ef05ee6 return nullptr instead of reset
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years ago
Kevin Backhouse bf151a17a3
Don't allow zero width/height in WebPImage::inject_VP8X 3 years ago
Rosen Penev c64ed25c13 remove unused using
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Kevin Backhouse cc604780be
Merge pull request #2283 from kevinbackhouse/printStructure-depth
Convert type of depth parameter to size_t
3 years ago
Rosen Penev 1d0530f04d misc sonarlint changes
Mostly const changes.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Kevin Backhouse b0040e3bbe
Convert type of depth parameter to size_t. 3 years ago
Kevin Backhouse 0f1ea7571b
Refactor printTiffStructure depth increment 3 years ago
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
Kevin Backhouse 7f673c766d
Fix some "signed shift" warnings 3 years ago
Kevin Backhouse b3f2ab5988
Fix some "signed shift" warnings. 3 years ago
Kevin Backhouse ad4e13b827
Change return type of BasicIo::tell() to size_t. 3 years ago
Rosen Penev cf963e9e4d clang-tidy: C casts to C++
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Rosen Penev b4c90b5e16 clang-tidy: replace pointer magic with data()
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Luis Díaz Más c3d0100d48 Fixing bad usages of DataBuf (when it is empty) 3 years ago
Rosen Penev 0d971e98e4 remove some unique_ptrs
They're not really used as pointers.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Rosen Penev bad4712df8 static constexpr conversions
Signed-off-by: Rosen Penev <rosenp@gmail.com>
3 years ago
Luis Díaz Más d7f35e33f0 Remove useless static_casts 3 years ago
Luis Díaz Más ae4df71233 Remove DataBuf::copyBytes and use std::copy instead 3 years ago
Luis Díaz Más 30bf563f4d Update .clang-format file & apply clang-format to whole project 3 years ago
Luis Díaz Más 96f7f2e4c5 Convert Exiv2::ErrorCode into an enum class 3 years ago
Luis Díaz Más f894ee0568 Fix debug builds 3 years ago
Luis Díaz Más b3a216310a Removing unused headers thanks to IWYU 3 years ago
Rosen Penev 04bacdedd6 clang-tidy: use auto
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 b9f9d041ea Several transformations on DataBuf + migration to size_t
- Provide begin/end iterators to DataBuf and simplify code
- Adapt test output after last changes
- Replacing long by size_t in value.hpp
- Use size_t in some Photoshop functions
- Remove some static_casts
3 years ago
Luis Díaz Más 21eb0cec4f Fix build when EXIV2_BUILD_MESSAGES is ON 3 years ago
Luis Díaz Más 8b3da36f42 Improvements from code review 3 years ago
Luis Díaz Más ea201ce613 Remove dead code 3 years ago
Luis Díaz Más a6185d29c6 Image::setComment now takes string_view 3 years ago
Luis Díaz Más 0f03e77634 Simplify code around UniquePtr(s) & use make_unique over new 3 years ago
Josh Soref e56abfa10a
Spelling (#2067)
* spelling: accelerometer

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: address

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: anonymous

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: available

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: baby

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: buffer

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: build

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: builds

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: by inclusion

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: byte order

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: camera

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: command

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: consistency

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: constructor

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: continuous

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: continuously

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: correspond

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: decompression

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: dedicated

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: denominator

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: dependencies

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: detector

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: dlighting

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: dragging

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: duplicate

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: dynamic

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: empty

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: enable

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: endianness

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: examining

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: exceed

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: extension

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: fact

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: fails

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: fixed

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: fluorescent

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: focuspoint

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: focuspoints

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: from

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: happened

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: hierarchy

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: initiate

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: interesting

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: internal

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: javascript

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: language

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: libiconv

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: libraries

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: library

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: localization

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: macros

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: member

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: members

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: metadata

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: miscellaneous

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: mnemonic

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: modified

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: multiple

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: multithreaded

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: mysterious

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: photoshop

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: platforms

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: preliminary

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: priority

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: properties

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: qualifier

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: recognition

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: recognized

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: reentrancy

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: remaining

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: remotetest

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: requested

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: sensitivity

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: standardize

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: successful

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: such

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: tags

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: temperature

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: test

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: the

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: these

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: third

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: this

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: transparent

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: unable

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: underwater

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: uninterpreted

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: using

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: utc - coordinated universal time

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: which

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

* spelling: with

Signed-off-by: Josh Soref <jsoref@users.noreply.github.com>

Co-authored-by: Josh Soref <jsoref@users.noreply.github.com>
3 years ago
Kevin Backhouse 68473d9d10
Remove static functions readOrThrow and seekOrThrow. 4 years ago
Kevin Backhouse 44542a9f94
Add readOrThrow and seekOrThrow to BasicIo. 4 years ago
Kevin Backhouse 81cfc162c1
Use std::move to transfer ownership of DataBufs. 4 years ago
Kevin Backhouse 9ff72e5ca5
Make offset=0 the default parameter. 4 years ago
Kevin Backhouse c9d0cf3643
Make fields of DataBuf private. 4 years ago
Kevin Backhouse 5bc444ff00
Use DataBuf rather than raw malloc. 4 years ago
Kevin Backhouse 2b84f4bd64
fix: zero initialize local variables. (#1743)
* Zero initialize local variables.

* Initialize xmpID_
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 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 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
Kevin Backhouse ca66136092 Use readOrThrow to check error conditions of iIo.read().
(cherry picked from commit 0f9eb74c44c908e170a64cab590949d53749af8e)
4 years ago
Rosen Penev 8337462032 clang-tidy: use empty() instead of comparing size
Found with readability-container-size-empty

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