[SCM] exiv2 packaging branch, master, updated. debian/0.25-3.1-3734-gdcbc29a

Maximiliano Curia maxy at moszumanska.debian.org
Thu Jul 13 17:37:06 UTC 2017


Gitweb-URL: http://git.debian.org/?p=pkg-kde/kde-extras/exiv2.git;a=commitdiff;h=ff718d8

The following commit has been merged in the master branch:
commit ff718d8de64d09fc66e729f97962344db50e1ba8
Author: Andreas Huggel <ahuggel at gmx.net>
Date:   Sun Apr 17 12:47:49 2005 +0000

    Fixed MSVC compilation (otherwise untested)
---
 msvc/exiv2lib/exiv2lib.vcproj  | 33 ++++++++++++++++++
 msvc/exivsimple/exivsimple.cpp | 78 +++++++++++++++++++++++++++---------------
 2 files changed, 84 insertions(+), 27 deletions(-)

diff --git a/msvc/exiv2lib/exiv2lib.vcproj b/msvc/exiv2lib/exiv2lib.vcproj
index bfdbf0f..c254056 100644
--- a/msvc/exiv2lib/exiv2lib.vcproj
+++ b/msvc/exiv2lib/exiv2lib.vcproj
@@ -128,6 +128,21 @@
 				RelativePath="..\..\src\datasets.cpp">
 			</File>
 			<File
+				RelativePath="..\..\src\error.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						ObjectFile="$(IntDir)/$(InputName)1.obj"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						ObjectFile="$(IntDir)/$(InputName)1.obj"/>
+				</FileConfiguration>
+			</File>
+			<File
 				RelativePath="..\..\src\exif.cpp">
 				<FileConfiguration
 					Name="Debug|Win32">
@@ -158,6 +173,21 @@
 				</FileConfiguration>
 			</File>
 			<File
+				RelativePath="..\..\src
utils.cpp">
+				<FileConfiguration
+					Name="Debug|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						ObjectFile="$(IntDir)/$(InputName)1.obj"/>
+				</FileConfiguration>
+				<FileConfiguration
+					Name="Release|Win32">
+					<Tool
+						Name="VCCLCompilerTool"
+						ObjectFile="$(IntDir)/$(InputName)1.obj"/>
+				</FileConfiguration>
+			</File>
+			<File
 				RelativePath="..\..\src\ifd.cpp">
 				<FileConfiguration
 					Name="Debug|Win32">
@@ -331,6 +361,9 @@
 				RelativePath="..\..\src
ujimn.hpp">
 			</File>
 			<File
+				RelativePath="..\..\src
utils.hpp">
+			</File>
+			<File
 				RelativePath="..\..\src\ifd.hpp">
 			</File>
 			<File
diff --git a/msvc/exivsimple/exivsimple.cpp b/msvc/exivsimple/exivsimple.cpp
index 59b177f..4accd48 100644
--- a/msvc/exivsimple/exivsimple.cpp
+++ b/msvc/exivsimple/exivsimple.cpp
@@ -42,23 +42,32 @@ struct ImageWrapper
 EXIVSIMPLE_API HIMAGE OpenFileImage(const char *file)
 {
     assert(file);
-    ImageWrapper *imgWrap = new ImageWrapper;
 
     // See if file exists. Sorry for very bad error handling
     if (INVALID_FILE_ATTRIBUTES == GetFileAttributes(file)) {
         return 0;
     }
 
-    imgWrap->image = Exiv2::ImageFactory::open(file);
-    if (imgWrap->image.get() == 0) {
-        return 0;
-    }
-
+    ImageWrapper *imgWrap = new ImageWrapper;
+	try {
+		imgWrap->image = Exiv2::ImageFactory::open(file);
+	}
+	catch(const Exiv2::AnyError&) {
+		delete imgWrap;
+		return 0;
+	}
+	if (imgWrap->image.get() == 0) {
+		delete imgWrap;
+		return 0;
+	}
     // Load existing metadata
-    if (imgWrap->image->readMetadata()) {
-        delete imgWrap;
-        imgWrap = 0;
-    }
+	try {
+		imgWrap->image->readMetadata();
+	}
+	catch(const Exiv2::AnyError&) { 
+		delete imgWrap;
+		return 0;
+	}
 
     return (HIMAGE)imgWrap;
 }
