Sign in to follow this  
LGAB

FreeImage doesn't save to any path

Recommended Posts

Hey, I have some code which works fine, except I can't find any way to make it save images to a specified path using FreeImage_Save(), it only works with just the file name, which causes it to end up in the application's start-up directory. Preferably I'd like it to end up in a sub-directory of the application dir such as "cache\file.jpg", or any global dir. But it just gives me an error if I use anything other than "file.jpg". FreeImage_Load() have no problems like this, it swallows any valid path. Any ideas?
void writeImage(char *name, TextureImage &T, FREE_IMAGE_FORMAT f) {
	if(!FreeImage_Save(f, T.image, name, 0)) {
		cout << "Error: FreeImage_Save:" << name << endl;
	}
}

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this