File tree Expand file tree Collapse file tree 1 file changed +12
-3
lines changed
Expand file tree Collapse file tree 1 file changed +12
-3
lines changed Original file line number Diff line number Diff line change @@ -451,13 +451,22 @@ exif_entry_cb (ExifEntry *entry, gpointer data)
451451 ExifIfd ifd = exif_entry_get_ifd (entry );
452452 char * path ;
453453 char b [1024 ];
454+ const gint key = ifd << 16 | entry -> tag ;
455+
456+ /* This should optimize away if comparision is correct */
457+ g_warn_if_fail (EXIF_IFD_COUNT <= G_MAXUINT16 );
454458
455459 view = EOM_EXIF_DETAILS (data );
456460 priv = view -> priv ;
457461
458462 store = GTK_TREE_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (view )));
459463
460- path = g_hash_table_lookup (priv -> id_path_hash , GINT_TO_POINTER (entry -> tag ));
464+ /* Take the tag's IFD into account when caching their GtkTreePaths.
465+ * That should fix key collisions for tags that have the same number
466+ * but are stored in different IFDs. Exif tag numbers are 16-bit
467+ * values so we should be able to set the high word to the IFD number.
468+ */
469+ path = g_hash_table_lookup (priv -> id_path_hash , GINT_TO_POINTER (key ));
461470
462471 if (path != NULL ) {
463472 set_row_data (store ,
@@ -500,8 +509,8 @@ exif_entry_cb (ExifEntry *entry, gpointer data)
500509 sizeof (b )));
501510
502511 g_hash_table_insert (priv -> id_path_hash ,
503- GINT_TO_POINTER (entry -> tag ),
504- path );
512+ GINT_TO_POINTER (key ),
513+ path );
505514 }
506515 }
507516}
You can’t perform that action at this time.
0 commit comments