]> git.ipfire.org Git - thirdparty/rspamd.git/commitdiff
[Minor] Add HEIC files patterns
authorVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 16 May 2025 10:43:39 +0000 (11:43 +0100)
committerVsevolod Stakhov <vsevolod@rspamd.com>
Fri, 16 May 2025 10:43:39 +0000 (11:43 +0100)
lualib/lua_magic/patterns.lua
lualib/lua_magic/types.lua

index 971ddd95fa96b673ad9eca71f8f5721eec72864c..4b19c9fec53d75464bfdde978233a2fe33d2ebc5 100644 (file)
@@ -466,6 +466,23 @@ local patterns = {
       },
     }
   },
+  heic = {
+    matches = {
+      {
+        -- HEIC/HEIF file format signature
+        -- Starts with ftyp followed by specific brand identifiers
+        string = "^....ftyphe[im][cs]",
+        relative_position = 0,
+        weight = 60,
+      },
+      {
+        -- Alternative signature for HEIC/HEIF
+        string = [[^....ftypmif1]],
+        relative_position = 0,
+        weight = 60,
+      },
+    }
+  },
 }
 
 return patterns
index 3dce2e1f8a4f88df9c9796faad7c2a1e3967c844..f81c1310d66e51446b74cafaa4fb947508223315 100644 (file)
@@ -279,6 +279,16 @@ local types = {
     ct = 'image/bmp',
     av_check = false,
   },
+  heic = {
+    type = 'image',
+    ct = 'image/heic',
+    av_check = false,
+  },
+  heif = {
+    type = 'image',
+    ct = 'image/heif',
+    av_check = false,
+  },
   dwg = {
     type = 'image',
     ct = 'image/vnd.dwg',
@@ -324,4 +334,4 @@ local types = {
   },
 }
 
-return types
\ No newline at end of file
+return types