Tiffcp.exe merge result file with result file in loop

I am creating a web application that accepts several TIFF image files and combines them together into a single tiff image file using GNUWin32 tiffcp.exe from the command line.

The way I did this was to skip the list of files and build a string of file names to merge into a single variable.

strfileList = "c: folder \ folder \ folder \ aased98-def-wsdeff-434fsdsd-dvv.tif c: folder \ folder \ folder \ aased98-def-wsdeff-434fsdsd-axs.tif c: folder \ folder \ folder \ aased98 -DEF-wsdeff-434fsdsd-dxzs.tif "

Then I just write on the command line:

tiffcp.exe strFileList results.tif

File names are guides, so the paths are quite long, and I have no control to shorten them. Therefore, if I have a bunch of these documents (more than 20 files or so), the length of the string variable exceeds the limits of the Windows command line, and the merge fails.

Since this process is just a file merge, my next thought was that instead of writing the file names to a string, we simply merged one file at a time. Therefore, the first time the loop starts, the following code type is executed:

tiffcp.exe file1.tif results.tif

The result is an ideal file of 476 thousand files. But the next iteration of the loop should combine the second file plus the contents of the first "result" of the tif file. So I do this:

tiffcp.exe results.tif file2.tiff results.tif

1K tiff ?

, tiffcp.exe, file1.tif file2.tif results.tif, ?

, ?

+3
3

ASP.NET LibTiff.Net (, , BSD). libtiff tiffcp . .

: .

+1

-a tiffcp.exe

- Python . : tiffcpp.exe -a temp.tif output.tif

.

+2

I believe your problem is caused by using results.tif both input and output. If you increment the file name (i.e. results1.tif to results2.tif, etc.), I believe that it should work.

This is a rather inefficient approach (tiff1 is copied 9 times if you have 10 files). Since you are linking to libtiff, you can take a look at the source of libtiff cp and see if it's worth inserting.

0
source

Source: https://habr.com/ru/post/1766011/


All Articles