diff options
Diffstat (limited to 'src/plugins/exiv2_extractor.cc')
-rw-r--r-- | src/plugins/exiv2_extractor.cc | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/src/plugins/exiv2_extractor.cc b/src/plugins/exiv2_extractor.cc index 8741d40..ef402a8 100644 --- a/src/plugins/exiv2_extractor.cc +++ b/src/plugins/exiv2_extractor.cc | |||
@@ -27,10 +27,7 @@ | |||
27 | #include <cassert> | 27 | #include <cassert> |
28 | #include <cstring> | 28 | #include <cstring> |
29 | #include <math.h> | 29 | #include <math.h> |
30 | #include <exiv2/exif.hpp> | 30 | #include <exiv2/exiv2.hpp> |
31 | #include <exiv2/error.hpp> | ||
32 | #include <exiv2/image.hpp> | ||
33 | #include <exiv2/futils.hpp> | ||
34 | 31 | ||
35 | /** | 32 | /** |
36 | * Enable debugging to get error messages. | 33 | * Enable debugging to get error messages. |
@@ -180,7 +177,7 @@ public: | |||
180 | * | 177 | * |
181 | * @return -1 on error | 178 | * @return -1 on error |
182 | */ | 179 | */ |
183 | #if EXIV2_VERSION >= EXIV2_MAKE_VERSION(0,26,0) | 180 | #if EXIV2_TEST_VERSION(0,26,0) |
184 | virtual size_t size (void) const; | 181 | virtual size_t size (void) const; |
185 | #else | 182 | #else |
186 | virtual long int size (void) const; | 183 | virtual long int size (void) const; |
@@ -316,7 +313,11 @@ ExtractorIO::getb () | |||
316 | const unsigned char *r; | 313 | const unsigned char *r; |
317 | 314 | ||
318 | if (1 != ec->read (ec->cls, &data, 1)) | 315 | if (1 != ec->read (ec->cls, &data, 1)) |
316 | #if EXIV2_TEST_VERSION(0,27,0) | ||
317 | throw Exiv2::BasicError<char> (Exiv2::kerDecodeLangAltQualifierFailed); | ||
318 | #else | ||
319 | throw Exiv2::BasicError<char> (42 /* error code */); | 319 | throw Exiv2::BasicError<char> (42 /* error code */); |
320 | #endif | ||
320 | r = (const unsigned char *) data; | 321 | r = (const unsigned char *) data; |
321 | return *r; | 322 | return *r; |
322 | } | 323 | } |
@@ -371,7 +372,11 @@ ExtractorIO::putb (Exiv2::byte data) | |||
371 | void | 372 | void |
372 | ExtractorIO::transfer (Exiv2::BasicIo& src) | 373 | ExtractorIO::transfer (Exiv2::BasicIo& src) |
373 | { | 374 | { |
375 | #if EXIV2_TEST_VERSION(0,27,0) | ||
376 | throw Exiv2::BasicError<char> (Exiv2::kerDecodeLangAltQualifierFailed); | ||
377 | #else | ||
374 | throw Exiv2::BasicError<char> (42 /* error code */); | 378 | throw Exiv2::BasicError<char> (42 /* error code */); |
379 | #endif | ||
375 | } | 380 | } |
376 | 381 | ||
377 | 382 | ||
@@ -416,7 +421,11 @@ ExtractorIO::seek (long offset, | |||
416 | Exiv2::byte * | 421 | Exiv2::byte * |
417 | ExtractorIO::mmap (bool isWritable) | 422 | ExtractorIO::mmap (bool isWritable) |
418 | { | 423 | { |
424 | #if EXIV2_TEST_VERSION(0,27,0) | ||
425 | throw Exiv2::BasicError<char> (Exiv2::kerDecodeLangAltQualifierFailed); | ||
426 | #else | ||
419 | throw Exiv2::BasicError<char> (42 /* error code */); | 427 | throw Exiv2::BasicError<char> (42 /* error code */); |
428 | #endif | ||
420 | } | 429 | } |
421 | 430 | ||
422 | 431 | ||
@@ -449,7 +458,7 @@ ExtractorIO::tell (void) const | |||
449 | * | 458 | * |
450 | * @return -1 on error | 459 | * @return -1 on error |
451 | */ | 460 | */ |
452 | #if EXIV2_VERSION >= EXIV2_MAKE_VERSION(0,26,0) | 461 | #if EXIV2_TEST_VERSION(0,26,0) |
453 | size_t | 462 | size_t |
454 | #else | 463 | #else |
455 | long int | 464 | long int |
@@ -504,7 +513,11 @@ ExtractorIO::eof () const | |||
504 | std::string | 513 | std::string |
505 | ExtractorIO::path () const | 514 | ExtractorIO::path () const |
506 | { | 515 | { |
516 | #if EXIV2_TEST_VERSION(0,27,0) | ||
517 | throw Exiv2::BasicError<char> (Exiv2::kerDecodeLangAltQualifierFailed); | ||
518 | #else | ||
507 | throw Exiv2::BasicError<char> (42 /* error code */); | 519 | throw Exiv2::BasicError<char> (42 /* error code */); |
520 | #endif | ||
508 | } | 521 | } |
509 | 522 | ||
510 | 523 | ||
@@ -517,7 +530,11 @@ ExtractorIO::path () const | |||
517 | std::wstring | 530 | std::wstring |
518 | ExtractorIO::wpath () const | 531 | ExtractorIO::wpath () const |
519 | { | 532 | { |
533 | #if EXIV2_TEST_VERSION(0,27,0) | ||
534 | throw Exiv2::BasicError<char> (Exiv2::kerDecodeLangAltQualifierFailed); | ||
535 | #else | ||
520 | throw Exiv2::BasicError<char> (42 /* error code */); | 536 | throw Exiv2::BasicError<char> (42 /* error code */); |
537 | #endif | ||
521 | } | 538 | } |
522 | #endif | 539 | #endif |
523 | 540 | ||
@@ -531,7 +548,11 @@ Exiv2::BasicIo::AutoPtr | |||
531 | ExtractorIO::temporary () const | 548 | ExtractorIO::temporary () const |
532 | { | 549 | { |
533 | fprintf (stderr, "throwing temporary error\n"); | 550 | fprintf (stderr, "throwing temporary error\n"); |
551 | #if EXIV2_TEST_VERSION(0,27,0) | ||
552 | throw Exiv2::BasicError<char> (Exiv2::kerDecodeLangAltQualifierFailed); | ||
553 | #else | ||
534 | throw Exiv2::BasicError<char> (42 /* error code */); | 554 | throw Exiv2::BasicError<char> (42 /* error code */); |
555 | #endif | ||
535 | } | 556 | } |
536 | 557 | ||
537 | 558 | ||
@@ -697,7 +718,7 @@ EXTRACTOR_exiv2_extract_method (struct EXTRACTOR_ExtractContext *ec) | |||
697 | { | 718 | { |
698 | try | 719 | try |
699 | { | 720 | { |
700 | #if EXIV2_MAKE_VERSION(0,23,0) <= EXIV2_VERSION | 721 | #if !EXIV2_TEST_VERSION(0,24,0) |
701 | Exiv2::LogMsg::setLevel (Exiv2::LogMsg::mute); | 722 | Exiv2::LogMsg::setLevel (Exiv2::LogMsg::mute); |
702 | #endif | 723 | #endif |
703 | std::auto_ptr<Exiv2::BasicIo> eio(new ExtractorIO (ec)); | 724 | std::auto_ptr<Exiv2::BasicIo> eio(new ExtractorIO (ec)); |