Merge branch '0.27-maintenance' into sridharb1_contrib_msvc4_0.27
125
CONTRIBUTING.md
@ -4,50 +4,42 @@ Contributing to the Exiv2 Project
|
||||
# Contents #
|
||||
|
||||
* [1. Introduction](#1-introduction)
|
||||
* [2. Recommended Workflow for Contributing Code](#2-recommended-workflow-for-contributing-code)
|
||||
* [3. Contributing Lens Data](#3-contributing-lens-data)
|
||||
* [4. Reporting Bugs](#5-reporting-bugs)
|
||||
|
||||
* [2. Contributing code via GitHub](#2-contributing-code-via-github)
|
||||
* [3. Contributing code via email](#3-contributing-code-via-email)
|
||||
* [4. Contributing Lens Data](#4-contributing-lens-data)
|
||||
* [5. Reporting Bugs](#5-reporting-bugs)
|
||||
|
||||
# 1. Introduction #
|
||||
|
||||
This file describes how users and developers can contribute to the Exiv2 project. We welcome any help, like for example, contributing lens data (images), code contributions, and bug reports.
|
||||
In the past this was organized using Redmine at: [dev.exiv2.org](http://dev.exiv2.org). As of April 2017 the Exiv2 project has moved from svn and Redmine to GitHub and information, such
|
||||
as, Wikis etc., will gradually be moved from Redmine to GitHub. User requests on the Redmine forums and the Redmine issue tracking system will be serviced until Exiv2 0.27 is released.
|
||||
After 0.27 is released the Redmine site will be read-only and all feature requests, bug reports etc., must be performed on GitHub. It is, however, preferred to use GitHub for all new
|
||||
feature requests and bug reports to Exiv2.
|
||||
We welcome any help, for example contributing lens data (images), code contributions and bug reports.
|
||||
|
||||
# 2. Recommended Workflow for Contributing Code #
|
||||
# 2. Contributing code via GitHub #
|
||||
|
||||
Here we describe the recommended code contribution workflow after switching to GitHub. Code contributions is performed by using *pull requests* (PR) on GitHub.
|
||||
For this to work one first needs to [create a user account on GitHub](https://help.github.com/articles/signing-up-for-a-new-github-account/) if one do not
|
||||
already have one. A PR should preferable contain only one new feature/bug fix etc. Since it is not uncommon to work on several PRs at the same time
|
||||
Code contributions can be performed via *pull requests* (PR) on GitHub (if you cannot or do not want to use GitHub, see [3. Contributing code via email](#3-contributing-code-via-email)).
|
||||
For this to work you first need to [create a user account on GitHub](https://help.github.com/articles/signing-up-for-a-new-github-account/) if you don't already have one.
|
||||
A pull request should preferable contain only one new feature or bug fix etc. Since it is not uncommon to work on several PRs at the same time
|
||||
it is recommended to create a new _branch_ for each PR. In this way PRs can easily be separated and the review and merge process becomes cleaner.
|
||||
As a rule-of-thumb:
|
||||
|
||||
- PRs should be kept at a manageable size. Try to focus in just one goal per PR. If you find yourself doing several things in a PR that were not expected,
|
||||
then try to split the different tasks in different PRs.
|
||||
- PRs should be kept at a manageable size. Try to focus on just one goal per PR. If you find yourself doing several things in a PR that were not expected,
|
||||
then try to split the different tasks into different PRs.
|
||||
- Commits should always change a *single* logical unit so that cherry-picking & reverting is simple.
|
||||
- Commit messages should be as informative and concise as possible. The first line of the commit message should be < 80 characters and
|
||||
describe the commit briefly. If the 80 characters are too short for a summary, then consider splitting the commit. Alternatively, below the short summary
|
||||
add one blank line and then a more detailed explanation if required.
|
||||
- Commit messages should be as informative and concise as possible. The first line of the commit message should be < 80 characters and
|
||||
describe the commit briefly. If the 80 characters are too short for a summary, then consider splitting the commit. Optionally, add one blank line
|
||||
below the short summary and write a more detailed explanation if necessary.
|
||||
|
||||
See the [GIT_GUIDELINES.md](GIT_GUIDELINES.md) file for a more detailed description on the git workflow.
|
||||
See the [GIT_GUIDELINES.md](git_guidelines.md) file for a more detailed description of the git workflow.
|
||||
|
||||
Also, there are two recommended ways to work on the code: 1) one can create a _fork_ of the main Exiv2 repository and work on that fork, or 2) one can create a branch
|
||||
on the main repository and work in the branch. Using the "fork" method only you can push commits to your fork whereas on the latter method other Exiv2 team members
|
||||
can commit changes to the branch. Working on a branch on the main repository is the recommended method for team members since one needs push rights to the main repo
|
||||
and all other developers should use the fork method which we will now describe in more detail.
|
||||
|
||||
Below we outline the recommended steps in the code contribution workflow. We use `your-username` to refer to your username on GitHub, `exiv2_upstream` is used when we
|
||||
set the upstream remote repository for Exiv2 (we could have picked any name by try to avoid already used names like, in particular, `origin` and `master`), and
|
||||
we use the name `my-new-feature` for the branch that we create (eg., the branch name should reflect the code change being made).
|
||||
Below we outline the recommended steps in the code contribution workflow. We use `your-username` to refer to your username on GitHub, `exiv2_upstream` is used when we
|
||||
set the upstream remote repository for Exiv2 (we could have picked any name by try to avoid already used names like, in particular, `origin` and `master`), and
|
||||
we use the name `my-new-feature` for the branch that we create (e.g., the branch name should reflect the code change being made).
|
||||
|
||||
**Important**: If your PR lives for a long time, then don't press the button _Update branch_ in the Pull Request view, instead follow the steps below, as
|
||||
that avoids additional merge commits.
|
||||
|
||||
Once you have a GitHub login:
|
||||
|
||||
1. Fork the Exiv2 git repository to your GitHub account by pressing the _Fork_ button at: [https://github.com/Exiv2/exiv2](https://github.com/Exiv2/exiv2)
|
||||
1. Fork the Exiv2 git repository to your GitHub account by pressing the _Fork_ button at: [https://github.com/Exiv2/exiv2](https://github.com/Exiv2/exiv2)
|
||||
(more details [here](https://guides.github.com/activities/forking/)).
|
||||
|
||||
2. Then start a terminal (or use your favorite git GUI app) and clone your fork of the Exiv2 repo:
|
||||
@ -59,86 +51,95 @@ Once you have a GitHub login:
|
||||
|
||||
$ git remote add exiv2_upstream https://github.com/Exiv2/exiv2.git
|
||||
|
||||
and verify that you have the two remotes configured correctly:
|
||||
and verify that you have the two remotes configured correctly:
|
||||
|
||||
$ git remote -v
|
||||
exiv2_upstream https://github.com/Exiv2/exiv2.git (fetch)
|
||||
exiv2_upstream https://github.com/Exiv2/exiv2.git (push)
|
||||
origin https://github.com/your-username/exiv2.git (fetch)
|
||||
origin https://github.com/your-username/exiv2.git (push)
|
||||
origin https://github.com/your-username/exiv2.git (push)
|
||||
|
||||
4. Next, create a branch for your PR from `exiv2_upstream/master` (which we also need to fetch first):
|
||||
|
||||
$ git fetch exiv2_upstream master
|
||||
$ git checkout exiv2_upstream/master
|
||||
$ git checkout -b my-new-feature
|
||||
$ git fetch exiv2_upstream master
|
||||
$ git checkout -b my-new-feature exiv2_upstream/master --no-track
|
||||
|
||||
You will get a warning about a detached head which can be ignored here. NB: This is an important step to avoid draging in old commits!
|
||||
NB: This is an important step to avoid draging in old commits!
|
||||
|
||||
5. Configure the project and check that it builds (CMake is our the preferred configuration system, but not the only one [see [README.md](README.md)]):
|
||||
5. Configure the project and check that it builds (if not, please report a bug):
|
||||
|
||||
$ rm -rf build
|
||||
$ mkdir build && cd build
|
||||
$ cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
$ make
|
||||
|
||||
$ rm -rf build
|
||||
$ mkdir build && cd build
|
||||
$ cmake -DCMAKE_BUILD_TYPE=Release ..
|
||||
$ make
|
||||
|
||||
6. Now, make your change(s), add tests for your changes, and commit each change:
|
||||
|
||||
...
|
||||
|
||||
|
||||
$ git commit -m "Commit message 1"
|
||||
|
||||
|
||||
...
|
||||
|
||||
|
||||
$ git commit -m "Commit message 2"
|
||||
|
||||
7. Make sure the tests pass:
|
||||
|
||||
$ make tests # Application tests
|
||||
$ make tests # Integration tests
|
||||
$./bin/unit_tests # Unit tests
|
||||
|
||||
Exiv2's (new) test system is described in more detail in the [doc.md](tests/doc.md) and [writing_tests.md](tests/writing_tests.md) files, and a description of the old
|
||||
test system can be found on the Redmine wiki: [How_do_I_run_the_test_suite_for_Exiv2](http://dev.exiv2.org/projects/exiv2/wiki/How_do_I_run_the_test_suite_for_Exiv2)
|
||||
Exiv2's (new) test system is described in more detail in the [doc.md](tests/doc.md) and [writing_tests.md](tests/writing_tests.md) files, and a description of the old
|
||||
test system can be found in the Redmine wiki: [How do I run the test suite for Exiv2](http://dev.exiv2.org/projects/exiv2/wiki/How_do_I_run_the_test_suite_for_Exiv2)
|
||||
|
||||
8. Push the changes to your fork on GitHub:
|
||||
|
||||
$ git push origin my-new-feature
|
||||
|
||||
9. Create the PR by pressing the _New pull request_ button on: `https://github.com/your-username/exiv2`
|
||||
9. Create the PR by pressing the _New pull request_ button on: `https://github.com/your-username/exiv2`. Please select the option "Allow edits from maintainers" as outlined
|
||||
[here](https://help.github.com/en/articles/allowing-changes-to-a-pull-request-branch-created-from-a-fork).
|
||||
|
||||
10. Now wait for an Exiv2 project member(s) to respond to your PR. Follow the discussion on your PR at [https://github.com/Exiv2/exiv2/pulls](GitHub).
|
||||
You may have to do some updates to your PR until it gets accepted.
|
||||
10. Now wait for an Exiv2 project member(s) to respond to your PR. Follow the discussion on your PR at [GitHub](https://github.com/Exiv2/exiv2/pulls).
|
||||
You may have to do some updates to your PR until it gets accepted.
|
||||
|
||||
11. After the PR has been reviewed you must _rebase_ your repo copy since there may have been several changes to the main upstream repo
|
||||
(a PR can live for several days or even weeks).
|
||||
11. After the PR has been reviewed you must _rebase_ your repo copy since there may have been several changes to the upstream repository.
|
||||
|
||||
Switch to your branch again
|
||||
Switch to your branch again
|
||||
|
||||
$ git checkout my-new-feature
|
||||
|
||||
And rebase in top of master:
|
||||
And rebase it on top of master:
|
||||
|
||||
$ git pull --rebase exiv2_upstream master
|
||||
|
||||
When you do a rebase the commit history is rewritten and, therefore, the next time you try to push your branch to your fork repository you will need to use the `--force` option:
|
||||
When you perform a rebase the commit history is rewritten and, therefore, the next time you try to push your branch to your fork repository you will need to use
|
||||
the `--force-with-lease` option:
|
||||
|
||||
$ git push --force
|
||||
$ git push --force-with-lease
|
||||
|
||||
Also, follow the coding guidelines in the [CODING_GUIDELINES.md](CODING_GUIDELINES.md) file!
|
||||
Also, follow the coding guidelines outlined in [CODING_GUIDELINES.md](CODING_GUIDELINES.md).
|
||||
|
||||
# 3. Contributing Lens Data #
|
||||
# 3. Contributing Code via email #
|
||||
|
||||
In order for the Exiv2 project to, in particular, support a new lens we need an example image containing the Exif metadata for that lens. This is a good way for
|
||||
If you cannot or do not want to use GitHub, you can still submit patches via email by using our [sourcehut mirror](https://git.sr.ht/~d4n/exiv2).
|
||||
|
||||
Prepare your changes in your local clone of the [GitHub](https://github.com/Exiv2/exiv2.git) or [sourcehut](https://git.sr.ht/~d4n/exiv2) repository following our
|
||||
[CODING_GUIDELINES.md](CODING_GUIDELINES.md) and [GIT_GUIDELINES.md](git_guidelines.md). Send your patches to the
|
||||
[~d4n/exiv2-patches@lists.sr.ht](mailto:~d4n/exiv2-patches@lists.sr.ht) mailing list. Please use `git send-email` as outlined in https://git-send-email.io/ to
|
||||
simplify the integration of your patches.
|
||||
|
||||
# 4. Contributing Lens Data #
|
||||
|
||||
In order for the Exiv2 project to support a new lens we need an example image containing the Exif metadata of that lens. This is a good way for
|
||||
non-programmers to contribute to the project and example images can be submitted using the following procedure:
|
||||
|
||||
1. Create a new Issue by pressing the _New issue_ button here: [https://github.com/Exiv2/exiv2/issues](https://github.com/Exiv2/exiv2/issues),
|
||||
2. In the new Issue, enter/add the lens mount and full lens name for each lens,
|
||||
3. Take a (small) .jpg image (with the lens cap on) with each lens and transfer the .jpg file(s) to disk __without processing it__ in a desktop or server software (this is important to preserve the exif metadata in the file),
|
||||
4. Attach the .jpg image(s) to the Issue [one can just drag-and-drop the image(s) or paste it/them from the clipboard].
|
||||
4. Attach the .jpg image(s) to the Issue (one can just drag-and-drop the image(s) or paste it/them from the clipboard).
|
||||
|
||||
Note that we are not only interested in non-supported lenses since we also look for example images to expand and improve the Exiv2 code tests.
|
||||
|
||||
# 4. Reporting Bugs #
|
||||
# 5. Reporting Bugs #
|
||||
|
||||
Bugs should be reported by creating Issues on GitHub. However, before reporting a bug first check the Issue list if the bug is already known, and only if you cannot find any previous bug report
|
||||
then create a new Issue. When reporting a bug try describe the problem in as much detail as possible and if the bug is triggered by an input file then attach that file to the GitHub Issue.
|
||||
Bugs should be reported by creating Issues on GitHub. However, before reporting a bug first check the Issue list if the bug is already known, and only if you cannot find any previous bug report
|
||||
then create a new Issue. When reporting a bug try to describe the problem in as much detail as possible and if the bug is triggered by an input file then attach that file to the GitHub Issue, too.
|
||||
|
||||
@ -200,12 +200,12 @@ if (NOT MSVC)
|
||||
endif()
|
||||
|
||||
if (CYGWIN OR MINGW OR MSYS)
|
||||
target_link_libraries( exiv2lib PRIVATE psapi ws2_32 )
|
||||
target_link_libraries( exiv2lib PRIVATE psapi ws2_32 shell32 )
|
||||
endif()
|
||||
|
||||
target_link_libraries( exiv2lib PRIVATE Threads::Threads)
|
||||
else()
|
||||
target_link_libraries( exiv2lib PRIVATE psapi ws2_32 )
|
||||
target_link_libraries( exiv2lib PRIVATE psapi ws2_32 shell32 )
|
||||
endif()
|
||||
|
||||
if( EXIV2_ENABLE_PNG )
|
||||
|
||||
@ -193,6 +193,19 @@ namespace Exiv2
|
||||
{
|
||||
BasicIo& io = Image::io();
|
||||
|
||||
// Fix for https://github.com/Exiv2/exiv2/issues/712
|
||||
// A malicious file can cause a very deep recursion, leading to
|
||||
// stack exhaustion.
|
||||
// Note: 200 is an arbitrarily chosen cut-off value. The value
|
||||
// of depth determines the amount of indentation inserted by the
|
||||
// pretty-printer. The output starts to become unreadable as
|
||||
// soon as the indentation exceeds 80 characters or so. That's
|
||||
// why 200 ought to be a reasonable cut-off.
|
||||
if (depth > 200) {
|
||||
out << Internal::indent(depth) << "Maximum indentation depth exceeded." << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
depth++;
|
||||
bool bFirst = true;
|
||||
|
||||
|
||||
@ -154,12 +154,10 @@ namespace {
|
||||
N_("%1 has invalid XMP value type `%2'") }, // %1=key, %2=value type
|
||||
{ Exiv2::kerInvalidIccProfile,
|
||||
N_("Not a valid ICC Profile") },
|
||||
{ Exiv2::kerInvalidXMP,
|
||||
N_("Not valid XMP") },
|
||||
{ Exiv2::kerTiffDirectoryTooLarge,
|
||||
N_("tiff directory length is too large") },
|
||||
{ Exiv2::kerInvalidTypeValue,
|
||||
N_("invalid type value detected in Image::printIFDStructure") },
|
||||
N_("invalid type in tiff structure") },
|
||||
{ Exiv2::kerInvalidMalloc,
|
||||
N_("invalid memory allocation request") },
|
||||
{ Exiv2::kerCorruptedMetadata,
|
||||
|
||||
@ -135,6 +135,18 @@ namespace Exiv2 {
|
||||
{ 768, N_("Manual") }
|
||||
};
|
||||
|
||||
//! ShadowTone, tag 0x1040
|
||||
//! HighlightTone, tag 0x041
|
||||
extern const TagDetails fujiSHTone[] = {
|
||||
{ -64, N_("+4") },
|
||||
{ -48, N_("+3") },
|
||||
{ -32, N_("+2") },
|
||||
{ -16, N_("+1") },
|
||||
{ 0 , N_("0") },
|
||||
{ 16, N_("-1") },
|
||||
{ 32, N_("-2") },
|
||||
};
|
||||
|
||||
//! Continuous, tag 0x1100
|
||||
extern const TagDetails fujiContinuous[] = {
|
||||
{ 0, N_("Off") },
|
||||
@ -180,6 +192,24 @@ namespace Exiv2 {
|
||||
{ 32768, N_("Film simulation mode") }
|
||||
};
|
||||
|
||||
//! DRangePriority, tag 0x1443
|
||||
extern const TagDetails fujiDRangePriority[] = {
|
||||
{ 0, N_("Auto") },
|
||||
{ 1, N_("Fixed") }
|
||||
};
|
||||
|
||||
//! DRangePriorityAuto, tag 0x1444
|
||||
extern const TagDetails fujiDRangePriorityAuto[] = {
|
||||
{ 1, N_("Weak") },
|
||||
{ 2, N_("Strong") }
|
||||
};
|
||||
|
||||
//! DRangePriorityFixed, tag 0x1445
|
||||
extern const TagDetails fujiDRangePriorityFixed[] = {
|
||||
{ 1, N_("Weak") },
|
||||
{ 2, N_("Strong") }
|
||||
};
|
||||
|
||||
// Fujifilm MakerNote Tag Info
|
||||
const TagInfo FujiMakerNote::tagInfo_[] = {
|
||||
TagInfo(0x0000, "Version", N_("Version"),
|
||||
@ -228,6 +258,12 @@ namespace Exiv2 {
|
||||
TagInfo(0x1032, "0x1032", "0x1032",
|
||||
N_("Unknown"),
|
||||
fujiId, makerTags, unsignedShort, -1, printValue),
|
||||
TagInfo(0x1040, "ShadowTone", N_("Shadow Tone"),
|
||||
N_("Shadow tone"),
|
||||
fujiId, makerTags, signedLong, -1, EXV_PRINT_TAG(fujiSHTone)),
|
||||
TagInfo(0x1041, "HighlightTone", N_("Highlight Tone"),
|
||||
N_("Highlight tone"),
|
||||
fujiId, makerTags, signedLong, -1, EXV_PRINT_TAG(fujiSHTone)),
|
||||
TagInfo(0x1100, "Continuous", N_("Continuous"),
|
||||
N_("Continuous shooting or auto bracketing setting"),
|
||||
fujiId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(fujiContinuous)),
|
||||
@ -273,6 +309,18 @@ namespace Exiv2 {
|
||||
TagInfo(0x1407, "MaxApertureAtMaxFocal", N_("Maximum Aperture at Maximum Focal"),
|
||||
N_("Maximum aperture at maximum focal"),
|
||||
fujiId, makerTags, unsignedRational, -1, printValue),
|
||||
TagInfo(0x1431, "Rating", N_("Rating"),
|
||||
N_("Rating"),
|
||||
fujiId, makerTags, unsignedLong, -1, printValue),
|
||||
TagInfo(0x1443, "DRangePriority", N_("D Range Priority"),
|
||||
N_("Dynamic range priority"),
|
||||
fujiId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(fujiDRangePriority)),
|
||||
TagInfo(0x1444, "DRangePriorityFixed", N_("D Range Priority Fixed"),
|
||||
N_("Dynamic range priority fixed"),
|
||||
fujiId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(fujiDRangePriorityFixed)),
|
||||
TagInfo(0x1445, "DRangePriorityAuto", N_("D Range Priority Auto"),
|
||||
N_("Dynamic range priority auto"),
|
||||
fujiId, makerTags, unsignedShort, -1, EXV_PRINT_TAG(fujiDRangePriorityAuto)),
|
||||
TagInfo(0x8000, "FileSource", N_("File Source"),
|
||||
N_("File source"),
|
||||
fujiId, makerTags, asciiString, -1, printValue),
|
||||
|
||||
@ -376,7 +376,7 @@ namespace Exiv2 {
|
||||
|
||||
// Break for unknown tag types else we may segfault.
|
||||
if ( !typeValid(type) ) {
|
||||
std::cerr << "invalid type value detected in Image::printIFDStructure: " << type << std::endl;
|
||||
std::cerr << "invalid type in tiff structure" << type << std::endl;
|
||||
start = 0; // break from do loop
|
||||
throw Error(kerInvalidTypeValue);
|
||||
}
|
||||
|
||||
@ -2538,9 +2538,11 @@ fmountlens[] = {
|
||||
// https://github.com/Exiv2/exiv2/issues/598 , https://github.com/Exiv2/exiv2/pull/891
|
||||
{0xCF,0x47,0x5C,0x8E,0x31,0x3D,0xDF,0x0E,0x00,0x00,0x00, "Tamron", "A030", "SP 70-300mm F/4-5.6 Di VC USD"},
|
||||
//
|
||||
{0xf4,0x4c,0x7c,0x7c,0x2c,0x2c,0x4b,0x02,0x00,0x00,0x00, "Sigma", "", "APO MACRO 180mm F3.5 EX DG"},
|
||||
{0xf4,0x4c,0x7c,0x7c,0x2c,0x2c,0x4b,0x02,0x00,0x00,0x00, "Sigma", "", "APO Macro 180mm F3.5 EX DG HSM"},
|
||||
// https://github.com/Exiv2/exiv2/issues/1078
|
||||
{0x80,0x48,0x1C,0x29,0x24,0x24,0x7A,0x06,0x00,0x00,0x00, "Tokina", "", "atx-i 11-16mm F2.8 CF"},
|
||||
// https://github.com/Exiv2/exiv2/issues/1069
|
||||
{0xc8,0x54,0x44,0x44,0x0d,0x0d,0xdf,0x46,0x00,0x00,0x00, "Tamron", "F045", "SP 35mm f/1.4 Di USD"},
|
||||
// https://github.com/Exiv2/exiv2/pull/1105
|
||||
{0xCB,0x3C,0x2B,0x44,0x24,0x31,0xDF,0x46,0x00,0x00,0x00, "Tamron", "A037", "17-35mm F/2.8-4 Di OSD"},
|
||||
//
|
||||
|
||||
@ -197,6 +197,7 @@ namespace Exiv2 {
|
||||
{ "LensCorrectionSettings", N_("Lens Correction Settings"), "Text", xmpText, xmpExternal, N_("The list of Lens Correction tools settings used to fix lens distortion. This include Batch Queue Manager and Image editor tools based on LensFun library.") },
|
||||
{ "ColorLabel", N_("Color Label"), "Text", xmpText, xmpExternal, N_("The color label assigned to this item. Possible values are \"0\": no label; \"1\": Red; \"2\": Orange; \"3\": Yellow; \"4\": Green; \"5\": Blue; \"6\": Magenta; \"7\": Gray; \"8\": Black; \"9\": White.") },
|
||||
{ "PickLabel", N_("Pick Label"), "Text", xmpText, xmpExternal, N_("The pick label assigned to this item. Possible values are \"0\": no label; \"1\": item rejected; \"2\": item in pending validation; \"3\": item accepted.") },
|
||||
{ "Preview", N_("JPEG preview"), "Text", xmpText, xmpExternal, N_("Reduced size JPEG preview image encoded as base64 for a fast screen rendering.") },
|
||||
// End of list marker
|
||||
{ 0, 0, 0, invalidTypeId, xmpInternal, 0 }
|
||||
};
|
||||
|
||||
BIN
test/data/FujiTagsDRangeAutoRating1.jpg
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
test/data/FujiTagsDRangeStrongRating3.jpg
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
test/data/FujiTagsDRangeWeakRating2.jpg
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
test/data/FujiTagsSTone-2HTone4.jpg
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
test/data/FujiTagsSTone0HTone0Rating4.jpg
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
test/data/FujiTagsSTone1HTone-1Rating5.jpg
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
test/data/FujiTagsSTone4HTone-2.jpg
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
test/data/Tamron_SP_35mm_f1.4_Di_USD_F045.exv
Normal file
BIN
test/data/issue_712_poc.tif
Normal file
64
tests/bugfixes/github/test_fuji_tags.py
Normal file
@ -0,0 +1,64 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import system_tests
|
||||
|
||||
class FujiTags(metaclass=system_tests.CaseMeta):
|
||||
|
||||
filesAndExpectedOutput = [
|
||||
("FujiTagsDRangeAutoRating1.jpg",
|
||||
"""Exif.Fujifilm.ShadowTone SLong 1 0
|
||||
Exif.Fujifilm.HighlightTone SLong 1 0
|
||||
Exif.Fujifilm.Rating Long 1 1
|
||||
Exif.Fujifilm.DRangePriority Short 1 Auto
|
||||
Exif.Fujifilm.DRangePriorityAuto Short 1 Weak
|
||||
""")
|
||||
,
|
||||
("FujiTagsDRangeWeakRating2.jpg",
|
||||
"""Exif.Fujifilm.ShadowTone SLong 1 0
|
||||
Exif.Fujifilm.HighlightTone SLong 1 0
|
||||
Exif.Fujifilm.Rating Long 1 2
|
||||
Exif.Fujifilm.DRangePriority Short 1 Fixed
|
||||
Exif.Fujifilm.DRangePriorityFixed Short 1 Weak
|
||||
""")
|
||||
,
|
||||
("FujiTagsDRangeStrongRating3.jpg",
|
||||
"""Exif.Fujifilm.ShadowTone SLong 1 0
|
||||
Exif.Fujifilm.HighlightTone SLong 1 0
|
||||
Exif.Fujifilm.Rating Long 1 3
|
||||
Exif.Fujifilm.DRangePriority Short 1 Fixed
|
||||
Exif.Fujifilm.DRangePriorityFixed Short 1 Strong
|
||||
"""),
|
||||
("FujiTagsSTone0HTone0Rating4.jpg",
|
||||
"""Exif.Fujifilm.ShadowTone SLong 1 0
|
||||
Exif.Fujifilm.HighlightTone SLong 1 0
|
||||
Exif.Fujifilm.Rating Long 1 4
|
||||
"""),
|
||||
("FujiTagsSTone1HTone-1Rating5.jpg",
|
||||
"""Exif.Fujifilm.ShadowTone SLong 1 +1
|
||||
Exif.Fujifilm.HighlightTone SLong 1 -1
|
||||
Exif.Fujifilm.Rating Long 1 5
|
||||
"""),
|
||||
("FujiTagsSTone4HTone-2.jpg",
|
||||
"""Exif.Fujifilm.ShadowTone SLong 1 +4
|
||||
Exif.Fujifilm.HighlightTone SLong 1 -2
|
||||
Exif.Fujifilm.Rating Long 1 0
|
||||
"""),
|
||||
("FujiTagsSTone-2HTone4.jpg",
|
||||
"""Exif.Fujifilm.ShadowTone SLong 1 -2
|
||||
Exif.Fujifilm.HighlightTone SLong 1 +4
|
||||
Exif.Fujifilm.Rating Long 1 0
|
||||
""")
|
||||
]
|
||||
|
||||
tags = ["Exif.Fujifilm.ShadowTone",
|
||||
"Exif.Fujifilm.HighlightTone",
|
||||
"Exif.Fujifilm.Rating",
|
||||
"Exif.Fujifilm.DRangePriority",
|
||||
"Exif.Fujifilm.DRangePriorityAuto",
|
||||
"Exif.Fujifilm.DRangePriorityFixed"]
|
||||
|
||||
tagcmd = "$exiv2 -K " + " -K ".join(tags)
|
||||
commands = ["$tagcmd $data_path/" + f for f, _ in filesAndExpectedOutput]
|
||||
stdout = [e for _, e in filesAndExpectedOutput]
|
||||
stderr = [""] * len(filesAndExpectedOutput)
|
||||
retval = [0] * len(filesAndExpectedOutput)
|
||||
15
tests/bugfixes/github/test_issue_1069.py
Normal file
@ -0,0 +1,15 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import system_tests
|
||||
|
||||
class NikonTamronLens_F045_35_F14(metaclass=system_tests.CaseMeta):
|
||||
url = "https://github.com/Exiv2/exiv2/issues/1069"
|
||||
|
||||
filename = "$data_path/Tamron_SP_35mm_f1.4_Di_USD_F045.exv"
|
||||
commands = ["$exiv2 -pa --grep lensid/i $filename"]
|
||||
stderr = [""]
|
||||
stdout = [""
|
||||
"""Exif.NikonLd3.LensIDNumber Byte 1 Tamron SP 35mm f/1.4 Di USD
|
||||
"""
|
||||
]
|
||||
retval = [0]
|
||||
30
tests/bugfixes/github/test_issue_712.py
Normal file
@ -0,0 +1,30 @@
|
||||
import system_tests
|
||||
|
||||
|
||||
class BigTiffImageRecursionStackExhaustion(
|
||||
metaclass=system_tests.CaseMeta):
|
||||
"""
|
||||
Regression test for the bug described in:
|
||||
https://github.com/Exiv2/exiv2/issues/712
|
||||
|
||||
A malicious input file can cause BigTiffImage::printIFD() to
|
||||
recurse arbitrarily deep, causing a crash due to stack exhaustion.
|
||||
|
||||
The bug only existed in the -pR mode, which is now only enabled
|
||||
in debug builds.
|
||||
"""
|
||||
url = "https://github.com/Exiv2/exiv2/issues/790"
|
||||
|
||||
filename = system_tests.path(
|
||||
"$data_path/issue_712_poc.tif"
|
||||
)
|
||||
commands = ["$exiv2 -b -u -k pr $filename"]
|
||||
stdout = ["File name : " + filename + """
|
||||
File size : 3720 Bytes
|
||||
MIME type :
|
||||
Image size : 0 x 0
|
||||
"""
|
||||
]
|
||||
stderr = [filename + """: No Exif data found in the file
|
||||
"""]
|
||||
retval = [253]
|
||||
@ -2,14 +2,14 @@
|
||||
|
||||
import system_tests
|
||||
|
||||
class NikonSigmaLens_APO_MACRO_180_F35_EX_DG(metaclass=system_tests.CaseMeta):
|
||||
class NikonSigmaLens_APO_MACRO_180_F35_EX_DG_HSM(metaclass=system_tests.CaseMeta):
|
||||
url = "https://github.com/Exiv2/exiv2/pull/992"
|
||||
|
||||
filename = "$data_path/Sigma_APO_MACRO_180_F3.5_EX_DG.exv"
|
||||
filename = "$data_path/Sigma_APO_MACRO_180_F3.5_EX_DG_HSM.exv"
|
||||
commands = ["$exiv2 -pa --grep lensid/i $filename"]
|
||||
stderr = [""]
|
||||
stdout = [""
|
||||
"""Exif.NikonLd3.LensIDNumber Byte 1 Sigma APO MACRO 180mm F3.5 EX DG
|
||||
"""Exif.NikonLd3.LensIDNumber Byte 1 Sigma APO Macro 180mm F3.5 EX DG HSM
|
||||
"""
|
||||
]
|
||||
retval = [0]
|
||||
|
||||
@ -35,6 +35,8 @@ Exif.Fujifilm.Macro Short 1 Off
|
||||
Exif.Fujifilm.FocusMode Short 1 Auto
|
||||
Exif.Fujifilm.SlowSync Short 1 Off
|
||||
Exif.Fujifilm.PictureMode Short 1 Program AE
|
||||
Exif.Fujifilm.ShadowTone SLong 1 0
|
||||
Exif.Fujifilm.HighlightTone SLong 1 0
|
||||
Exif.Fujifilm.Continuous Short 1 Off
|
||||
Exif.Fujifilm.SequenceNumber Short 1 0
|
||||
Exif.Fujifilm.BlurWarning Short 1 Off
|
||||
@ -43,6 +45,7 @@ Exif.Fujifilm.ExposureWarning Short 1 Off
|
||||
Exif.Fujifilm.DynamicRange Short 1 Standard
|
||||
Exif.Fujifilm.FilmMode Short 1 F0/Standard (Provia)
|
||||
Exif.Fujifilm.DynamicRangeSetting Short 1 Auto (100-400%)
|
||||
Exif.Fujifilm.Rating Long 1 0
|
||||
""",
|
||||
"""Exif.Fujifilm.Version Undefined 4 48 49 51 48
|
||||
Exif.Fujifilm.SerialNumber Ascii 48 FFDT22794526 593332303134151113535030217060
|
||||
@ -56,6 +59,8 @@ Exif.Fujifilm.Macro Short 1 Off
|
||||
Exif.Fujifilm.FocusMode Short 1 Auto
|
||||
Exif.Fujifilm.SlowSync Short 1 Off
|
||||
Exif.Fujifilm.PictureMode Short 1 Program AE
|
||||
Exif.Fujifilm.ShadowTone SLong 1 0
|
||||
Exif.Fujifilm.HighlightTone SLong 1 0
|
||||
Exif.Fujifilm.Continuous Short 1 Off
|
||||
Exif.Fujifilm.SequenceNumber Short 1 0
|
||||
Exif.Fujifilm.BlurWarning Short 1 Off
|
||||
@ -64,6 +69,7 @@ Exif.Fujifilm.ExposureWarning Short 1 Off
|
||||
Exif.Fujifilm.DynamicRange Short 1 Standard
|
||||
Exif.Fujifilm.FilmMode Short 1 F2/Fujichrome (Velvia)
|
||||
Exif.Fujifilm.DynamicRangeSetting Short 1 Auto (100-400%)
|
||||
Exif.Fujifilm.Rating Long 1 0
|
||||
""", #b
|
||||
"""Exif.Fujifilm.Version Undefined 4 48 49 51 48
|
||||
Exif.Fujifilm.SerialNumber Ascii 48 FFDT22794526 593332303134151113535030217060
|
||||
@ -77,6 +83,8 @@ Exif.Fujifilm.Macro Short 1 Off
|
||||
Exif.Fujifilm.FocusMode Short 1 Auto
|
||||
Exif.Fujifilm.SlowSync Short 1 Off
|
||||
Exif.Fujifilm.PictureMode Short 1 Program AE
|
||||
Exif.Fujifilm.ShadowTone SLong 1 0
|
||||
Exif.Fujifilm.HighlightTone SLong 1 0
|
||||
Exif.Fujifilm.Continuous Short 1 Off
|
||||
Exif.Fujifilm.SequenceNumber Short 1 0
|
||||
Exif.Fujifilm.BlurWarning Short 1 Off
|
||||
@ -85,6 +93,7 @@ Exif.Fujifilm.ExposureWarning Short 1 Off
|
||||
Exif.Fujifilm.DynamicRange Short 1 Standard
|
||||
Exif.Fujifilm.FilmMode Short 1 F1b/Studio Portrait Smooth Skin Tone (Astia)
|
||||
Exif.Fujifilm.DynamicRangeSetting Short 1 Auto (100-400%)
|
||||
Exif.Fujifilm.Rating Long 1 0
|
||||
""",
|
||||
"""Exif.Fujifilm.Version Undefined 4 48 49 51 48
|
||||
Exif.Fujifilm.SerialNumber Ascii 48 FFDT22794526 593332303134151113535030217060
|
||||
@ -98,6 +107,8 @@ Exif.Fujifilm.Macro Short 1 Off
|
||||
Exif.Fujifilm.FocusMode Short 1 Auto
|
||||
Exif.Fujifilm.SlowSync Short 1 Off
|
||||
Exif.Fujifilm.PictureMode Short 1 Program AE
|
||||
Exif.Fujifilm.ShadowTone SLong 1 0
|
||||
Exif.Fujifilm.HighlightTone SLong 1 0
|
||||
Exif.Fujifilm.Continuous Short 1 Off
|
||||
Exif.Fujifilm.SequenceNumber Short 1 0
|
||||
Exif.Fujifilm.BlurWarning Short 1 Off
|
||||
@ -106,6 +117,7 @@ Exif.Fujifilm.ExposureWarning Short 1 Off
|
||||
Exif.Fujifilm.DynamicRange Short 1 Standard
|
||||
Exif.Fujifilm.FilmMode Short 1 Classic Chrome
|
||||
Exif.Fujifilm.DynamicRangeSetting Short 1 Auto (100-400%)
|
||||
Exif.Fujifilm.Rating Long 1 0
|
||||
""",
|
||||
"""Exif.Fujifilm.Version Undefined 4 48 49 51 48
|
||||
Exif.Fujifilm.SerialNumber Ascii 48 FFDT22794526 593332303134151113535030217060
|
||||
@ -119,6 +131,8 @@ Exif.Fujifilm.Macro Short 1 Off
|
||||
Exif.Fujifilm.FocusMode Short 1 Auto
|
||||
Exif.Fujifilm.SlowSync Short 1 Off
|
||||
Exif.Fujifilm.PictureMode Short 1 Program AE
|
||||
Exif.Fujifilm.ShadowTone SLong 1 0
|
||||
Exif.Fujifilm.HighlightTone SLong 1 0
|
||||
Exif.Fujifilm.Continuous Short 1 Off
|
||||
Exif.Fujifilm.SequenceNumber Short 1 0
|
||||
Exif.Fujifilm.BlurWarning Short 1 Off
|
||||
@ -127,6 +141,7 @@ Exif.Fujifilm.ExposureWarning Short 1 Off
|
||||
Exif.Fujifilm.DynamicRange Short 1 Standard
|
||||
Exif.Fujifilm.FilmMode Short 1 Pro Neg. Hi
|
||||
Exif.Fujifilm.DynamicRangeSetting Short 1 Auto (100-400%)
|
||||
Exif.Fujifilm.Rating Long 1 0
|
||||
""",
|
||||
"""Exif.Fujifilm.Version Undefined 4 48 49 51 48
|
||||
Exif.Fujifilm.SerialNumber Ascii 48 FFDT22794526 593332303134151113535030217060
|
||||
@ -140,6 +155,8 @@ Exif.Fujifilm.Macro Short 1 Off
|
||||
Exif.Fujifilm.FocusMode Short 1 Manual
|
||||
Exif.Fujifilm.SlowSync Short 1 Off
|
||||
Exif.Fujifilm.PictureMode Short 1 Program AE
|
||||
Exif.Fujifilm.ShadowTone SLong 1 0
|
||||
Exif.Fujifilm.HighlightTone SLong 1 0
|
||||
Exif.Fujifilm.Continuous Short 1 Off
|
||||
Exif.Fujifilm.SequenceNumber Short 1 0
|
||||
Exif.Fujifilm.BlurWarning Short 1 On
|
||||
@ -147,6 +164,7 @@ Exif.Fujifilm.FocusWarning Short 1 Off
|
||||
Exif.Fujifilm.ExposureWarning Short 1 On
|
||||
Exif.Fujifilm.DynamicRange Short 1 Standard
|
||||
Exif.Fujifilm.DynamicRangeSetting Short 1 Auto (100-400%)
|
||||
Exif.Fujifilm.Rating Long 1 0
|
||||
""",
|
||||
"""Exif.Fujifilm.Version Undefined 4 48 49 51 48
|
||||
Exif.Fujifilm.SerialNumber Ascii 48 FFDT22794526 593332303134151113535030217060
|
||||
@ -160,6 +178,8 @@ Exif.Fujifilm.Macro Short 1 Off
|
||||
Exif.Fujifilm.FocusMode Short 1 Manual
|
||||
Exif.Fujifilm.SlowSync Short 1 Off
|
||||
Exif.Fujifilm.PictureMode Short 1 Program AE
|
||||
Exif.Fujifilm.ShadowTone SLong 1 0
|
||||
Exif.Fujifilm.HighlightTone SLong 1 0
|
||||
Exif.Fujifilm.Continuous Short 1 Off
|
||||
Exif.Fujifilm.SequenceNumber Short 1 0
|
||||
Exif.Fujifilm.BlurWarning Short 1 On
|
||||
@ -167,6 +187,7 @@ Exif.Fujifilm.FocusWarning Short 1 Off
|
||||
Exif.Fujifilm.ExposureWarning Short 1 On
|
||||
Exif.Fujifilm.DynamicRange Short 1 Standard
|
||||
Exif.Fujifilm.DynamicRangeSetting Short 1 Auto (100-400%)
|
||||
Exif.Fujifilm.Rating Long 1 0
|
||||
""",
|
||||
"""Exif.Fujifilm.Version Undefined 4 48 49 51 48
|
||||
Exif.Fujifilm.SerialNumber Ascii 48 FFDT22794526 593332303134151113535030217060
|
||||
@ -180,6 +201,8 @@ Exif.Fujifilm.Macro Short 1 Off
|
||||
Exif.Fujifilm.FocusMode Short 1 Manual
|
||||
Exif.Fujifilm.SlowSync Short 1 Off
|
||||
Exif.Fujifilm.PictureMode Short 1 Shutter speed priority AE
|
||||
Exif.Fujifilm.ShadowTone SLong 1 0
|
||||
Exif.Fujifilm.HighlightTone SLong 1 0
|
||||
Exif.Fujifilm.Continuous Short 1 Off
|
||||
Exif.Fujifilm.SequenceNumber Short 1 0
|
||||
Exif.Fujifilm.BlurWarning Short 1 Off
|
||||
@ -187,6 +210,7 @@ Exif.Fujifilm.FocusWarning Short 1 Off
|
||||
Exif.Fujifilm.ExposureWarning Short 1 On
|
||||
Exif.Fujifilm.DynamicRange Short 1 Standard
|
||||
Exif.Fujifilm.DynamicRangeSetting Short 1 Auto (100-400%)
|
||||
Exif.Fujifilm.Rating Long 1 0
|
||||
""",
|
||||
"""Exif.Fujifilm.Version Undefined 4 48 49 51 48
|
||||
Exif.Fujifilm.SerialNumber Ascii 48 FFDT22794526 593332303134151113535030217060
|
||||
@ -200,6 +224,8 @@ Exif.Fujifilm.Macro Short 1 Off
|
||||
Exif.Fujifilm.FocusMode Short 1 Manual
|
||||
Exif.Fujifilm.SlowSync Short 1 Off
|
||||
Exif.Fujifilm.PictureMode Short 1 Shutter speed priority AE
|
||||
Exif.Fujifilm.ShadowTone SLong 1 0
|
||||
Exif.Fujifilm.HighlightTone SLong 1 0
|
||||
Exif.Fujifilm.Continuous Short 1 Off
|
||||
Exif.Fujifilm.SequenceNumber Short 1 0
|
||||
Exif.Fujifilm.BlurWarning Short 1 Off
|
||||
@ -207,6 +233,7 @@ Exif.Fujifilm.FocusWarning Short 1 Off
|
||||
Exif.Fujifilm.ExposureWarning Short 1 On
|
||||
Exif.Fujifilm.DynamicRange Short 1 Standard
|
||||
Exif.Fujifilm.DynamicRangeSetting Short 1 Auto (100-400%)
|
||||
Exif.Fujifilm.Rating Long 1 0
|
||||
""",
|
||||
"""Exif.Fujifilm.Version Undefined 4 48 49 51 48
|
||||
Exif.Fujifilm.SerialNumber Ascii 48 FFDT22794526 593332303134151113535030217060
|
||||
@ -220,6 +247,8 @@ Exif.Fujifilm.Macro Short 1 Off
|
||||
Exif.Fujifilm.FocusMode Short 1 Manual
|
||||
Exif.Fujifilm.SlowSync Short 1 Off
|
||||
Exif.Fujifilm.PictureMode Short 1 Shutter speed priority AE
|
||||
Exif.Fujifilm.ShadowTone SLong 1 0
|
||||
Exif.Fujifilm.HighlightTone SLong 1 0
|
||||
Exif.Fujifilm.Continuous Short 1 Off
|
||||
Exif.Fujifilm.SequenceNumber Short 1 0
|
||||
Exif.Fujifilm.BlurWarning Short 1 Off
|
||||
@ -227,6 +256,7 @@ Exif.Fujifilm.FocusWarning Short 1 Off
|
||||
Exif.Fujifilm.ExposureWarning Short 1 On
|
||||
Exif.Fujifilm.DynamicRange Short 1 Standard
|
||||
Exif.Fujifilm.DynamicRangeSetting Short 1 Auto (100-400%)
|
||||
Exif.Fujifilm.Rating Long 1 0
|
||||
"""
|
||||
]
|
||||
stderr = [""] * 10
|
||||
|
||||
@ -24,7 +24,7 @@ kerOffsetOutOfRange: Offset out of range
|
||||
kerFailedToReadImageData: Failed to read image data
|
||||
kerCorruptedMetadata: corrupted image metadata
|
||||
kerInvalidMalloc: invalid memory allocation request
|
||||
kerInvalidTypeValue: invalid type value detected in Image::printIFDStructure
|
||||
kerInvalidTypeValue: invalid type in tiff structure
|
||||
kerNotAJpeg : This does not look like a JPEG image
|
||||
kerNoImageInInputData: Input data does not contain a valid image
|
||||
addition_overflow_message: Overflow in addition
|
||||
|
||||