[shotwell] Increase the limit for comments to 4095 bytes



commit bad1f2d891a6a3d03651c9b051e76438c28dc87a
Author: Jens Georg <mail jensge org>
Date:   Tue Jan 22 15:26:23 2019 +0100

    Increase the limit for comments to 4095 bytes
    
    This is the limit imposed by Xmp.acdsee.notes.
    
    Fixes #94

 src/photos/PhotoMetadata.vala | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
---
diff --git a/src/photos/PhotoMetadata.vala b/src/photos/PhotoMetadata.vala
index 5c7b3261..9414cd76 100644
--- a/src/photos/PhotoMetadata.vala
+++ b/src/photos/PhotoMetadata.vala
@@ -498,8 +498,9 @@ public class PhotoMetadata : MediaMetadata {
         return null;
     }
     
-    public void set_string(string tag, string value, PrepareInputTextOptions options = 
PREPARE_STRING_OPTIONS) {
-        string? prepped = prepare_input_text(value, options, DEFAULT_USER_TEXT_INPUT_LENGTH);
+    public void set_string(string tag, string value, PrepareInputTextOptions options = 
PREPARE_STRING_OPTIONS,
+                           int length = DEFAULT_USER_TEXT_INPUT_LENGTH) {
+        string? prepped = prepare_input_text(value, options, length);
         if (prepped == null) {
             warning("Not setting tag %s to string %s: invalid UTF-8", tag, value);
             
@@ -988,8 +989,9 @@ public class PhotoMetadata : MediaMetadata {
          * newlines from comments */
         if (!is_string_empty(comment))
             set_all_generic(COMMENT_TAGS, option, (tag) => {
+                // 4095 is coming from acdsee.notes which is limited to that
                 set_string(tag, comment, PREPARE_STRING_OPTIONS &
-                        ~PrepareInputTextOptions.STRIP_CRLF);
+                        ~PrepareInputTextOptions.STRIP_CRLF, 4095);
             });
         else
             remove_tags(COMMENT_TAGS);


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