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
Kevin Backhouse
783b3a6ff1
Improve bound checking in WebPImage::doWriteMetadata()
4 years ago
Luis Díaz Más
de4d43d4d1
Fix warnings EXIV2_TEAM_EXTRA_WARNINGS
...
Most of the warnings fixed were:
- Hiding of local variables
- Hiding of globals
- Useless casts
- Conversions between float/double
4 years ago
Luis Díaz Más
0bbaa6eff3
cpp: Replace auto_ptr by unique_ptr
4 years ago
Robin Mills
d632988bbd
Massive code prolog cleanup.
4 years ago
clanmills
2bad338b9d
Fix compiler warning on macOS about enforce condition being always true.
5 years ago
Luis Díaz Más
e925bc5add
Fix integer overflow by checking size against header_size
...
Note that the problem occurs when data_size is less than header_size
what causes a buffer overflow in &data[i]
Co-Authored-By: D4N <dan.cermak@cgc-instruments.com>
6 years ago
Luis Díaz Más
113136e134
Replace DEBUG with EXIV2_DEBUG_MESSAGES
...
Fixes #926
6 years ago
Kevin Backhouse
6a44698abc
Small change to comment.
6 years ago
Kevin Backhouse
3c818f49d9
Revert accidental whitespace change.
6 years ago
Kevin Backhouse
3faeaefbf5
Improve portability of bounds checks.
6 years ago
Kevin Backhouse
86816c0280
Fix signed/unsigned mismatch.
6 years ago
Kevin Backhouse
caa4e6745a
Avoid negative integer overflow when `filesize < io_->tell()`.
...
This fixes #791 .
6 years ago
Robin Mills
a33041a8b7
Fix: https://github.com/Exiv2/exiv2/issues/562 for stringFormat() crashes.
7 years ago
Robin Mills
03b4f1deae
Fix: https://github.com/Exiv2/exiv2/issues/580
7 years ago
skal
ecaf1dd478
Fix alpha bit detection in VP8L chunks
...
As per the spec ([1]), the alpha_bit is located on the 4th byte of the payload, just after the height.
This seems to fix the bug reported on GIMP ([2]) where an incorrect file was generated.
[1] https://developers.google.com/speed/webp/docs/webp_lossless_bitstream_specification#2_riff_header
[2] https://gitlab.gnome.org/GNOME/gimp/issues/1818
7 years ago
Dan Čermák
fec6535ae8
[binaryToString] Reimplement using Slices
...
- reimplement binaryToString:
- it now accepts a Slice and nothing else
- it does not return a std::string but instead a proxy object that implements
operator<< (this should be more efficient, as we do not need to touch the
heap in most cases)
- addapt unit tests
- replace all occurences with the new API
7 years ago