gnunet-svn
[Top][All Lists]
Advanced

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

[GNUnet-SVN] r1584 - gnunet-gtk/src/plugins/fs


From: grothoff
Subject: [GNUnet-SVN] r1584 - gnunet-gtk/src/plugins/fs
Date: Tue, 19 Jul 2005 03:46:12 -0700 (PDT)

Author: grothoff
Date: 2005-07-19 03:46:09 -0700 (Tue, 19 Jul 2005)
New Revision: 1584

Modified:
   gnunet-gtk/src/plugins/fs/meta.c
Log:
cleaner: use LE 0.5.2 functions

Modified: gnunet-gtk/src/plugins/fs/meta.c
===================================================================
--- gnunet-gtk/src/plugins/fs/meta.c    2005-07-19 10:41:35 UTC (rev 1583)
+++ gnunet-gtk/src/plugins/fs/meta.c    2005-07-19 10:46:09 UTC (rev 1584)
@@ -319,40 +319,9 @@
                                    NULL,
                                    NULL)) {
        char * binary;
-       size_t pos;
-       size_t end;
-       size_t wpos;
-       size_t i;
-       unsigned int markers[8]; /* 256 bits */
-       unsigned char marker;
-       
-       /* encode! */
-       binary = MALLOC(2 + length + (length+256) / 254);         
-       pos = 0;
-       wpos = 0;
-       while (pos < length) {
-         /* find unused value between 1 and 255 in
-            the next 254 bytes */
-         end = pos + 254;
-         if (end < pos)
-           break; /* integer overflow! */
-         if (end > length)
-           end = length;
-         memset(markers, 0, sizeof(markers));
-         for (i=pos;i<end;i++)
-           markers[thumb[i]&7] |= 1 << (thumb[i] >> 3);
-         marker = 1;
-         while (markers[marker&7] & (1 << (marker >> 3))) {
-           marker++;
-           GNUNET_ASSERT(marker != 0);
-         }
-         /* recode */
-         binary[wpos++] = marker;
-         for (i=pos;i<end;i++)
-           binary[wpos++] = thumb[i] == 0 ? marker : thumb[i];
-         pos = end;
-       }
-       binary[wpos++] = 0; /* 0-termination! */
+
+       binary = EXTRACTOR_binaryEncode(thumb,
+                                       length);
        free(thumb);
        ECRS_addToMetaData(meta,
                           EXTRACTOR_THUMBNAIL_DATA,





reply via email to

[Prev in Thread] Current Thread [Next in Thread]