From b8bea154eb3f5138fcac6981610caf70d522ca2c Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Sat, 7 Dec 2019 13:24:34 +0100 Subject: [PATCH] TIFF : fix saving not in the current directory useful only for tests --- src/tifformat.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/tifformat.c b/src/tifformat.c index 85f0db7e..9a9d4557 100644 --- a/src/tifformat.c +++ b/src/tifformat.c @@ -779,6 +779,9 @@ void Save_TIFF_to_memory(T_IO_Context * context, void * * buffer, unsigned long void Save_TIFF(T_IO_Context * context) { TIFF * tif; + char * filename; // filename with full path + + filename = Filepath_append_to_dir(context->File_directory, context->File_name); File_error = 1; @@ -788,12 +791,13 @@ void Save_TIFF(T_IO_Context * context) tif = TIFFOpenW(context->File_name_unicode, "w"); else #endif - tif = TIFFOpen(context->File_name, "w"); + tif = TIFFOpen(filename, "w"); if (tif != NULL) { Save_TIFF_Sub(context, tif); TIFFClose(tif); } + free(filename); } /** @} */