266 Commits (5479792d50b6270622ed0d1cd4ba64e188cc49e2)

Author SHA1 Message Date
Kevin Backhouse caf08b229e
dirLength == 0 can cause an infinite loop. 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
Christoph Hasse 758dd6bbc6 refactor!: remove free() function from DataBuf to avoid potential problems, see #1542 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 743da1a564 clang-tidy: use C++ casting
Found with google-readability-casting

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev ff39473c18 clang-tidy: convert to static
Found with readability-convert-member-functions-to-static

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
Rosen Penev 1b9b77c51f clang-tidy: add ending namespace comments
Found with google-readability-namespace-comments

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 091fd77885 clang-tidy: remove redundant member init
Found with readability-redundant-member-init

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 2e73aa9dc0 default con/destructors in headers
Helps to optimize trivially destructable stuff.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 9642e3cceb clang-tidy: remove pointless string init
Found with readability-redundant-string-init

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 1dc1186760 clang-tidy: simplify boolean expressions
Found with readability-simplify-boolean-expr

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Rosen Penev 8128716287 clang-tidy: use = default
Found with modernize-use-equals-default

Ran through git clang-format

Signed-off-by: Rosen Penev <rosenp@gmail.com>
4 years ago
Luis Díaz Más 8314030604 Revert "Remove deprecated EPS format"
This reverts commit 537cdad99e.
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 b5d3a1fd70 auto_ptr -> unique_ptr for code with WIN_UNICODE enabled 4 years ago
Luis Díaz Más 3eb1eee7fe Remove deprecated RiffVideo support 4 years ago
Luis Díaz Más 061ec1a75d Remove deprecated QuickTime support 4 years ago
Luis Díaz Más 8dcc07887a Remove deprecated Matroska support 4 years ago
Luis Díaz Más 94b87a8dec Remove deprecated SSH support 4 years ago
Luis Díaz Más 0bbaa6eff3 cpp: Replace auto_ptr by unique_ptr 4 years ago
Luis Díaz Más 537cdad99e Remove deprecated EPS format 4 years ago
Robin Mills d632988bbd Massive code prolog cleanup. 4 years ago
Miloš Komarčević 0da1a50afe Revert style changes 4 years ago
Miloš Komarčević e09d093ccf Minor whitespace formatting 4 years ago
Peter Kovář f0a321dedb [WIP] Base Media File Format 4 years ago
Robin Mills 0844e1bbfb Rename class ISOBMFF => class bmffImage to match other image handlers. Removed C++11 style code. Removed unused code. 4 years ago
Robin Mills 460a802671 Fix image handler to give jp2image code higher priority than the next isobmff code. 4 years ago
Peter Kovář 92469f4c27 [WIP] Add ISO/IEC Base Media File Format 4 years ago
clanmills 48afa7548d fix_1329_remove_bigtiff_0.27 5 years ago
tbeu f61fa2ed9d
Fix write ability flags of PSD files (#1260) 5 years ago
clanmills d07a1f94f8 fix_547_0.27 5 years ago
clanmills cc1a6033db fix_1045_0.27 5 years ago
clanmills 18ed65a25f fix_Sony2010e_0.27 Thanks to @sridharb1 5 years ago
Robin Mills 43683f1eff Fix #531 7 years ago
Luis Díaz Más ae49250942 Check in Image::printIFDStructure if seek and reads are OK 7 years ago
Dan Čermák 962962a8e9 Port Iptc::printStructure & getUshort to slices API
This fixes #211, #210, #209
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
Dan Čermák 7a7ae7a1df [image_int] Move internal functions into separate translation unit 7 years ago
Luis Díaz Más 54ad1bc91a Fix cppcheck issues: duplicateBreak 7 years ago
Luis Díaz Más 603692a1d8 Copyright to Exiv2 authors 7 years ago
Dan Čermák 7d9ed33bde Initialize DataBuf with 0s => fix valgrind error 7 years ago
Dan Čermák 607b19111c [DataBuf] Replace wrong usage of release() with free() 7 years ago
Dan Čermák efe2ccdcb6 Replaced all hardcoded error codes with ker... constants 7 years ago
tbeu 5b5987a596 Remove obsolete EXIV2_RCSID 8 years ago
tbeu 5df8b01b77 Remove obsolete svn revision 8 years ago
Luis Díaz Más 87a83c89d5
Merge branch 'master' into stringFormat_update 8 years ago
Dan Čermák 36df4bc997 Fixed potential out of bounds file access
This commit adds a out-of-bounds protection in the case that the
extracted values for offset & count are summed up larger than the size
of the file. Also this function checks for overflows before performing
the addition.

This fixes #159
8 years ago
Dan Čermák cfa5073a2c Added short explanation to internal function stringFormat 8 years ago
Dan Čermák 06cafadf4f Added assertion that call to vsnprintf succeeds 8 years ago
tbeu c0ea5f4fba Rewrite the reallocation the C++ way
* Fix handling of the return value of vsnprintf
* In C++11 we could use buffer.data instead of &buffer[0]
8 years ago
Michał Walenciak 7e90668011 Adding comment for issue #56 8 years ago
Robin Mills 2f0104879a Merge pull request #81 from piponazo/robinChanges
Robin changes
8 years ago
Luis Díaz Más 8ad49f6d73 Robin changes in sync with master changes 8 years ago
Dan Čermák 74cb5bab13 Fixed wrong brackets: size*count + pad can overflow before the cast
=> Should fix #76 (most of the work has been done by Robin Mills in
   6e3855aed7)

The problem with #76 is the contents of the 26th IFD, with the
following contents:
tag: 0x8649
type: 0x1
count: 0xffff ffff
offset: 0x4974

The issue is the size of count (uint32_t), as adding anything to it
causes an overflow. Especially the expression:
(size*count + pad+20)
results in an overflow and gives 20 as a result instead of
0x100000014, thus the condition in the if in the next line is false
and the program continues to run (until it crashes at io.read).

To properly account for the overflow, the brackets have to be removed,
as then the result is saved in the correctly sized type and not cast
after being calculated in the smaller type.

The brackets have also been removed from bigtiffimage.cpp, where the
same issue is present.
8 years ago
Robin Mills d8ae4484ae msvc support for bigtiffimage.cpp 8 years ago
clanmills 6e3855aed7 Fix https://github.com/Exiv2/exiv2/issues/55 8 years ago
Michał Walenciak 9acc1c56a7 adding ifd8 and long longs to is8ByteType() 8 years ago
Michał Walenciak b6e79357de Adding 8-byte swap functions + consts 8 years ago
Michał Walenciak 5ab1a0809d adopt to style 8 years ago
Michał Walenciak c008ad2403 making tag related functions private 8 years ago
Michał Walenciak bc6eed0b03 registering new file type 8 years ago
clanmills 21ac4ac61a Test suite changes due to https://github.com/Exiv2/exiv2/pull/68 8 years ago
Michał Walenciak dff941ad7f Do not print offset when it is used as tag's value 8 years ago
clanmills d366943297 Refactoring EXV_USE_CURL and EXV_USE_SSH 8 years ago
Michał Walenciak 20582a93c6 Marking members in a proper way. 8 years ago
Michał Walenciak 4e25435afb Changing return type of Image::tagName to std::string 8 years ago
Michał Walenciak ddb87fe0cf Moving static tagName() into Image class to prevent multithread crashes.
static variables inside of tagName() were not protected against multithread access.
It could cause a crash in case of simultaneous initialization of map of tags.
8 years ago
clanmills d3c2b99385 #1297 Fix submitted. 8 years ago
Robin Mills 77616c3204 #1289 Thanks to Asdiel (AlienSkin) for reporting this and providing a test file. Thanks to Ben for investigation and patch. 8 years ago
Robin Mills 6d5c2c3256 Getting ready to release v0.26 8 years ago
Robin Mills 012c544704 #1268 Fix submitted. Ben and Robin both discovered and fixed this independantly with the same fix! 8 years ago
Robin Mills dd4faaf831 #1277 Fix submitted. Thank You to Ben for reporting this and providing a patch. 8 years ago
Robin Mills fe6c71d0fa #1108 exiv2 -pR to dump type == tiffIfd 9 years ago
Robin Mills 49fbd1d761 #1108 Add support to dump MakerNote IFDs with exiv2 -pR 9 years ago
Robin Mills 81265684f0 #1108 Fixed bugs in printStructure(kpsRecursive) handling of RATIONAL data. 9 years ago
Robin Mills dd39d165e2 #1247 Fix Linux/GCC compilation warning. Added Hanno's file to the test suite. 9 years ago
Robin Mills 021bf5c237 #1247 Thank You Hanno for reporting this and providing a patch. 9 years ago
Robin Mills a057af1616 #1244. Removing experimental APIs introduced by r4637. I submitted those APIs just to retain the code somewhere. I have no plan to release such as API. 9 years ago
Robin Mills f5956d5db2 #1230 Fixes to read tiff with web-ready. Includes the BasicIo expiremental API readUnmarked() and markRead() which I will remove later. 9 years ago
Robin Mills 67efb34461 #1243. Correction to r4627 9 years ago
Robin Mills 2e9138cf91 #1243 Work-in-progress. Still to add code to writeMetadata for icc profiles. 9 years ago
Robin Mills 5f1d52e497 #1230 Added stdin-test and fixing issue identified by the test. 9 years ago
Robin Mills b46cac7790 #1126 Fixes submitted for msvc2003 9 years ago
Robin Mills 1bea0c6aeb #1108 Better string formatting (and associated test/data changes). Tweaks to code layout for r4497. 9 years ago
Robin Mills 5edc759cc9 #1074 For discussion see: http://dev.exiv2.org/issues/1074#note-23 9 years ago
Robin Mills 9ff2224fd7 #1074. Rollback r4479 which has inflicted a lot harm on the test harness. 9 years ago
Robin Mills 3aaebf50f7 #1074 Added ICC support to tiffimage.writeMetadata(). pngimage.readMetadata() is not complete. 9 years ago
Robin Mills 5f9807cbef #1216. Rollback r4448/6/2/1 r4439/38 to restabilize test suite on trunk. r4449 is copy of r4448 to branches/develop 9 years ago
sridharb 8a8ec67136 This is mainly a fix for #1206, but also interprets missing Canon Exif
Tags in exiv2 with the help of Phil Harvey's exiftool (see
http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Canon.html).

Even with these changes (toward #1204 and #1205), exiv2 lags behind
exiftool in some areas of interpretation of Canon tags. Ideally, a
catch-up effort to bring the code in source: canonmn.cpp in line with
lib/Image/ExifTool/Canon.pm. v10.25 of exiftool was used as reference
for this change.

#1206 seeks to address the fact that when Canon does not have data for
certain tags, they use specific default values in those fields. These
default values need to be ignored and not displayed. This change
brings this feature to exiv2, something that already exiftool does.

With regards to implementation, the struct TagInfo in source: tags.hpp
is extended with four new fields.

The first field is a bool that if set to true (default false), denotes
that this field has ignorable default values.

The second field is the default value that needs to be ignored. This
can be of four types (String, Long, Float, Rational). These four types
were chosen as they had conversion functions in the Value class.

The third field is the comparison type (default equal_to). There are
six comparison types possible (equal_to, not_equal_to, less,
less_equal, greater, greater_equal). This is the comparison applied to
the value stored in the tag's field and the default value specified
above. For e.g. if the value in the tag Exif.CanonCs.RecordMode is -1,
then it needs to be ignored.

The fourth field is the data type (default Long). This could have been
guessed from the type of the second field, but that would necessitate
making this structure into a template calling for changes in multitude
of files.

Usage: In source: canonmn.cpp, several exif tags now have ignorable
default properties. I will list a few examples.

1. Exif.CanonCs.FocusMode:        TagInfo(0x0007, "FocusMode", N_("Focus Mode"), N_("Focus mode setting"), canonCsId, makerTags, signedShort, 1, EXV_PRINT_TAG(canonCsFocusMode)),

There are no changes - i.e. this is an example of how the TagInfo
structure was being populated.

2. Exif.CanonCs.RecordMode:        TagInfo(0x0009, "RecordMode", N_("Record Mode"), N_("Record mode setting"), canonCsId, makerTags, signedShort, 1, EXV_PRINT_TAG(canonCsRecordMode), true, s_1_),

Take a look at the two new arguments. The first one (true) specifies
that there is a default value that can be ignored. The second one s_1_
specifies the value (-1, in this case) to be ignored.

	const UShortValue CanonMakerNote::s_1_(65535, unsignedShort); // Till bug is resolved

Note s_1_ is temporarily having the value 65535 till #1203 that causes
signedShorts to be interpreted as unsignedShorts is resolved.


3. Exif.CanonSi.TargetAperture:         TagInfo(0x0004, "TargetAperture", N_("Target Aperture"), N_("Target Aperture"), canonSiId, makerTags, unsignedShort, 1, printSi0x0015, true, us0_, TagInfo::less_equal),

Note the third argument TagInfo::less_equal. This combined with the
second argument us0_ (the number 0) signifies that any values in this
tag that are less than or equal (<=) to 0 should be ignored.

4. 		TagInfo(0x0028, "ImageUniqueID", N_("Image Unique ID"), N_("Image Unique ID"), canonId, makerTags, asciiString, -1, printValue, true, s0x16_, TagInfo::equal_to, TagInfo::String),

The previous examples have all been of Long type. This shows a case
where the default value is a string.

	const AsciiValue CanonMakerNote::s0x16_("0000000000000000");

Once these tag values have been defined, the actual mechanics of
ignoring these default values happens in Image::exifData().

Before the exifData is returned, we loop through the data, ask the
data whether it needs to be ignored (which in turn checks its
underlying tagInfo and compares it with the default value, if
specified) and if so, deletes that element.

A compile-time switch called EXV_DONT_IGNORE_UNDEFINED which when set
to a non-zero value will cause the behavior to revert back to the
original where all values are reported irregardless of the fact that
they need to be ignored.
9 years ago
draekko 6f7b3ba8f7 #1199 removed convenience converstion for iptc to xmp, apps should handle it directly since webp doesnt support iptc. 9 years ago
Robin Mills 104eb6b7fe #1199 Fixing MSVC build breaker involving long/uint64_t conflict. Minor changes to behaviour of Internal::binaryToHex() 9 years ago
draekko fe4f6f07f1 #1199 update to binaryToHex, should remove compile warnings and fix extra space padding. 9 years ago
Robin Mills b09c2049a6 #1199 Fixing build breaker introduced by r4369 9 years ago
draekko bcaa22ae6f #1199 removed warnings in stringToHex, enabled iptc support for WebPImage. 9 years ago
draekko 71fd0ae96e #1199 (as was discussed) moved WebPImage::debugPrintHex to Internal::binaryToHex 9 years ago
draekko 85cc2f745d #1199 Fixed crash with iptc by disabling it, updated decodeChunk to do better header checks, added hexdump function. 9 years ago
Robin Mills b3f107bd8c #1199 WebP Support (work in progress). Thank You to Ben for the patch. Thanks to Gilles for encouragement. 9 years ago
Robin Mills 664af57e10 #1034 Added samples/toexv This is a first step to write exif metadata to memory to send to a web service. 9 years ago