Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecate enableBMFF API (backport) #2985

Merged
merged 2 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 1 addition & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -736,13 +736,9 @@ int main(int argc, const char* argv[])
{
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF(true);
#endif
...
}
```
The use of the _**thread unsafe function**_ Exiv2::enableBMFF(true) is discussed in [Support for BMFF files (e.g., CR3, HEIF, HEIC, AVIF, and JPEG XL)](#BMFF)

[TOC](#TOC)
<div id="InitAndCleanup">
Expand All @@ -758,9 +754,6 @@ The exiv2 command-line program and sample applications call the following at the
```cpp
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF(true);
#endif
```

[TOC](#TOC)
Expand Down Expand Up @@ -904,15 +897,7 @@ This is discussed: [https://github.com/Exiv2/exiv2/issues/1230](https://github.c

**Attention is drawn to the possibility that BMFF support may be the subject of patent rights. _Exiv2 shall not be held responsible for identifying any or all such patent rights. Exiv2 shall not be held responsible for the legal consequences of the use of this code_.**

Access to the BMFF code is guarded in two ways. Firstly, you have to build the library with the CMake option: `-DEXIV2_ENABLE_BMFF=ON`. Secondly, the application must enable BMFF support at run-time by calling the following function.

```cpp
EXIV2API bool enableBMFF(bool enable);
```

The return value from `enableBMFF()` is true if the library has been build with BMFF support (CMake option -DEXIV2_ENABLE_BMFF=ON).

Applications may wish to provide a preference setting to enable BMFF support and thereby place the responsibility for the use of this code with the user of the application.
Access to the BMFF code is guarded by the CMake option: `-DEXIV2_ENABLE_BMFF=ON` (enabled by default).

[TOC](#TOC)
<div id="LicenseSupport">
Expand Down
3 changes: 0 additions & 3 deletions app/exiv2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,6 @@ int main(int argc, char* const argv[]) {

Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

#ifdef EXV_ENABLE_NLS
setlocale(LC_ALL, "");
Expand Down
3 changes: 0 additions & 3 deletions fuzz/fuzz-read-print-write.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {

Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

try {
Exiv2::DataBuf data_copy(data, size);
Expand Down
2 changes: 1 addition & 1 deletion include/exiv2/bmffimage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
// *****************************************************************************
// namespace extensions
namespace Exiv2 {
EXIV2API bool enableBMFF(bool enable = true);
[[deprecated]] EXIV2API bool enableBMFF(bool enable = true);
} // namespace Exiv2

#ifdef EXV_ENABLE_BMFF
Expand Down
3 changes: 0 additions & 3 deletions samples/addmoddel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ int main(int argc, char* const argv[]) {
try {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

if (argc != 2) {
std::cout << "Usage: " << argv[0] << " file\n";
Expand Down
3 changes: 0 additions & 3 deletions samples/conntest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,6 @@ void curlcon(const std::string& url, bool useHttp1_0 = false) {
int main(int argc, const char** argv) {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

if (argc < 2) {
std::cout << "Usage: " << argv[0] << " url {-http1_0}" << std::endl;
Expand Down
3 changes: 0 additions & 3 deletions samples/convert-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ int main(int argc, char* const argv[]) {
try {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

if (argc != 2) {
std::cout << "Usage: " << argv[0] << " file\n";
Expand Down
3 changes: 0 additions & 3 deletions samples/easyaccess-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,6 @@ int main(int argc, char** argv) {
try {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

if (argc < 2) {
int count = 0;
Expand Down
3 changes: 0 additions & 3 deletions samples/exifcomment.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ int main(int argc, char* const argv[]) {
try {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

if (argc != 2) {
std::cout << "Usage: " << argv[0] << " file\n";
Expand Down
3 changes: 0 additions & 3 deletions samples/exifdata-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,6 @@ int main(int argc, char* const argv[]) {
try {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

if (argc != 2) {
std::cout << "Usage: " << argv[0] << " file\n";
Expand Down
3 changes: 0 additions & 3 deletions samples/exifdata.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,9 +150,6 @@ std::string formatXML(Exiv2::ExifData& exifData) {
int main(int argc, const char* argv[]) {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

format_t formats;
formats["wolf"] = wolf;
Expand Down
3 changes: 0 additions & 3 deletions samples/exifprint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ int main(int argc, char* const argv[]) {
setlocale(LC_CTYPE, ".utf8");
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

const char* prog = argv[0];
if (argc == 1) {
Expand Down
3 changes: 0 additions & 3 deletions samples/exifvalue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
int main(int argc, char* const argv[]) {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

if (argc != 3) {
std::cerr << "Usage: " << argv[0] << " file key\n";
Expand Down
3 changes: 0 additions & 3 deletions samples/geotag.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -690,9 +690,6 @@ bool mySort(const std::string& a, const std::string& b) {
int main(int argc, const char* argv[]) {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

int result = 0;
const char* program = argv[0];
Expand Down
3 changes: 0 additions & 3 deletions samples/getopt-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,6 @@ class Params : public Util::Getopt {
int main(int argc, char** const argv) {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

int n;

Expand Down
3 changes: 0 additions & 3 deletions samples/ini-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ Config loaded from : 'initest.ini' version=6, name=Bob Smith, [email protected]
int main() {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

const char* ini = "ini-test.ini";
INIReader reader(ini);
Expand Down
3 changes: 0 additions & 3 deletions samples/iotest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ int WriteReadSeek(BasicIo& io);
int main(int argc, char* const argv[]) {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

try {
if (argc < 4 || argc > 6) {
Expand Down
3 changes: 0 additions & 3 deletions samples/iptceasy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
int main(int argc, char* const argv[]) try {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

if (argc != 2) {
std::cout << "Usage: " << argv[0] << " file\n";
Expand Down
3 changes: 0 additions & 3 deletions samples/iptcprint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
int main(int argc, char* const argv[]) try {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

if (argc != 2) {
std::cout << "Usage: " << argv[0] << " file\n";
Expand Down
3 changes: 0 additions & 3 deletions samples/iptctest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ void processModify(const std::string& line, int num, IptcData& iptcData);
int main(int argc, char* const argv[]) {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

try {
if (argc != 2) {
Expand Down
3 changes: 0 additions & 3 deletions samples/key-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ using namespace Exiv2;
int main() {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

int tc = 0;
int rc = 0;
Expand Down
3 changes: 0 additions & 3 deletions samples/largeiptc-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@ int main(int argc, char* const argv[]) {
try {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

if (argc != 3) {
std::cout << "Usage: " << argv[0] << " image datafile\n";
Expand Down
3 changes: 0 additions & 3 deletions samples/metacopy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ int main(int argc, char* const argv[]) {
try {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

// Handle command line arguments
Params params;
Expand Down
3 changes: 0 additions & 3 deletions samples/mmap-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ int main(int argc, char* const argv[]) {
try {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

if (argc != 2) {
std::cout << "Usage: " << argv[0] << " file\n";
Expand Down
3 changes: 0 additions & 3 deletions samples/mrwthumb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
int main(int argc, char* const argv[]) {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

try {
if (argc != 2) {
Expand Down
3 changes: 0 additions & 3 deletions samples/path-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,6 @@ namespace fs = std::experimental::filesystem;
int main(int argc, char* const argv[]) {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

if (argc != 2) {
std::cout << "Usage: " << argv[0] << " file\n";
Expand Down
3 changes: 0 additions & 3 deletions samples/prevtest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@
int main(int argc, char* const argv[]) try {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

if (argc != 2) {
std::cout << "Usage: " << argv[0] << " file\n";
Expand Down
3 changes: 0 additions & 3 deletions samples/remotetest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ int main(int argc, char* const argv[]) {
try {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

if (argc < 2) {
std::cout << "Usage: " << argv[0] << " file {--nocurl | --curl}\n\n";
Expand Down
3 changes: 0 additions & 3 deletions samples/stringto-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ static constexpr const char* testcases[] = {
int main() {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

std::cout << std::setfill(' ');

Expand Down
3 changes: 0 additions & 3 deletions samples/taglist.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@ using namespace Exiv2;
int main(int argc, char* argv[]) {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

int rc = EXIT_SUCCESS;
std::ostringstream out;
Expand Down
3 changes: 0 additions & 3 deletions samples/tiff-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,6 @@ int main(int argc, char* const argv[]) {
try {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

if (argc != 2) {
std::cout << "Usage: " << argv[0] << " file\n";
Expand Down
3 changes: 0 additions & 3 deletions samples/write-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,6 @@ void exifPrint(const ExifData& exifData);
int main(int argc, char* const argv[]) {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

try {
if (argc != 3) {
Expand Down
3 changes: 0 additions & 3 deletions samples/write2-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ void print(const std::string& file);
int main(int argc, char* const argv[]) {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

try {
if (argc != 2) {
Expand Down
3 changes: 0 additions & 3 deletions samples/xmpdump.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
int main(int argc, char* const argv[]) {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

try {
if (argc != 2) {
Expand Down
3 changes: 0 additions & 3 deletions samples/xmpparse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
int main(int argc, char* const argv[]) try {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

if (argc != 2) {
std::cout << "Usage: " << argv[0] << " file\n";
Expand Down
3 changes: 0 additions & 3 deletions samples/xmpparser-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@
int main(int argc, char* const argv[]) try {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

if (argc != 2) {
std::cout << "Usage: " << argv[0] << " file\n";
Expand Down
3 changes: 0 additions & 3 deletions samples/xmpprint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,6 @@
int main(int argc, char** argv) {
Exiv2::XmpParser::initialize();
::atexit(Exiv2::XmpParser::terminate);
#ifdef EXV_ENABLE_BMFF
Exiv2::enableBMFF();
#endif

try {
if (argc != 2) {
Expand Down
Loading
Loading