View | Details | Raw Unified | Return to bug 272311 | Differences between
and this patch

Collapse All | Expand All

(-)b/graphics/rawstudio/Makefile (-1 / +1 lines)
Lines 1-6 Link Here
1
PORTNAME=	rawstudio
1
PORTNAME=	rawstudio
2
PORTVERSION=	2.0
2
PORTVERSION=	2.0
3
PORTREVISION=	23
3
PORTREVISION=	24
4
CATEGORIES=	graphics
4
CATEGORIES=	graphics
5
MASTER_SITES=	http://rawstudio.org/files/release/
5
MASTER_SITES=	http://rawstudio.org/files/release/
6
6
(-)b/graphics/rawstudio/files/patch-librawstudio_rs-exif.cc (+65 lines)
Lines 9-11 Link Here
9
 #include "rs-exif.h"
9
 #include "rs-exif.h"
10
 #include <assert.h>
10
 #include <assert.h>
11
 #include "rs-library.h"
11
 #include "rs-library.h"
12
@@ -128,7 +130,7 @@ rs_exif_load_from_file(const gchar *filename)
13
 	RS_EXIF_DATA *exif_data;
14
 	try
15
 	{
16
-		Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(filename);
17
+		Exiv2::Image::UniquePtr image { Exiv2::ImageFactory::open(filename) };
18
 		assert(image.get() != 0);
19
 		image->readMetadata();
20
 
21
@@ -136,7 +138,7 @@ rs_exif_load_from_file(const gchar *filename)
22
 
23
 		exif_data_init(exif_data);
24
 	}
