From: Vsevolod Stakhov Date: Fri, 16 May 2025 10:43:39 +0000 (+0100) Subject: [Minor] Add HEIC files patterns X-Git-Tag: 3.12.0~21^2~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ad27730d47ce7b51f242d39d836ce0291c36f97d;p=thirdparty%2Frspamd.git [Minor] Add HEIC files patterns --- diff --git a/lualib/lua_magic/patterns.lua b/lualib/lua_magic/patterns.lua index 971ddd95fa..4b19c9fec5 100644 --- a/lualib/lua_magic/patterns.lua +++ b/lualib/lua_magic/patterns.lua @@ -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 diff --git a/lualib/lua_magic/types.lua b/lualib/lua_magic/types.lua index 3dce2e1f8a..f81c1310d6 100644 --- a/lualib/lua_magic/types.lua +++ b/lualib/lua_magic/types.lua @@ -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