--- ruby-exif-0.1.2.orig/extconf.rb
+++ ruby-exif-0.1.2/extconf.rb
@@ -5,7 +5,7 @@
 def have_libexif_header
   have_header('libexif/exif-ifd.h') and
   have_header('libexif/exif-data.h') and
-  have_header('libexif/exif-note.h') and
+#  have_header('libexif/exif-note.h') and
   have_header('libexif/exif-utils.h') and
   have_header('libexif/exif-tag.h') 
 end
--- ruby-exif-0.1.2.orig/exif.c
+++ ruby-exif-0.1.2/exif.c
@@ -7,10 +7,10 @@
 
 
 *******************************************************************************/
-#include "ruby.h"
+#include <ruby.h>
 #include <libexif/exif-ifd.h>
 #include <libexif/exif-data.h>
-#include <libexif/exif-note.h>
+/* #include <libexif/exif-note.h> */
 #include <libexif/exif-utils.h>
 #include <libexif/exif-tag.h>
 
@@ -62,16 +62,16 @@
 {
 	ExifData *data;
 	Check_Type(fpath, T_STRING);
-	data = exif_data_new_from_file(RSTRING(fpath)->ptr);
+	data = exif_data_new_from_file(RSTRING_PTR(fpath));
 	if (!data){
 		FILE *f;
-		f = fopen(RSTRING(fpath)->ptr,"rb");
+		f = fopen(RSTRING_PTR(fpath),"rb");
 		if (!f)
 			rb_raise(rb_eArgError, "unable to open file - '%s'",
-			         RSTRING(fpath)->ptr);
+			         RSTRING_PTR(fpath));
 		fclose(f);
 		rb_raise(eExifInvalidFormat, 
-		         "'%s' does not contain EXIF data", RSTRING(fpath)->ptr);
+		         "'%s' does not contain EXIF data", RSTRING_PTR(fpath));
 	}
 	return data;
 }
@@ -100,7 +100,7 @@
 		exif_data_free(ed);
 		ed = NULL;
 	}
-	ed = exif_data_new_from_data((unsigned char *)RSTRING(str)->ptr, RSTRING(str)->len);
+	ed = exif_data_new_from_data((unsigned char *)RSTRING_PTR(str), RSTRING_LEN(str));
 }
 
 static VALUE
@@ -134,11 +134,12 @@
 {
 	VALUE k, v;
 	char buf[7];
+	char value[1024];
 	unsigned char *ids = data;
 	memset(buf, 0, sizeof(buf));
 	sprintf(buf, "0x%04x", entry->tag);
 	k = *ids ? rb_str_new2(buf) : rb_str_new2(exif_tag_get_title(entry->tag));
-	v = rb_str_new2(exif_entry_get_value(entry));
+	v = rb_str_new2(exif_entry_get_value(entry, value, sizeof(value)));
 	rb_yield(rb_assoc_new(k, v));
 }
 
@@ -179,9 +180,9 @@
 		}
 		break;
 	  case T_STRING:
-		i = exif_ifd_from_string(RSTRING(ifd)->ptr);
+		i = exif_ifd_from_string(RSTRING_PTR(ifd));
 		if (i == -1){
-			rb_raise(rb_eRuntimeError, "unknown IFD: '%s'", RSTRING(ifd)->ptr);
+			rb_raise(rb_eRuntimeError, "unknown IFD: '%s'", RSTRING_PTR(ifd));
 		}
 		break;
 	  default:
@@ -215,13 +216,14 @@
 	ExifEntry *e;
 	const char *found;
 	int i;
+	char value[1024];
 
 	Get_Exif(obj, exif);
 	switch (TYPE(tagid)) {
 	  case T_STRING:
-		tag = exif_tag_from_string(RSTRING(tagid)->ptr);
+		tag = exif_tag_from_string(RSTRING_PTR(tagid));
 		if (!tag){
-			rb_raise(eExifError, "invalid tag: '%s'", RSTRING(tagid)->ptr);
+			rb_raise(eExifError, "invalid tag: '%s'", RSTRING_PTR(tagid));
 		}
 		break;
 	  case T_FIXNUM:
@@ -241,14 +243,14 @@
 			"IFD '%s' does not contain tag '%s'(0x%04x)",
 			exif_ifd_get_name(exif->ifd), exif_tag_get_title(tag), tag);
 		}
-		return rb_str_new2(exif_entry_get_value(e));
+		return rb_str_new2(exif_entry_get_value(e, value, sizeof(value)));
 	}
 	for (i = 0; i < EXIF_IFD_COUNT; i++){
 		e = exif_content_get_entry(exif->ed->ifd[i], tag);
 		if (e)
 			break;
 	}
-	found = exif_entry_get_value(e);
+	found = exif_entry_get_value(e, value, sizeof(value));
 	return found ? rb_str_new2(found) : Qnil;
 }
 
@@ -272,9 +274,9 @@
 	Check_Type(tagid, T_STRING);
 	Check_Type(val, T_STRING);
 	Get_Exif(obj, exif);
-	tag = exif_tag_from_string(RSTRING(tagid)->ptr);
+	tag = exif_tag_from_string(RSTRING_PTR(tagid));
 	if (!tag || !exif_tag_get_name(tag)){
-		rb_raise(eExifError, "invalid tag: '%s'", RSTRING(tagid)->ptr);
+		rb_raise(eExifError, "invalid tag: '%s'", RSTRING_PTR(tagid));
 	}
 	e = exif_content_get_entry(exif->ed->ifd[exif->ifd], tag);
 	if (!e){
@@ -326,9 +328,9 @@
 			         FIX2INT(tagid), FIX2INT(tagid));
 		break;
 	  case T_STRING:
-	    tag = exif_tag_from_string(RSTRING(tagid)->ptr);
+	    tag = exif_tag_from_string(RSTRING_PTR(tagid));
 		if (!tag || !exif_tag_get_name(tag)) {
-			rb_raise(eExifError, "invalid tag: '%s'", RSTRING(tagid)->ptr);
+			rb_raise(eExifError, "invalid tag: '%s'", RSTRING_PTR(tagid));
 		}
 		break;
 	  default:
@@ -366,9 +368,9 @@
 		exif->ed->size = 0;
 	}
 	Check_Type(src, T_STRING);
-	exif->ed->size = RSTRING(src)->len;
+	exif->ed->size = RSTRING_LEN(src);
 	exif->ed->data = xmalloc(sizeof(char)*exif->ed->size);
-	MEMMOVE(exif->ed->data, RSTRING(src)->ptr, char, exif->ed->size);
+	MEMMOVE(exif->ed->data, RSTRING_PTR(src), char, exif->ed->size);
 	return obj;
 }
 
