コード例 #1
0
 Image::AutoPtr newExvInstance(BasicIo::AutoPtr io, bool create)
 {
     Image::AutoPtr image;
     image = Image::AutoPtr(new ExvImage(io, create));
     if (!image->good()) image.reset();
     return image;
 }
コード例 #2
0
ファイル: metadata_exiv2.cpp プロジェクト: MaiTiano/fuppes
int exiv2_metadata_file_open(plugin_info* plugin, const char* fileName)
{
	try
	{
		Image::AutoPtr image = Exiv2::ImageFactory::open(fileName);
		
		if(!image->good())
		{
//		cerr << "Image could not be read by Exiv2: " << fileName << endl;
			return -1;
		}
		
		image->readMetadata();
		
		if(image->exifData().empty()) // && image->iptcData().empty())
		{
//		cout << "Image had no EXIF/IPTC metadata: " << fileName << endl;
			return -1;
		}
		
	    plugin->user_data = new Image::AutoPtr(image);	
	}
	catch(...)
	{
		cerr << "Exception in Exiv2 Metadata plugin" << endl;
		return -1;
	}
	
	return 0;
}
コード例 #3
0
 Image::AutoPtr newCrwInstance(BasicIo::AutoPtr io, bool create)
 {
     Image::AutoPtr image = Image::AutoPtr(new CrwImage(io, create));
     if (!image->good()) {
         image.reset();
     }
     return image;
 }
コード例 #4
0
 Image::AutoPtr newExvInstance(BasicIo::AutoPtr io, bool create)
 {
     Image::AutoPtr image;
     if (create) {
         image = Image::AutoPtr(new ExvImage(io, true));
     }
     else {
         image = Image::AutoPtr(new ExvImage(io, false));
     }
     if (!image->good()) image.reset();
     return image;
 }