cgsecurity / testdisk

TestDisk & PhotoRec
https://www.cgsecurity.org/
GNU General Public License v2.0
1.58k stars 195 forks source link

Fixes #17 #21

Closed amosonn closed 4 years ago

amosonn commented 7 years ago

Fixes #17: Still scatters thumbnails, but other than that it works.

cgsecurity commented 6 years ago

In file_finish_aux(), it will be best to avoid calling set_date(), file_rename() and creating directories for files that are deleted. In jpg_check_structure() from src/file_jpg.c, avoid to create a jpg thumb file.

amosonn commented 6 years ago

I haven't had much time to look at it, will try this week.

The first few seem possible. The reason I didn't implement the latter, is that the settings struct is not passed to that context, which makes it hard to determine whether a thumb needs or does not need to be created. I thought about adding it as a field to another struct passed there, but it seemed too ugly to me. If you say that's fine, I can go ahead and do it; otherwise, this requires some more refactoring (passing the settings struct to all file formats, which is some).