Commit Graph

129 Commits

Author SHA1 Message Date
Robin Mills
9e2ac47cf9
Merge pull request #1475 from 1div0/BMFF
Base Media File Format
2021-03-10 10:34:21 +00:00
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 $
```
2021-03-10 10:02:01 +00:00
clanmills
4c52861a74 Fix msvc build breaker. 2021-03-08 16:01:26 +00:00
clanmills
f1303cbcda Another effort to fix base64decode and associated unit test. 2021-03-08 08:58:24 +00:00
clanmills
87e536dadf Fix #1358. This should be in a different PR. Keep changes to base64 encode/decode together. 2021-03-08 08:45:45 +00:00
clanmills
21c610e952 Restoring i < dataLength trigraph that I should not have removed. 2021-03-07 20:25:04 +00:00
clanmills
c59c53acf5 Trick to avoid msvc issue with final line of base64 data. 2021-03-06 21:18:58 +00:00
clanmills
1eeeecea50 Replaced Exiv2::base64encode() because last effort failed unit test on msvc. 2021-03-06 20:23:19 +00:00
clanmills
80e20304cb Fix Linux build breakers. 2021-03-06 18:38:09 +00:00
clanmills
5410395576 Replaced the ugly code in Exiv2::base64encode() and update the test suite. 2021-03-06 18:13:30 +00:00
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 2021-01-26 18:41:30 +01:00
Luis Díaz Más
b9164d9f8b Revert "change implementation of Exiv2::base64encode() to adopt implementation from same URL as base64decode()."
This reverts commit b596f311f4.
2020-10-16 09:02:52 +02:00
clanmills
b596f311f4 change implementation of Exiv2::base64encode() to adopt implementation from same URL as base64decode(). 2020-10-15 20:13:50 +01:00
clanmills
c7bcfcfbf8 replace base64encode in src/futils.cpp 2020-10-15 15:49:20 +01:00
clanmills
0a06dc9ee4 Issue identified in #1101 master/MinGW/Qt. Apply the change here (although this is working on 0.27-maintenance) 2020-05-02 16:50:21 +01:00
clanmills
13565be3d2 Change for solaris. 2020-04-15 16:53:03 +01:00
clanmills
d8a513b7df Updated following code review. 2019-06-10 22:02:51 +01:00
clanmills
742cd5885b Fixing Windows build-breaker for EXV_UNICODE_PATH in Protocol fileProtocol(const std::wstring& path) 2019-06-07 13:49:56 +01:00
clanmills
ab0b97c729 fix895-ICCProfile-FalseWarning 2019-06-06 12:33:09 +01:00
Robin Mills
b0a9cb5624 NetBSD/FreeBSD Support 2019-05-12 16:41:58 +02:00
clanmills
282e99b6b0 Fix #610
(cherry picked from commit 54367e18ed0bf8bae6d8449341a6f82779f6d3c7)
2019-03-03 08:44:20 +01:00
Luis Diaz Mas
acc9fa012d Reliable detection of strerror_r variants 2019-01-06 23:59:40 +01:00
Natanael Copa
480430d397 Fix usage of strerror_r
Only GNU libc has implementation of the GNU variant of strerror_r, so
also for __GLIBC__ to determine which strerror_r implemenation to use.

This fixes build with musl libc, which makes some, but not all, GNU
extensions available with _GNU_SOURCE.
2018-12-25 16:08:51 +01:00
Robin Mills
23483dff86 #571 Restore the original windows getProcessCode() because Microsoft's GetModuleFileName isn't effective! 2018-11-30 14:18:17 +01:00
Robin Mills
108509a089 Correction to Microsoft sample code! https://docs.microsoft.com/en-gb/windows/desktop/Services/installing-a-service 2018-11-30 14:18:17 +01:00
Robin Mills
9cb6c1e4c9 Correction in futils.cpp 2018-11-30 14:18:17 +01:00
Robin Mills
22e49cc78b Try to fix https://github.com/Exiv2/exiv2/issues/572 2018-11-30 14:18:17 +01:00
clanmills
c5cd09bebe Fix getProcessPath() on Cygwin 2018-11-16 17:23:47 +01:00
clanmills
2f70ae4305 Fix getProcessPath() 2018-11-16 17:23:47 +01:00
Luis Díaz Más
aae84e4643 Add missing inclusions of cstdio and cstdarg 2018-11-11 12:27:26 +01:00
Luis Díaz Más
38ed6de05d MSVC: Move compile definitions from config.h to CMake.
+ Also remove inclusion of <Windows.h> from config.h
2018-11-11 12:27:26 +01:00
Luis Díaz Más
7485bb54d7 Create function getProcessPath and add unit test for it
Debugging: Relative and Absolute path alternatives
2018-11-11 12:27:26 +01:00
Luis Díaz Más
603692a1d8 Copyright to Exiv2 authors 2018-09-12 19:22:31 +02:00
Dan Čermák
9f1a5a1ebb [futils] Change signature of getEnv to take an int
While taking an EnVar as the parameter is more clear it has the
disadvantage, that passing anything outside of the range of the
enumeration is undefined behavior. The compiler could then optimize
the range check in getEnv away (perfectly legal due to UB), leading
to buffer overreads.
2018-08-27 17:22:33 +02:00
Luis Diaz Mas
eb306fdbae Substitute malloc/free with new/delete 2018-08-27 13:24:47 +02:00
Luis Diaz Mas
eefee8125b to_hex and from_hex removed from API 2018-08-27 13:24:47 +02:00
tbeu
bb9034e029 Do not implicitly cast enum to Boolean
V768 The expression 'fileProtocol(path)' is of enum type. It is odd that it is used as an expression of a Boolean-type. futils.cpp 288
2018-06-02 09:43:20 +02:00
tbeu
75cdbc8b91 Use pre-increment on iterators
V803 Decreased performance. In case 'userEnd' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. futils.cpp 405
V803 Decreased performance. In case 'authEnd' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. futils.cpp 410
V803 Decreased performance. In case 'hostEnd' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. futils.cpp 428
V803 Decreased performance. In case 'e' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. epsimage.cpp 711
V803 Decreased performance. In case 'e' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. epsimage.cpp 841
V803 Decreased performance. In case 'e' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. epsimage.cpp 958
V803 Decreased performance. In case 'i' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. epsimage.cpp 855
V803 Decreased performance. In case 'it' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. jpgimage.cpp 817
V803 Decreased performance. In case 'lib' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. version.cpp 508
V803 Decreased performance. In case 'it' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. version.cpp 563
V803 Decreased performance. In case 'it' is iterator it's more effective to use prefix form of increment. Replace iterator++ with ++iterator. xmpsidecar.cpp 138
2018-06-02 09:43:20 +02:00
Luis Díaz Más
e32323d7c7 Simplify usage of strerror_r.
- Define STRERROR_R_CHAR_P properly on CMake and use it on futils.cpp
- We use now _GNU_SOURCE to determine which version of strerror_r to use
- strError only throws if ret==ERANGE
- Remove STRERROR_R_CHAR_P. It has been never used
- sort defines in config.h.cmake
- Remove EXV_HAVE_DECL_STRERROR_R that is not used anymore
- Remove EXV_HAVE_STRERROR. C++98 always will have it
2018-05-07 10:25:26 +02:00
Luis Díaz Más
f36bea3801 exiv2::getEnv throws std::out_of_range on unexpected EnVar
This change define explicitly the behavior that exiv2::getEnv should have
on response to unexpected inputs.

There are some other minor changes:

- Use _putenv_s for the unit tests on Windows
- Add todo comment
- Remove deprecated note about freeing memory
2017-12-06 17:29:05 +01:00
Luis Díaz Más
8dc3c1f0a0 Replace malloc/free by new/delete. Use const char* for input arg 2017-12-06 17:29:05 +01:00
Luis Díaz Más
bfe057ca20 Auto-formatting done by the IDE while touching code in the previous commits 2017-12-06 17:29:05 +01:00
Luis Díaz Más
8b049922d7 Change exiv2::urlencode signature to return std::string
The goal of this change is to remove the responsibility from the client code to
free the memory of the returned string.
2017-12-06 17:29:05 +01:00
tbeu
5b5987a596 Remove obsolete EXIV2_RCSID 2017-11-19 11:17:12 +01:00
tbeu
5df8b01b77 Remove obsolete svn revision 2017-11-19 11:17:11 +01:00
Robin Mills
192a2a83cf #1279 Cleaned up doxygen warnings for doc and website. 2017-03-16 18:13:12 +00:00
Robin Mills
6d5c2c3256 Getting ready to release v0.26 2017-03-08 20:42:28 +00:00
Andreas Huggel
fd80993ab0 Updated copyright notice. 2015-05-02 11:55:40 +00:00
Robin Mills
4c607b9862 #1065. Thanks to Thomas B for spotting my error in omitting support for https. 2015-04-25 19:47:29 +00:00
Robin Mills
0f36e0492c #1065. Fixing thread safety in fileProtocol. Thank You, Max for reporting this. 2015-04-25 19:04:26 +00:00
Robin Mills
f2abf92fd7 #1013 and #1015. Thank You, Thomas, for reporting these and for the fixes. 2015-01-02 09:17:56 +00:00
Robin Mills
d393b0fa7e trunk: exiv2 v0.25 2014-12-25 13:55:57 +00:00
Robin Mills
74461dd370 Issue: 940. Simplified (and hopefully final) fix. 2013-12-28 18:20:43 +00:00
Robin Mills
e74bdfbf36 Issue: 940. More changes for GCC 4.8.1.2 2013-12-28 06:21:57 +00:00
Robin Mills
4adddce153 Issue: 940. Compiler warnings. Really should fix the mess concerning str_error_r in autotools and CMake in the config directory. 2013-12-28 06:11:10 +00:00
Robin Mills
cea66bdd78 Issue: #940. Changes to eliminate compiler warnings with GCC 4.8.1.2 on Linux. 2013-12-28 06:03:03 +00:00
Robin Mills
89c796a3ab Issue: #940. Fix compilation warnings. 2013-12-28 03:41:01 +00:00
Robin Mills
4e530fbce0 Bumping the copyright notice again. (re-doing 3089 without breaking the build!) 2013-07-24 05:15:04 +00:00
Robin Mills
a297d2b69e Rollback 3089 - somehow it's broken the build! 2013-07-24 05:05:52 +00:00
Robin Mills
da1ed8c536 Bumping the copyright notice in src &samples from 2012 to 2013 2013-07-24 03:12:38 +00:00
Robin Mills
e82d40e915 Issue: #908. futils.cpp strError() does not report correct error string. 2013-06-19 14:53:09 +00:00
Andreas Huggel
0d397b95c7 Updated copyright message for 2012. 2012-03-22 15:19:35 +00:00
Andreas Huggel
7770151915 Updated Copyright message for 2011. 2011-02-13 14:08:44 +00:00
Andreas Huggel
06ce0d18b6 - Introduced exiv2.hpp as a wrapper to include all Exiv2 objects. (Renamed existing exiv2.hpp to exiv2app.hpp)
- Changed Sony/Minolta pretty-print function to print EV value
- Renamed rcsid.hpp to rcsid_int.hpp, do not publish it anymore
2010-06-27 10:04:39 +00:00
HumanDynamo
46a6f318b2 apply patch from BUG #688 2010-04-14 08:09:11 +00:00
Andreas Huggel
6d496a4888 Updated Copyright notice for 2010. 2010-04-03 07:53:30 +00:00
Andreas Huggel
370af5c8a3 Merged all changes from the unstable branch into the trunk. 2009-11-27 05:59:23 +00:00
Andreas Huggel
8a6d9dbc42 Updated Copyright notice for 2009. 2009-02-16 14:30:51 +00:00
Andreas Huggel
105a4e417d Changed FileIo::transfer to only write a warning if changing file permissions fails and fixed the use of strerror_r. Fixes digiKam bug 178103. 2008-12-30 15:54:46 +00:00
Andreas Huggel
3ac665a305 Added 2008 to Copyright notice. 2008-01-09 16:44:09 +00:00
Andreas Huggel
52ddfc5938 Minor cleanup (memset -> std::memset, memcpy -> std::memcpy). 2007-09-24 14:30:10 +00:00
Andreas Huggel
da6266da3b Copyright updates for 2007 2007-02-02 10:09:31 +00:00
Andreas Huggel
9daaaa3f6d Fixed compiler warnings 2006-06-21 09:16:36 +00:00
Andreas Huggel
cbc9a5bbaa Fixed to use GNU version of strerror_r where needed 2006-01-18 02:48:52 +00:00
Andreas Huggel
99b4e71459 Updated copyright and fsf address 2006-01-17 14:53:57 +00:00
Andreas Huggel
a0f0c0e18c Another update on the way to CRW write-support. Still not complete; don't use 2006-01-11 03:24:03 +00:00
Andreas Huggel
06e5c0719e Removed trailing whitespace from source files 2005-10-08 11:25:44 +00:00
Andreas Huggel
773e6c6fa1 Use re-entrant system functions (gmtime_r, strerror_r) if available 2005-09-25 10:30:58 +00:00
Andreas Huggel
55aebc0686 Overhauled exception handling. The new class Error has a list of error messages, which is selected based on the error code provided in the constructor.
Image::read/writeMetadata and ImageFactory::open now throw Error in case of failure. Applications therefore now need an exception handler for the error handling of such function calls. This should result in shorter and simpler application code.
2005-04-17 11:51:32 +00:00