My program let the user select an image (examine) and load it.
Most of the images load and display fine but some of them throw an exception
(SFML.LoadingFailedException: 'Failed to load texture from file C:\Users\ ... \t_bg.jpg')
in the following line:
Image img
= new Image
(path
);or
Texture texture
= new Texture
(path
);At first i thought it could be the path that is wrong so i tested opening a file that throw the exception in the search bar of a windows folder and it opened successfully.
To confirm that the path is not wrong i tried creating an image but with System.Drawing and it didn't gave me an exception.
Next i thought maybe it has to do with the security so i placed this in my code:
[FileIOPermissionAttribute(SecurityAction.PermitOnly,
ViewAndModify = @"C:\Users\ ... \(folder that cointains t_bg.jpg file)\")]
But it didnt work either.
What could be the problem?