25
-	catch (Exiv2::AnyError& e)
26
+	catch (Exiv2::Error& e)
27
 	{
28
 		g_warning("Could not load EXIF data from file %s", filename);
29
 		return NULL;
30
@@ -151,8 +153,8 @@ rs_exif_load_from_rawfile(RAWFILE *rawfile)
31
 	RS_EXIF_DATA *rs_exif_data;
32
 	try
33
 	{
34
-		Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(
35
-			(const Exiv2::byte*) raw_get_map(rawfile), raw_get_filesize(rawfile));
36
+		Exiv2::Image::UniquePtr image { Exiv2::ImageFactory::open(
37
+			(const Exiv2::byte*) raw_get_map(rawfile), raw_get_filesize(rawfile)) };
38
 
39
 		assert(image.get() != 0);
40
 		image->readMetadata();
41
@@ -161,7 +163,7 @@ rs_exif_load_from_rawfile(RAWFILE *rawfile)
42
 
43
 		exif_data_init(rs_exif_data);
44
 	}
45
-	catch (Exiv2::AnyError& e)
46
+	catch (Exiv2::Error& e)
47
 	{
48
 		g_warning("Could not load EXIF data");
49
 		return NULL;
50
@@ -179,7 +181,7 @@ rs_exif_add_to_file(RS_EXIF_DATA *d, Exiv2::IptcData &
51
 	try
52
 	{
53
 		Exiv2::ExifData *data = (Exiv2::ExifData *) d;
54
-		Exiv2::Image::AutoPtr image = Exiv2::ImageFactory::open(filename);
55
+		Exiv2::Image::UniquePtr image { Exiv2::ImageFactory::open(filename) };
56
 
57
 		/* Copy EXIF to XMP */
58
 #if EXIV2_TEST_VERSION(0,17,0)
59
@@ -194,7 +196,7 @@ rs_exif_add_to_file(RS_EXIF_DATA *d, Exiv2::IptcData &
60
 		image->setIptcData(iptc_data);
61
 		image->writeMetadata();
62
 	}
63
-	catch (Exiv2::AnyError& e)
64
+	catch (Exiv2::Error& e)
65
 	{
66
 		g_warning("Couldn't add EXIF data to %s", filename);
67
 	}
68
@@ -263,7 +265,7 @@ rs_add_tags_exif(RS_EXIF_DATA *d, const gchar *input_f
69
 
70
 	glong items_written;
71
 	gunichar2 *w = g_utf8_to_utf16(xpkeyw->str, -1, NULL, &items_written, NULL);
72
-	Exiv2::Value::AutoPtr v = Exiv2::Value::create(Exiv2::unsignedByte);
73
+	Exiv2::Value::UniquePtr v { Exiv2::Value::create(Exiv2::unsignedByte) };
74
 	v->read((const Exiv2::byte*)w, items_written * sizeof(gunichar2), Exiv2::invalidByteOrder);
75
 	Exiv2::ExifKey key = Exiv2::ExifKey("Exif.Image.XPKeywords");
76
 	data->add(key, v.get());
(-)b/graphics/rawstudio/files/patch-plugins_load-gdk_exiv2-colorspace.cpp (+39 lines)
Lines 23-25 Link Here
23
 						if (retval != 0)
23
 						if (retval != 0)
24
 						{
24
 						{
25
 							RSIccProfile *icc = rs_icc_profile_new_from_memory((gchar*)icc_profile, icc_profile_size, TRUE);
25
 							RSIccProfile *icc = rs_icc_profile_new_from_memory((gchar*)icc_profile, icc_profile_size, TRUE);
26
@@ -151,7 +153,7 @@ jpeg_fail:
27
 #endif
28
 
29
 	try {
30
-		Image::AutoPtr img = ImageFactory::open(filename);
31
+		Image::UniquePtr img { ImageFactory::open(filename) };
32
 		img->readMetadata();
33
 		ExifData &exifData = img->exifData();
34
 		*linear_guess = FALSE;
35
@@ -169,13 +171,13 @@ jpeg_fail:
36
 			ExifData::const_iterator i;
37
 			i = exifData.findKey(ExifKey("Exif.Image.BitsPerSample"));
38
 			if (i != exifData.end())
39
-				if (i->toLong() == 16)
40
+				if (i->toInt64() == 16)
41
 					*linear_guess = TRUE;
42
 			
43
 			i = exifData.findKey(ExifKey("Exif.Photo.ColorSpace"));
44
 			if (i != exifData.end())
45
 			{
46
-				if (i->toLong() == 1)
47
+				if (i->toInt64() == 1)
48
 					return rs_color_space_new_singleton("RSSrgb");
49
 			}
50
 
51
@@ -184,10 +186,10 @@ jpeg_fail:
52
 			if (i != exifData.end())
53
 			{
54
 				DataBuf buf(i->size());
55
-				i->copy(buf.pData_, Exiv2::invalidByteOrder);
56
-				if (buf.pData_ && buf.size_)
57
+				i->copy(buf.data(), Exiv2::invalidByteOrder);
58
+				if (buf.c_data() && buf.size())
59
 				{
60
-					RSIccProfile *icc = rs_icc_profile_new_from_memory((gchar*)buf.pData_, buf.size_, TRUE);
61
+					RSIccProfile *icc = rs_icc_profile_new_from_memory((gchar*)buf.c_data(), buf.size(), TRUE);
62
 					return rs_color_space_icc_new_from_icc(icc);
63
 				}
64
 			}
(-)b/graphics/rawstudio/files/patch-plugins_meta-exiv2_exiv2-metadata.cpp (-1 / +72 lines)
Lines 9-11 Link Here
9
 #include <assert.h>
9
 #include <assert.h>
10
 #include "exiv2-metadata.h"
10
 #include "exiv2-metadata.h"
11
 #include <math.h>
11
 #include <math.h>
12
- 
12
@@ -94,7 +96,7 @@ gboolean
13
 exiv2_load_meta_interface(const gchar *service, RAWFILE *rawfile, guint offset, RSMetadata *meta)
14
 {
15
 	try {
16
-		Image::AutoPtr img = ImageFactory::open((byte*)raw_get_map(rawfile), raw_get_filesize(rawfile));
17
+		Image::UniquePtr img { ImageFactory::open((byte*)raw_get_map(rawfile), raw_get_filesize(rawfile)) };
18
 		img->readMetadata();
19
 		ExifData &exifData = img->exifData();
20
 
21
@@ -121,7 +123,7 @@ exiv2_load_meta_interface(const gchar *service, RAWFIL
22
 			i = orientation(exifData);
23
 			if (i != exifData.end())
24
 			{
25
-				switch (i->getValue()->toLong())
26
+				switch (i->getValue()->toInt64())
27
 				{
28
 						case 6: meta->orientation = 90;
29
 							break;
30
@@ -173,7 +175,7 @@ exiv2_load_meta_interface(const gchar *service, RAWFIL
31
 #if EXIV2_TEST_VERSION(0,19,0)
32
 			i = isoSpeed(exifData);
33
 			if (i != exifData.end())
34
-				meta->iso = i->toLong();
35
+				meta->iso = i->toInt64();
36
 
37
 			/* Text based Lens Identifier */
38
 			i = lensName(exifData);
39
@@ -181,7 +183,7 @@ exiv2_load_meta_interface(const gchar *service, RAWFIL
40
 			{
41
 				TypeId type = i->typeId();
42
 				if (type == unsignedShort || type == unsignedLong || type == signedShort || type == signedLong || type == unsignedByte || type == signedByte)
43
-					meta->lens_id = i->toLong();
44
+					meta->lens_id = i->toInt64();
45
 				else if (type == asciiString || type == string)
46
 					meta->fixed_lens_identifier = g_strdup(i->toString().c_str());
47
 			}
48
@@ -223,7 +225,7 @@ exiv2_load_meta_interface(const gchar *service, RAWFIL
49
 			if (i == exifData.end())
50
 				i = exifData.findKey(ExifKey("Exif.NikonLd3.MinFocalLength"));
51
 			if (i != exifData.end())
52
-				meta->lens_min_focal = 5.0 * pow(2.0, i->toLong()/24.0);
53
+				meta->lens_min_focal = 5.0 * pow(2.0, i->toInt64()/24.0);
54
 
55
 			i = exifData.findKey(ExifKey("Exif.NikonLd1.MaxFocalLength"));
56
 			if (i == exifData.end())
57
@@ -231,7 +233,7 @@ exiv2_load_meta_interface(const gchar *service, RAWFIL
58
 			if (i == exifData.end())
59
 				i = exifData.findKey(ExifKey("Exif.NikonLd3.MaxFocalLength"));
60
 			if (i != exifData.end())
61
-				meta->lens_max_focal = 5.0 * pow(2.0, i->toLong()/24.0);
62
+				meta->lens_max_focal = 5.0 * pow(2.0, i->toInt64()/24.0);
63
 
64
 			i = exifData.findKey(ExifKey("Exif.NikonLd1.MaxApertureAtMinFocal"));
65
 			if (i == exifData.end())
66
@@ -239,7 +241,7 @@ exiv2_load_meta_interface(const gchar *service, RAWFIL
67
 			if (i == exifData.end())
68
 				i = exifData.findKey(ExifKey("Exif.NikonLd3.MaxApertureAtMinFocal"));
69
 			if (i != exifData.end())
70
-				meta->lens_min_aperture = i->toLong()/12.0;
71
+				meta->lens_min_aperture = i->toInt64()/12.0;
72
 			
73
 			i = exifData.findKey(ExifKey("Exif.NikonLd1.MaxApertureAtMaxFocal"));
74
 			if (i == exifData.end())
75
@@ -247,7 +249,7 @@ exiv2_load_meta_interface(const gchar *service, RAWFIL
76
 			if (i == exifData.end())
77
 				i = exifData.findKey(ExifKey("Exif.NikonLd3.MaxApertureAtMaxFocal"));
78
 			if (i != exifData.end())
79
-				meta->lens_max_aperture = i->toLong()/12.0;
80
+				meta->lens_max_aperture = i->toInt64()/12.0;
81
 				
82
 			/* Fuji */
83
 			i = exifData.findKey(ExifKey("Exif.Fujifilm.MinFocalLength"));

Return to bug 272311