[eog] Do not skip the first APP1 metadata chunk.



commit 9feef319b9c51ecabfd371097ce27c2cd985c375
Author: Claudio Saavedra <csaavedra igalia com>
Date:   Sun Apr 26 12:58:24 2009 +0300

    Do not skip the first APP1 metadata chunk.
    
    * src/eog-metadata-reader-jpg.c: (eog_metadata_reader_jpg_consume):
    Skip multiple APP1 of the same type more selectively, to avoid
    skipping the first chunk.
---
 ChangeLog                     |    6 ++++++
 src/eog-metadata-reader-jpg.c |   14 ++++++--------
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index cb7e0f1..bf86411 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2009-04-26  Claudio Saavedra  <csaavedra igalia com>
 
+	* src/eog-metadata-reader-jpg.c: (eog_metadata_reader_jpg_consume):
+	Skip multiple APP1 chunks of the same type more selectively, to
+	avoid skipping the first chunk.
+
+2009-04-26  Claudio Saavedra  <csaavedra igalia com>
+
 	* src/eog-image.c: (eog_image_set_xmp_data),
 	(eog_image_set_exif_data): Unref the EXIF chunk and XMP data
 	before setting it.
diff --git a/src/eog-metadata-reader-jpg.c b/src/eog-metadata-reader-jpg.c
index 6f069da..7df3a56 100644
--- a/src/eog-metadata-reader-jpg.c
+++ b/src/eog-metadata-reader-jpg.c
@@ -308,6 +308,9 @@ eog_metadata_reader_jpg_consume (EogMetadataReaderJpg *emr, const guchar *buf, g
 					priv->bytes_read = 0;
 					chunk = priv->exif_chunk;
 					next_state = EMR_READ_EXIF;
+				} else {
+					chunk = NULL;
+					priv->state = EMR_SKIP_BYTES;
 				}
 				break;
 			case EJA_XMP:
@@ -317,6 +320,9 @@ eog_metadata_reader_jpg_consume (EogMetadataReaderJpg *emr, const guchar *buf, g
 					priv->bytes_read = 0;
 					chunk = priv->xmp_chunk;
 					next_state = EMR_READ_XMP;
+				} else {
+					chunk = NULL;
+					priv->state = EMR_SKIP_BYTES;
 				}
 				break;
 			case EJA_OTHER:
@@ -327,14 +333,6 @@ eog_metadata_reader_jpg_consume (EogMetadataReaderJpg *emr, const guchar *buf, g
 				break;
 			}
 
-			if (priv->state == EMR_READ_APP1) {
-				/* If a metadata type has already been read
-				 * make sure it's not read again */
-				chunk = NULL;
-				priv->state = EMR_SKIP_BYTES;
-			}
-
-
 			if (chunk) {
 				eog_metadata_reader_get_next_block (priv, chunk,
 								    &i, buf,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]