I wrote a bash script to convert a few thousand jpgs to avif with imagemagick. Like a stupid, I wrote the script to immediately delete the original jpg after successful conversion.
It turns out the version of imagemagick in debian bookworm (6.9.11) struggles to convert large high-res jpgs (10mb+) to avif. It shows no error or warning but spits out corrupt avifs. By the time I discovered this, all the large images were gone.
I have google photos but I hate the interface and didn't want to download a ton of files and shift through them to find the right images. After panicking a bit I googled around and found photorec. Installed it and ran the recovery. It took over 11 hours to complete and got back a shit ton of data, including all the images! It's crazy how much stuff was in the drive. I found all sorts of images and documents from as far back as 2015!
My lessons from this ordeal are to write better scripts, stick to webp for now (slightly bigger but "safer"), wipe the drive's free space, and offload encrypted backups to s3 storage.
SOCIAL SHARE CARD GENERATOR