Click here to Skip to main content
15,906,296 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I select multiple tiff images and save it as a single mutipage tiff image. The images are present at a remote location and takes time to load as well as to save as mutipage tiff file (clubbing say 20 images together and there are around 10000 tiff images to be processed).
I've refered to this code to save mutipage tiff: http://www.codeproject.com/KB/GDI-plus/SaveMultipageTiff.aspx

As the total images to be processed is very large, is there ant optimized way to do it.
1) to display image quickly with out delay.
2) to fasten the save
Posted

You are going across a network, you have to take into account network latency, speed and traffic and size of the files, not to mention any security that must be traversed.
 
Share this answer
 
Comments
Sandeep Mewara 28-Feb-11 3:21am    
Comment from OP:
Thanks all.

I understand across network takes time. But I wanted to know the best way to fetch the image file.
This is how i'm doing:
FileStream fs = new FileStream(Filename, FileMode.Open, FileAccess.Read)
Image.FromStream(fs);

Also, before i compressing the tiff file, the image is converted into a bitonal image, if i don do it while saving it throws an exception saying : A generic error occurred in GDI+.
Save code:
EncoderParams.Param[0] = new EncoderParameter(Encoder.Compression, (long)EncoderValue.CompressionLZW);
EncoderParams.Param[1] = new EncoderParameter(Encoder.SaveFlag, (long)EncoderValue.MultiFrame);
ImageFile.Save(location, codecInfo, EncoderParams);
If in your case data transmission time is greater than local processing time, then consider for compressed tiff file, transmit and decompress at client side. So far best compression for tiff files are LZW compression

Example for LZW compression..

http://msdn.microsoft.com/en-us/library/system.drawing.imaging.encoder.compression.aspx[^]
 
Share this answer
 
Comments
Sandeep Mewara 28-Feb-11 3:22am    
Comment from OP:
Thanks all.

I understand across network takes time. But I wanted to know the best way to fetch the image file.
This is how i'm doing:
FileStream fs = new FileStream(Filename, FileMode.Open, FileAccess.Read)
Image.FromStream(fs);

Also, before i compressing the tiff file, the image is converted into a bitonal image, if i don do it while saving it throws an exception saying : A generic error occurred in GDI+.
Save code:
EncoderParams.Param[0] = new EncoderParameter(Encoder.Compression, (long)EncoderValue.CompressionLZW);
EncoderParams.Param[1] = new EncoderParameter(Encoder.SaveFlag, (long)EncoderValue.MultiFrame);
ImageFile.Save(location, codecInfo, EncoderParams);
Using Kodak image edit control solved the problem. This control is extremely fast compared to the imaging control available for .net
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900