changeset 191:19df9953a5d1

crw preview support with exiv2
author nadvornik
date Sat, 22 Mar 2008 16:43:59 +0000
parents c2923efebfdc
children d324b284e183
files src/exiv2.cc
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/exiv2.cc	Sun Mar 16 14:11:22 2008 +0000
+++ b/src/exiv2.cc	Sat Mar 22 16:43:59 2008 +0000
@@ -20,6 +20,7 @@
 #include <exiv2/tiffvisitor.hpp>
 #include <exiv2/tiffimage.hpp>
 #include <exiv2/cr2image.hpp>
+#include <exiv2/crwimage.hpp>
 #include <exiv2/orfimage.hpp>
 #include <exiv2/rafimage.hpp>
 #include <exiv2/futils.hpp>
@@ -537,6 +538,15 @@
 		        if (map_len < 84 + 4) throw Error(14);
     			offset = getULong(map_data + 84, bigEndian);
 			return;
+		case Exiv2::ImageType::crw:
+			{
+			// Parse the image, starting with a CIFF header component
+			Exiv2::CiffHeader::AutoPtr parseTree(new Exiv2::CiffHeader);
+			parseTree->read(map_data, map_len);
+			CiffComponent *entry = parseTree->findComponent(0x2007, 0); 
+			if (entry) offset =  entry->pData() - map_data;
+			return;
+			}
 
 		default:
 			throw Error(3, "RAW");