[evince/wip/chpe/xmp: 1/11] pdf: Fix metadata parsing precedence




commit 761fd1053b669f3a28e4c1c5a590e92ac18e70ea
Author: Christian Persch <chpe src gnome org>
Date:   Sat Dec 4 01:42:14 2021 +0100

    pdf: Fix metadata parsing precedence
    
    Set the creation and modified datetime from the document in the info
    first before parsing the metadata, since the metadata parsing needs to
    compare the metadata datetime to decide which info takes precedence.
    
    Fixes a slight regression from commit
    1e0a3efa24a4db67fc5b8f0939444d69771be196.

 backend/pdf/ev-poppler.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/backend/pdf/ev-poppler.c b/backend/pdf/ev-poppler.c
index 8dc9035e1..8b3b7a5d7 100644
--- a/backend/pdf/ev-poppler.c
+++ b/backend/pdf/ev-poppler.c
@@ -1060,6 +1060,9 @@ pdf_document_get_info (EvDocument *document)
                      "metadata", &metadata,
                      NULL);
 
+        ev_document_info_take_created_datetime (info, created_datetime);
+        ev_document_info_take_modified_datetime (info, modified_datetime);
+
        if (metadata != NULL) {
                pdf_document_parse_metadata (metadata, info);
                g_free (metadata);
@@ -1174,9 +1177,6 @@ pdf_document_get_info (EvDocument *document)
        info->contains_js = EV_DOCUMENT_CONTAINS_JS_UNKNOWN;
 #endif
 
-        ev_document_info_take_created_datetime (info, created_datetime);
-        ev_document_info_take_modified_datetime (info, modified_datetime);
-
        return info;
 }
 


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