I need to do a batch image converter. I need to convert tiff files to rgb files. some of the tiff files are saved differently ( have layers ). I already have a script to convert that but I now have a problem where I will get a message saying an " Unknown data has been encountered reading layer ... " when it opens some of the tiff files. I will need to select 1 of the option before it will continue running the automated batch process with the script that I had setup.
I wish to be abler to skip or write a script to auto-select the option. Basically I just want it to keep running and not stop when there is a message when it opens the tiff file.
Related
We're using IBM MQFT for a file transfer between 2 systems and we have a requirement to move the original file to a different location on the source file system once the transfer is complete.
From the knowledge center MFT documentation what I can see is that we may need to write a user exit program to do this. I guess I would set the source_file_disposition to "leave" and use the exit program to move the file.
Is that the correct way to go about it, or there a simpler way to do this that I'm not seeing?
Regards
There are few options for you.
You can run a command or a shell script or an Ant script as part of postSrc parameter of fteCreateTransfer command. Once transfer is complete MFT will run the specified command to move the files from source to another directory.
As you mentioned a Java exit can be written to move the files after transfer completion.
You may want to refer samples Java exit and Ant Script here.
I'm creating a program which downloads a file from an FTP server. I want to display the progress of how much bytes the user has downloaded. I have tried searching for it but I couldn't find anything. First , my plan was to get the file size using fstream but then I realized that I can't share 2 processes at the same time.
I assume you're using FtpGetFile(..) to download the file from the FTP server. This is the simple way of downloading a file which gives you no information about how many bytes are already downloaded and you have very little control how the function behaves (e.g. cancelling of a download upon user request?). For quick test it is very helpful, though.
In order to monitor the download progress do the following:
Determine size of remote file using FtpFindFirstFile.
Open remote file using FtpOpenFile.
Create local file using CreateFile.
Read some bytes from remote file using InternetReadFile.
Evaluate return value and error code of InternetReadFile the detect errors and if transmittion is complete.
Write these bytes to local file using WriteFile.
Calculate/Update your progress information.
Go back to step 4 if file is not downloaded entirely and there is no error.
Close local file using CloseHandle.
Close remote file using InternetCloseHandle.
If you need more help I can offer some code doing this...
I am using a program which outputs TIFF file. However when I try to open that tiff file from paint or picture viewer or any other image viewer program, I get the responce that the tiff file has invalid format.
I want to dig deeper and see why I'm getting the invalid format error. How can I check that. Is there any C or C++ code that reads a tiff file and performs error checking for the format. What is the easiest way to check this.
Take a look at libtiff to see about opening up TIFF files and viewing errors.
I have writen a script that reads at real time a log file. The problem I have got is that the location of that logfile changes every midnight, same filename diferent folder.
I can regenerate the file location path but I don't know how to start/stop the script to reprocess the log file? Right now I am doing it by hand.
My suggestion would be
(a) If it's a linux box, why not run a "cron" job (which will stop and start the script)
(b) Alternatively, in your code, detect when the file can no longer be read, then switch folders
Im using Magick++ Library with Qt
Im using the following code to read and write an image:
Image image;
image.read(qPrintable(f.absoluteFilePath()));
image.addNoise(GaussianNoise);
image.magick("png");
image.write("image_name");
Where f.absoluteFilePath is the absolute path for my image
Example: /Users/user/Desktop/test/P1030673.jpg
After the completion of the code, I cannot locate the image named 'image_name'.
I looked into the folder of the first image '/Users/macmini/Desktop/test/' and its not there
I tried to search the image, but it seems is not in my computer.
Where do I go wrong?
How can I save the image in my computer?
is there any way to specify the path that I want the image to be saved?
Thank you
You should find the file saved in the current working directory. If you want to save it elsewhere give an absolute path.
For everyone who might have tha same problem:
Imagemagick will save the images inside the .app bundle
You will not be able to find the image files unless you specify a path inside the read() function
I noticed the following by checking the size of my .app file
It was increased everytime I was trying to save images.