From cf544d5b956959270b967eab5bf14fed998c2d73 Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Wed, 27 Jul 2016 11:48:39 +0200 Subject: [PATCH] PhotoRec: recover svg file File sample https://raw.githubusercontent.com/nbeaver/mimetype-menagerie/master/media-types/image/svg%2Bxml/Animated_pendulum.svg --- src/file_txt.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/file_txt.c b/src/file_txt.c index 4b69a41c..fa1f5ef2 100644 --- a/src/file_txt.c +++ b/src/file_txt.c @@ -1384,6 +1384,15 @@ static int header_check_stl(const unsigned char *buffer, const unsigned int buff return 1; } +static int header_check_svg(const unsigned char *buffer, const unsigned int buffer_size, const unsigned int safe_header_only, const file_recovery_t *file_recovery, file_recovery_t *file_recovery_new) +{ + /* Scalable Vector Graphics */ + reset_file_recovery(file_recovery_new); + file_recovery_new->extension="svg"; + file_recovery_new->file_check=&file_check_svg; + return 1; +} + static int header_check_snz(const unsigned char *buffer, const unsigned int buffer_size, const unsigned int safe_header_only, const file_recovery_t *file_recovery, file_recovery_t *file_recovery_new) { const unsigned int buffer_size_test=(buffer_size < 512? buffer_size : 512); @@ -1437,4 +1446,5 @@ static void register_header_check_fasttxt(file_stat_t *file_stat) /* TinyTag */ register_header_check(0, "FF 09 FF FF FF FF FF FF FF FF FF FF FF FF FF FF FFFF 00", 55, &header_check_ttd, file_stat); register_header_check(0, "