Viewing a single comment thread. View all comments

ScandInBei t1_ixtoaoo wrote

The sw has to explicitly decide (and a programmer implement it) to check the file if it's a renamed file.

The simpler way is to try to open the file and decode it according to the file format and if it fails show an error message.

So it Photoshop could do it, but someone has to program it and it would cost money to do it.

−4

donal23 t1_ixtqwfc wrote

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.

−7

ScandInBei t1_ixtvd1j wrote

> Because that would mean that renaming an executable to an .jpg and having someone open it in said software, executes the file.

What? That's just wrong. That's not at all how software works.

12

JaggedMetalOs t1_ixtyswp wrote

> Because that would mean that renaming an executable to an .jpg and having someone open it in said software, executes the file.

This couldn't happen, an exe file can't just run when loaded by a piece of software it would have to be explicitly interpreted as an executable program which Windows does to files named .exe but which some random image viewer wouldn't if you renamed it to jpeg.

Instead if would just check the file contents against the image formats it knows, and then give up when it doesn't find a match.

3