149 Commits (6f42d99132a7da02f7a8c5eb90ef742c92b0442d)

Author SHA1 Message Date
Rosen Penev cac362c728 remove warning supression
No longer relevant.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
1 year ago
Rosen Penev bc84f63223 replace copy_n + reinterpret_cast with memcpy
These usages are not problematic, but they would be if alignment does
not match. Also less verbose.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
1 year ago
Miloš Komarčević 71bb2b193a jp2image: fix IPTC & XMP UUIDs when writing 1 year ago
Miloš Komarčević 13c7d81a43 Add support for HTJ2K mime type 2 years ago
Rosen Penev 1837bf055e memcpy to copy_n conversions
The latter is more strict regarding types

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years ago
Rosen Penev 7473b4a715 optimize toAscii function with early exit
GCC is able to see that the branch is useless as it can be done at
compile time. Produces shorter assembly with both -O2 and -O3.

https://godbolt.org/z/ejhfxh8Tx

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years ago
Rosen Penev 7477293e41 avoid newer clang-format issue
More readable anyway.

Also remove specific version. Problems have been fixed already. All
versions should work the same now.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years ago
Rosen Penev 37184fd713 fix print format
Allows the compiler to actually diagnose formats.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
2 years ago
Rosen Penev 498f4ce273 simplify loops
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 0d353ac5f3 work around windows.h min/max macros
Signed-off-by: Rosen Penev <rosenp@gmail.com>
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 56249bb1a0 Use getULong to read unsigned numbers. 3 years ago
Rosen Penev b8855fb3b5 misc sonarlint cleanups
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 0c3da129f2
Replace assert with enforce. (Fix for https://github.com/Exiv2/exiv2/issues/2268) 3 years ago
Kevin Backhouse 1ada360774 Fix some incorrect format specifiers. 3 years ago
Kevin Backhouse ad4e13b827
Change return type of BasicIo::tell() to size_t. 3 years ago
Luis Díaz Más 941017d281
Fix issues on ARM builds (#2205)
* Specify base class initialization in Copy Constructor

* Fix printing of uint64_t variable in ARM 32bits

Use cinttypes

* Fix alignment issues on ARM 32 bits

* tests: add assertion with custom message
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
Luis Díaz Más ae4df71233 Remove DataBuf::copyBytes and use std::copy instead 3 years ago
Luis Díaz Más 1ad9e52f3c Fix windows build 3 years ago
Luis Díaz Más 1545a1bc4a JP2 - stronger checks on Signatuer and FileType boxes 3 years ago
Luis Díaz Más e7478f744d Jp2Image: Implement more checks from JP2 standard + fix bug
- add debug info when parsing Signature box
- Move definitions & static stuff to anonymous namespace
- cleanup while studying code
- Make exceptions more similar to other formats
3 years ago
Luis Diaz b48e8e9379 Add unit tests for Jp2Image revealing bugs (see #2147) 3 years ago
Luis Díaz Más 30bf563f4d Update .clang-format file & apply clang-format to whole project 3 years ago
Rosen Penev b2b6d834ba
some std::array conversions (#2148)
Signed-off-by: Rosen Penev <rosenp@gmail.com>
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 f894ee0568 Fix debug builds 3 years ago
Luis Díaz Más f156af46f3 Fix build on Windows 3 years ago
Luis Díaz Más 8b1fe379a1 Removing unused headers thanks to IWYU 3 years ago
Rosen Penev 6d1fa2ecea clang-tidy: use empty() instead of size()
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 5d627433fc Remove useless DataBuf::clear() 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
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 ffde235336
Add comment to explain the bounds-check. 4 years ago
Kevin Backhouse 67e2ef5ccd
Check size before allocation to avoid out-of-memory errors. 4 years ago