In any software that's written, never should a file be tried to open based on extension alone. Because that would mean that renaming an executable to an .jpg and having someone open it in said software, executes the file.
So Photoshop already does the actual checking of a file by its contents. What might be happening is that it already rejects the file based on extension however. But the second part is definitely already there.
donal23 t1_ixtqwfc wrote
Reply to comment by ScandInBei in ELI5: In recent years, new formats like webp and jfif have started popping up. However, if I rename them to gif or jpeg, they still work. How can it be that renaming the extension doesn't ruin the image format? Why do they even exist then? by Luthemplaer
In any software that's written, never should a file be tried to open based on extension alone. Because that would mean that renaming an executable to an .jpg and having someone open it in said software, executes the file.
So Photoshop already does the actual checking of a file by its contents. What might be happening is that it already rejects the file based on extension however. But the second part is definitely already there.