-
Notifications
You must be signed in to change notification settings - Fork 456
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
opj_compress and opj_decompress : get_next_file method uses hard-coded unix path separator #630
Comments
I'd rather see the following: #ifdef _WIN32
# define OPJ_PATH_SEPARATOR "\\"
#else
# define OPJ_PATH_SEPARATOR "/"
#endif Then: sprintf(infilename,"%s" OPJ_PATH_SEPARATOR "%s",img_fol->imgdirpath,image_filename); And sprintf(outfilename,"%s" OPJ_PATH_SEPARATOR "%s.%s",img_fol->imgdirpath,temp_ofname,img_fol->out_format); In any case, doesn't Windows support forward slash separators ? |
Yes, it does. Even old versions of MSDOS support "/". |
@mayeut I agree. And yes, the code works fine on windows, but I find the path names are confusing when debugging under windows: a mix of forward and backward slashes. Also, this fix is already partially implemented in opj_decompress; just need to add it in a few more places. A 10 minute fix. |
In these lines:
sprintf(infilename,"%s/%s",img_fol->imgdirpath,image_filename);
and
sprintf(outfilename,"%s/%s.%s",img_fol->imgdirpath,temp_ofname,img_fol->out_format);
use the following code to replace hard coded separator:
#ifdef _WIN32
const char* path_separator = "\\";
#else
const char* path_separator = "/";
#endif
The text was updated successfully, but these errors were encountered: