Skip to main content
Clarified title and first line of question, just reading them the question seemed to apply to cases like "check if files are images, or something else" (e.g. how to find all the images on my camera but ignore other files) which it is not but you had to read the whole question in detail to find out.
Source Link

Script to determine if apparent Image files are Imagesreal Image files

I would like to create a shell script that will check to make sure all files in a directory that appear superficially to be image files (e.g. have typical image file extensions like .jpg, .bmp etc.) are actually image files.

We recently had an issue where a hacker was able to generate a file in a directory and mask it as a .jpg file. I would like to create a shell script to check all files in the directory to make sure they are real jpg, gif or png files.

Script to determine if files are Images

I would like to create a shell script that will check to make sure all files in a directory are image files.

We recently had an issue where a hacker was able to generate a file in a directory and mask it as a .jpg file. I would like to create a shell script to check all files in the directory to make sure they are real jpg, gif or png files.

Script to determine if apparent Image files are real Image files

I would like to create a shell script that will check to make sure all files in a directory that appear superficially to be image files (e.g. have typical image file extensions like .jpg, .bmp etc.) are actually image files.

We recently had an issue where a hacker was able to generate a file in a directory and mask it as a .jpg file. I would like to create a shell script to check all files in the directory to make sure they are real jpg, gif or png files.

edited tags
Link
Gilles 'SO- stop being evil'
  • 866.1k
  • 205
  • 1.8k
  • 2.3k
Source Link
brentwpeterson
  • 3.9k
  • 5
  • 20
  • 20

Script to determine if files are Images

I would like to create a shell script that will check to make sure all files in a directory are image files.

We recently had an issue where a hacker was able to generate a file in a directory and mask it as a .jpg file. I would like to create a shell script to check all files in the directory to make sure they are real jpg, gif or png files.