Added a new public API function, exif_loader_get_buf(), which
authorDan Fandrich <dan@coneharvesters.com>
Thu, 1 Oct 2009 05:07:14 +0000 (22:07 -0700)
committerDan Fandrich <dan@coneharvesters.com>
Thu, 1 Oct 2009 05:07:14 +0000 (22:07 -0700)
returns a pointer to the raw data in the ExifLoader. Without this,
the only way to get the ExifLoader data out was as an
ExifData and using only the default set of ExifDataOptions.

ChangeLog
NEWS
libexif/exif-loader.c
libexif/exif-loader.h
libexif/libexif.sym

index 05d9027..b7d8561 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-09-30  Dan Fandrich <dan@coneharvesters.com>
+
+       * Added a new public API function, exif_loader_get_buf(), which
+         returns a pointer to the raw data in the ExifLoader. Without this,
+         the only way to get the ExifLoader data out was as an
+         ExifData and using only the default set of ExifDataOptions.
+
 2009-09-29  Dan Fandrich <dan@coneharvesters.com>
 
        * Added EXIF_DATA_TYPE_UNKNOWN as a backwards-compatible
diff --git a/NEWS b/NEWS
index 4c667d6..9a5e3b2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -17,14 +17,16 @@ libexif-0.6.x:
     removed from a file when EXIF_DATA_OPTION_IGNORE_UNKNOWN_TAGS is set
   * Changed exif_tag_get_support_level_in_ifd() to return a value when possible
     when the data type for the given EXIF data is unknown. This will cause
-    tags to be added or deleted when tag fixup is requested without a data
-    type being set.
+    tags to be added or deleted when tag fixup is requested even, without a
+    data type being set.
   * Added support for writing Pentax and Casio type2 MakerNotes
   * Improved display of Pentax and Casio type2 MakerNotes
   * Completely fixed bug #1617997 to display APEX values correctly
   * Stopped some crashes due to read-beyond-buffer accesses in MakerNotes
   * Don't abort MakerNote parsing after the first invalid tag
   * Sped up exif_content_fix()
+  * Fixed negative exposure values in Canon makernotes (bug #2797280)
+  * New API entry point: exif_loader_get_buf()
 
 libexif-0.6.17 (2008-11-06):
   * Updated translations: cs, de, pl, sk, vi
index fde75e9..1e30aa6 100644 (file)
@@ -404,6 +404,26 @@ exif_loader_get_data (ExifLoader *loader)
 }
 
 void
+exif_loader_get_buf (ExifLoader *loader, const unsigned char **buf,
+                                                 unsigned int *buf_size)
+{
+       const unsigned char* b = NULL;
+       unsigned int s = 0;
+
+       if (!loader || (loader->data_format == EL_DATA_FORMAT_UNKNOWN) {
+               exif_log (loader->log, EXIF_LOG_CODE_DEBUG, "ExifLoader",
+                         "Loader format unknown");
+       } else {
+               b = loader->buf;
+               s = loader->bytes_read;
+       }
+       if (buf)
+               *buf = b;
+       if (buf_size)
+               *buf_size = s;
+}
+
+void
 exif_loader_log (ExifLoader *loader, ExifLog *log)
 {
        if (!loader) 
index 88851b7..0ce4f41 100644 (file)
@@ -95,7 +95,24 @@ void          exif_loader_reset (ExifLoader *loader);
  */
 ExifData     *exif_loader_get_data (ExifLoader *loader);
 
-void exif_loader_log (ExifLoader *, ExifLog *);
+/*! Return the data read by the loader.  The returned pointer is only
+ * guaranteed to be valid until the next call to a function modifying
+ * this #ExifLoader.  Either or both of buf and buf_size may be NULL on
+ * entry, in which case that value is not returned.
+ *
+ * \param[in] loader the loader
+ * \param[out] buf read-only pointer to the data read by the loader, or NULL
+ *                 in case of error
+ * \param[out] buf_size size of the data at buf, or 0 in case of error
+ */
+void exif_loader_get_buf (ExifLoader *loader, const unsigned char **buf,
+                                                 unsigned int *buf_size);
+
+/*! Set the log message object used by this #ExifLoader.
+ * \param[in] loader the loader
+ * \param[in] log #ExifLog
+ */
+void exif_loader_log (ExifLoader *loader, ExifLog *log);
 
 #ifdef __cplusplus
 }
index bbaf967..f1d77cf 100644 (file)
@@ -126,3 +126,4 @@ mnote_pentax_entry_get_value
 mnote_pentax_tag_get_description
 mnote_pentax_tag_get_name
 mnote_pentax_tag_get_title
+exif_loader_get_buf