I was pretty happy with my scanning and sorting script.

I shoot with a Nikon camera, so many of my images are NEF/RAW images.

Unfortunately, the exifr method JPEG.new doesn’t like NEF images, because they aren’t JPEGS.

Maybe they are TIFFs? Let’s give it a try!

if file.end_with?(".NEF")
     dateShot = EXIFR::TIFF.new("#{file}").date_time
     puts "it's a NEF"
     dateShot = EXIFR::JPEG.new("#{file}").date_time

so we replace the one line that extracts date with this “NEF checker” and it works!