@@ -68,16 +77,25 @@ EXIVSIMPLE_API HIMAGE OpenMemImage(const BYTE *data, unsigned int size)
     assert(data);
     ImageWrapper *imgWrap = new ImageWrapper;
 
-    imgWrap->image = Exiv2::ImageFactory::open(data, size);
-    if (imgWrap->image.get() == 0) {
-        return 0;
-    }
-
-    // Load existing metadata
-    if (imgWrap->image->readMetadata()) {
+	try {
+	    imgWrap->image = Exiv2::ImageFactory::open(data, size);
+	}
+	catch(const Exiv2::AnyError&) {
+		delete imgWrap;
+		return 0;
+	}
+	if (imgWrap->image.get() == 0) {
         delete imgWrap;
-        imgWrap = 0;
+		return 0;
     }
+    // Load existing metadata
+	try {
+	    imgWrap->image->readMetadata();
+	}
+	catch(const Exiv2::AnyError&) {
+		delete imgWrap;
+		return 0;
+	}
 
     return (HIMAGE)imgWrap;
 }
@@ -95,7 +113,13 @@ EXIVSIMPLE_API int SaveImage(HIMAGE img)
 {
     assert(img);
     ImageWrapper *imgWrap = (ImageWrapper*)img;
-    return imgWrap->image->writeMetadata();
+	try {
+		imgWrap->image->writeMetadata();
+	}
+	catch(const Exiv2::AnyError&) {
+		return 1;
+	}
+    return 0;
 }
 
 // Note that if you have modified the metadata in any way and want the
@@ -155,7 +179,7 @@ EXIVSIMPLE_API int ReadMeta(HIMAGE img, const char *key, char *buff, int buffsiz
             rc = 0;
         }
     } 
-    catch(const Exiv2::Error&) {
+    catch(const Exiv2::AnyError&) {
     }
 
     if (rc) {
@@ -170,7 +194,7 @@ EXIVSIMPLE_API int ReadMeta(HIMAGE img, const char *key, char *buff, int buffsiz
                 rc = 0;
             }
         }
-        catch(const Exiv2::Error&) {
+        catch(const Exiv2::AnyError&) {
         }
     }
 
@@ -215,7 +239,7 @@ EXIVSIMPLE_API int ModifyMeta(HIMAGE img, const char *key, const char *val, DllT
             rc = iptcData.add(iptcKey, value.get());
         }
     } 
-    catch(const Exiv2::Error&) {
+    catch(const Exiv2::AnyError&) {
     }
 
     if (rc) {
@@ -240,7 +264,7 @@ EXIVSIMPLE_API int ModifyMeta(HIMAGE img, const char *key, const char *val, DllT
                 rc = 0;
             }
         }
-        catch(const Exiv2::Error&) {
+        catch(const Exiv2::AnyError&) {
         }
     }
 
@@ -278,7 +302,7 @@ EXIVSIMPLE_API int AddMeta(HIMAGE img, const char *key, const char *val, DllType
 
         rc = iptcData.add(iptcKey, value.get());
     } 
-    catch(const Exiv2::Error&) {
+    catch(const Exiv2::AnyError&) {
     }
 
     if (rc) {
@@ -296,7 +320,7 @@ EXIVSIMPLE_API int AddMeta(HIMAGE img, const char *key, const char *val, DllType
             exifData.add(exifKey, value.get());
             rc = 0;
         }
-        catch(const Exiv2::Error&) {
+        catch(const Exiv2::AnyError&) {
         }
     }
 
@@ -325,7 +349,7 @@ EXIVSIMPLE_API int RemoveMeta(HIMAGE img, const char *key)
             rc = 0;
         }
     } 
-    catch(const Exiv2::Error&) {
+    catch(const Exiv2::AnyError&) {
     }
 
     if (rc) {
@@ -339,7 +363,7 @@ EXIVSIMPLE_API int RemoveMeta(HIMAGE img, const char *key)
                 rc = 0;
             }
         }
-        catch(const Exiv2::Error&) {
+        catch(const Exiv2::AnyError&) {
         }
     }
 

-- 
exiv2 packaging



More information about the pkg-kde-commits mailing list