SFML community forums

Help => Graphics => Topic started by: Henrik.Flink on July 22, 2009, 10:00:34 pm

Title: Reload image
Post by: Henrik.Flink on July 22, 2009, 10:00:34 pm
Hi!
Right now I am building a tool to the game I'm working on. The problem is that i want that the artist to work in photoshop working on the graphics and then the game will automatic update the image which have been modified. So far it all went well, but when reloading a file that is open is photoshop i get the error that it could not load the image. So it's pretty obvious that it's because it's open in photoshop. So is there anything you could do to make it happend?
Title: Reload image
Post by: Laurent on July 22, 2009, 10:55:13 pm
I'm afraid it has nothing to do with SFML, it's usually a limitation of the OS.
Title: Reload image
Post by: Henrik.Flink on July 22, 2009, 11:48:09 pm
Quote from: "Laurent"
I'm afraid it has nothing to do with SFML, it's usually a limitation of the OS.
Yea i thought so, some body know if there is a way to avoid that, in windows.
Title: Reload image
Post by: phear- on July 23, 2009, 09:46:56 pm
loop to see if image file has been changed (updated),
copy the modified image into a new file,
open that file,
repeat.

I believe copying files is allowed under all/most OS's even though that file may already be open in an application.

or something else you can try.. open the modified image file using *only* read privileges. that may work as well.
Title: Reload image
Post by: Antidote on July 24, 2009, 12:47:29 am
Actually Photoshop locks all of the files that are currently open if the version is less than cs3 I believe. So copying won't be a valid option in this case, however for most other cases the suggested solution would work fine.