Ejemplo n.º 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;
 }
Ejemplo n.º 2
0
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;
}
Ejemplo n.º 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;
 }
Ejemplo n.º 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;
 }