]> mj.ucw.cz Git - libucw.git/commitdiff
some small bugfixes about image signatures
authorPavel Charvat <pavel.charvat@netcentrum.cz>
Wed, 30 Aug 2006 07:16:40 +0000 (09:16 +0200)
committerPavel Charvat <pavel.charvat@netcentrum.cz>
Wed, 30 Aug 2006 07:16:40 +0000 (09:16 +0200)
images/sig-seg.c
images/sig-txt.c
images/signature.h

index dc445bd94fa9544a98f77fedfc304429e1c50609..cdcb71c8417ba147af293d0a1eb334fc644f66e1 100644 (file)
@@ -7,7 +7,7 @@
  *     of the GNU Lesser General Public License.
  */
 
-#define LOCAL_DEBUG
+#undef LOCAL_DEBUG
 
 #include "sherlock/sherlock.h"
 #include "lib/conf.h"
index 0429b7390162c31e9938b7fc829690600f33e180..31887cf2cc7830180615c598c81be2b215f192b3 100644 (file)
@@ -31,6 +31,12 @@ image_sig_detect_textured(struct image_sig_data *data)
   uns i, j;
   u32 cnt[IMAGE_REG_MAX];
 
+  if (cell_cols * cell_rows < 4)
+    {
+      DBG("Image is not textured.");
+      return;
+    }
+
   DBG("Detecting textured image... cols=%u rows=%u cell_cols=%u cell_rows=%u", cols, rows, cell_cols, cell_rows);
   
   /* Compute cells boundaries */
index 5f8009a196b34da557987b4740e90a9c2b8e6c39..4f53f24ff57b004bba818910c5ccd3454a8dbf57 100644 (file)
@@ -43,11 +43,11 @@ struct image_cluster {
     struct {
       s32 dot;                 /* Dot product of the splitting plane */
       s8 vec[IMAGE_VEC_F];     /* Normal vector of the splitting plane */
-    };
+    } PACKED;
     struct {
       u64 pos;                 /* Cluster size in bytes */
-    };
-  };
+    } PACKED;
+  } PACKED;
 } PACKED;
 
 static inline uns