testdisk icon indicating copy to clipboard operation
testdisk copied to clipboard

Feature request: recognize newer image file formats

Open litoj opened this issue 7 months ago • 5 comments

Hello, since nowadays there is a rise of different compression standards for image files, it would be very useful, if recovering image files other than basic jpg was possible.

This is just a list of formats I have found missing:

  • .avif (AV1 Image Format)
  • .heic / .heif (Apple High Efficiency Image Format/Codec)
  • .jxl (JPEG XL)
  • .dng (common raw file standard)

litoj avatar May 18 '25 10:05 litoj

Have you check that PhotoRec was really unable to recover them ? You can try fidentify and/or https://www.cgsecurity.org/photorec/ Please provide some file samples of each type not detected by PhotoRec.

cgsecurity avatar May 18 '25 12:05 cgsecurity

It is true my selection was based just on formats not described in the file options selection.

After looking through some of the found files, I noticed .avif/.heif is detected and put under the .mov extension.

litoj avatar May 18 '25 13:05 litoj

Here is an example .jxl file:

Image

Note: I had to upload it as .jpg to be accepted by github

fidentify consideres this file type unknown

litoj avatar May 18 '25 14:05 litoj

JPEG XL codestream: 0xff 0x0a I don't think it's possible to recover jxl without a lot of false positive

cgsecurity avatar May 18 '25 15:05 cgsecurity

I think I found somewhat of a workaround.

I ran photorec with the photorec.sig configured for .jxl as:

jxl 0 0x0000000c4a584c200d0a870a
jxl 0 0xff0a

and then created the following script to continually check all newly found image files and ensure that the files are actually readable as images:

filter.sh

then with ffmpeg -i <image>.jxl -c copy <outfile>.jxl I was able to trim down all the valid files to their original size.

litoj avatar May 18 '25 23:05 litoj