[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a
Maximiliano Curia
maxy at moszumanska.debian.org
Thu Jul 13 17:35:59 UTC 2017
Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=2cd2aea
The following commit has been merged in the master branch:
commit 2cd2aea1e6b2f7598f32944da737dd37ff6dfec0
Author: Andreas Huggel <ahuggel at gmx.net>
Date: Fri Feb 6 12:13:51 2004 +0000
more testing
---
src/exiftest.cpp | 101 ++++++++++++++++++++++++++++++++++++++++++-------------
1 file changed, 77 insertions(+), 24 deletions(-)
diff --git a/src/exiftest.cpp b/src/exiftest.cpp
index 5bd435a..a972bc3 100644
--- a/src/exiftest.cpp
+++ b/src/exiftest.cpp
@@ -3,11 +3,11 @@
Abstract : This is playground code, do what you want with it.
Author(s): Andreas Huggel (ahu) <ahuggel at gmx.net>
- Version : $Name: $ $Revision: 1.13 $
+ Version : $Name: $ $Revision: 1.14 $
*/
// *****************************************************************************
#include "rcsid.hpp"
-EXIV2_RCSID("@(#) $Name: $ $Revision: 1.13 $ $RCSfile: exiftest.cpp,v $")
+EXIV2_RCSID("@(#) $Name: $ $Revision: 1.14 $ $RCSfile: exiftest.cpp,v $")
// *****************************************************************************
// included header files
@@ -22,6 +22,8 @@ EXIV2_RCSID("@(#) $Name: $ $Revision: 1.13 $ $RCSfile: exiftest.cpp,v $")
using namespace Exif;
void exifPrint(const ExifData& exifData);
+std::string readError(int rc, const char* file);
+std::string writeError(int rc, const char* file);
// *****************************************************************************
// Main
@@ -36,34 +38,20 @@ try {
ExifData exifData;
int rc = exifData.read(argv[1]);
if (rc) {
- std::string error = "Reading Exif data failed: ";
- switch (rc) {
- case -1:
- error += "Couldn't open file `" + std::string(argv[1]) + "'";
- break;
- case 1:
- error += "Couldn't read from the input stream";
- break;
- case 2:
- error += "This does not look like a JPEG image";
- break;
- case 3:
- case 4:
- error += "No Exif data found in the file";
- break;
- case -99:
- error += "Unsupported Exif or GPS data found in IFD 1";
- break;
- default:
- error += "rc = " + toString(rc);
- break;
- }
+ std::string error = readError(rc, argv[1]);
throw Error(error);
}
exifPrint(exifData);
exifData.writeThumbnail("thumb");
+ std::string key = "Image.OtherTags.Copyright";
+
+ Value* value = Value::create(asciiString);
+ value->read("Chan Yee Send");
+ exifData.add(key, value);
+ delete value;
+
char* buf = new char[1024*128];
long siz = exifData.copy(buf);
@@ -76,6 +64,13 @@ try {
exifPrint(e2);
e2.writeThumbnail("t2");
+ // Assumes that such a file exists...
+ rc = e2.write("test.jpg");
+ if (rc) {
+ std::string error = writeError(rc, "test.jpg");
+ throw Error(error);
+ }
+
return rc;
}
catch (Error& e) {
@@ -111,3 +106,61 @@ void exifPrint(const ExifData& exifData)
<< "
";
}
}
+
+std::string readError(int rc, const char* file)
+{
+ std::string error;
+ switch (rc) {
+ case -1:
+ error = "Couldn't open file `" + std::string(file) + "'";
+ break;
+ case 1:
+ error = "Couldn't read from the input stream";
+ break;
+ case 2:
+ error = "This does not look like a JPEG image";
+ break;
+ case 3:
+ error = "No Exif data found in the file";
+ break;
+ case -99:
+ error = "Unsupported Exif or GPS data found in IFD 1";
+ break;
+ default:
+ error = "Reading Exif data failed, rc = " + toString(rc);
+ break;
+ }
+ return error;
+}
+
+std::string writeError(int rc, const char* file)
+{
+ std::string error;
+ switch (rc) {
+ case -1:
+ error = "Couldn't open file `" + std::string(file) + "'";
+ break;
+ case -2:
+ error = "Couldn't open temporary file";
+ break;
+ case -3:
+ error = "Renaming temporary file failed";
+ break;
+ case 1:
+ error = "Couldn't read from the input stream";
+ break;
+ case 2:
+ error = "This does not look like a JPEG image";
+ break;
+ case 3:
+ error = "No JFIF APP0 or Exif APP1 segment found in the file";
+ break;
+ case 4:
+ error = "Writing to the output stream failed";
+ break;
+ default:
+ error = "Reading Exif data failed, rc = " + toString(rc);
+ break;
+ }
+ return error;
+}
--
exiv2 packaging
More information about the pkg-kde-commits
mailing list