Commit Graph

146 Commits

Author SHA1 Message Date
Luis Díaz Más
1a3e93856b More tests for rational convertions 2022-04-14 10:41:00 +02:00
Luis Díaz Más
8da71e7133 Test parseUint32 and fix it when number is out of limits 2022-04-14 10:41:00 +02:00
Luis Díaz Más
331924612e Remove duplication by using templates 2022-04-14 10:40:59 +02:00
Luis Díaz Más
2b91b5daf9 More tests for DataBuf read/write functions 2022-04-14 10:40:59 +02:00
Luis Díaz Más
6964f5f9f2 DataBuf::c_data() returns nullptr when empty + avoid duplication
After the previous commit, I realized that std::vector::data() also
returns nullptr when the vector is empty. So I decided to emulate this
behavior in DataBuf::c_data().

Anyways, the changes done in the previous commit are valid and allow us
to avoid some processing when the DataBuf is empty.
2022-04-14 10:40:58 +02:00
Luis Díaz Más
4a4a8c544c Throwing when trying to access TooFar elements in DataBuf 2022-04-14 10:40:57 +02:00
Luis Díaz Más
f942ba89bd Move Photoshopb class to internal namespace 2022-04-10 10:55:10 +02:00
Luis Diaz
a505d6f06c More unit tests for Photoshop methods 2022-04-06 15:55:31 +02:00
Luis Diaz
8ab7800477 Remove 2nd param from Photoshop::isIrb() since it is always hardcoded 2022-04-06 15:55:29 +02:00
Luis Diaz
7366a64d44 Add unit tests for Photoshop::isIrb().
It has been detected that we need to always pass the size==4 in the call
to isIrb. Probably it is better to remove that parameter and document
that it is assumed for the buffer to have a length of 4 bytes.
2022-04-06 15:18:43 +02:00
Rosen Penev
dfb93dd8cd clang-tidy: use C++ headers
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-04-01 16:38:04 -07:00
Luis Díaz Más
d16ca65b01 Fix out of bounds read in isValidBoxFileType() 2022-04-01 08:05:00 +02:00
Luis Díaz Más
3b9fcb4b3d Update .clang-format to align pointers to the types 2022-04-01 07:55:07 +02:00
Luis Díaz Más
d7f35e33f0 Remove useless static_casts 2022-03-25 08:43:37 +01:00
Luis Díaz Más
1545a1bc4a JP2 - stronger checks on Signatuer and FileType boxes 2022-03-18 14:55:16 +01:00
Luis Diaz
b48e8e9379 Add unit tests for Jp2Image revealing bugs (see #2147) 2022-03-18 14:36:35 +01:00
Luis Díaz Más
30bf563f4d Update .clang-format file & apply clang-format to whole project 2022-03-16 22:30:53 +01:00
Luis Diaz
65568b056e Add unit tests for Error class 2022-03-12 16:58:41 +01:00
Luis Díaz Más
7119b7676f remove templating & simplify error message
+ clang-format in Error files
+ Remove AnyError
2022-03-12 16:58:41 +01:00
Luis Díaz Más
96f7f2e4c5 Convert Exiv2::ErrorCode into an enum class 2022-03-12 16:58:40 +01:00
Luis Diaz
56c52be8b5 DateValue is now a bit more permissive with malformed dates 2022-03-11 19:57:55 +01:00
Luis Diaz
c1ae1bcb03 Recover IptDataSets::recordId in the API 2022-03-10 09:05:49 +01:00
Rosen Penev
3a2309bfea clang-tidy: replace typedef with using
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-04 15:54:05 -08:00
Rosen Penev
887b08b0b7 clang-tidy: range loop conversion
Signed-off-by: Rosen Penev <rosenp@gmail.com>
2022-03-04 15:54:05 -08:00
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
2022-03-04 11:44:39 +01:00
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
2022-02-27 09:41:47 +01:00
Luis Díaz Más
5d627433fc Remove useless DataBuf::clear() 2022-02-27 09:36:46 +01:00
Luis Díaz Más
56b5ab9a29 Use remove from filesystem 2022-02-18 18:01:02 +01:00
Luis Díaz Más
f1ff3aaa4c Make urldecode in-place 2022-02-18 17:54:04 +01:00
Luis Díaz Más
405f4b5f1b Remove Util::dirname and finally the util files 2022-02-18 13:51:38 +01:00
Luis Díaz Más
1b912fa887 get rid of suffix 2022-02-18 13:51:38 +01:00
Luis Díaz Más
d64c2aad67 Replace dirname implementation with std::filesystem 2022-02-18 13:51:38 +01:00
Luis Díaz Más
49fbfb44a3 Remove startsWith from utils 2022-02-18 13:51:37 +01:00
Luis Díaz Más
a725d22ea5 add characterisation tests for utils 2022-02-18 13:51:37 +01:00
Luis Diaz
b7d5c7e22a Link against stdc++fs on Linux when it is needed 2022-02-16 14:39:10 +01:00
Luis Díaz Más
690dde3440 Add tests for ImageFactory::checkMode (for all the supported image types) 2022-02-14 17:08:50 +01:00
Luis Díaz Más
335b4a71ed test ImageFactory::load with existing images in test/data 2022-02-14 17:08:50 +01:00
Luis Díaz Más
f10283f118 bug: Fix crash when calling ImageFactory::create(none) 2022-02-14 17:08:50 +01:00
Luis Díaz Más
012ce835c2 New tests to check what happens with ImageFactory::create(crazyValue) 2022-02-14 17:08:50 +01:00
Luis Díaz Más
fd92ed0a31 No need anymore to include each image header to use the ImageFactory 2022-02-14 17:08:50 +01:00
Luis Díaz Más
c499d02dbf Add characterisation test for ImageFactory::create(type)
- Split test identifying which Images can be created and which not
- Add tests for the ImageFactory::create(type, filePath)
2022-02-14 17:04:55 +01:00
Luis Díaz Más
0f03e77634 Simplify code around UniquePtr(s) & use make_unique over new 2022-02-05 11:02:04 +01:00
Luis Díaz Más
9d8dd86945 Use auto to reduce verbosity around code dealing with iterators 2022-02-05 11:02:03 +01:00
Luis Díaz Más
c531c4abf5 More tests for IptcDataSets 2022-02-04 17:21:10 +01:00
Luis Diaz
9573f1edcc Fix MSVC warnings by casting integer values 2022-02-04 17:21:10 +01:00
Luis Díaz Más
9b40f948eb More tests 2022-02-04 17:21:10 +01:00
Luis Díaz Más
d8fcbc4562 Add new tests for Iptc classes 2022-02-04 17:21:10 +01:00
Luis Díaz Más
071e73fa4d Add many tests for datasets 2022-02-04 17:21:10 +01:00
Luis Díaz Más
a94d648d05 Rest of tests to have 100% coverage in BMP class 2022-02-04 17:21:10 +01:00
Luis Diaz
edf39e00dd Add new BMP tests 2022-02-04 17:21:10 +01:00