Atalasoft
Welcome to Atalasoft Community Sign in | Join | Help
in

Problem with certain tiff images

Last post 31 Mar 2008, 8:24 AM by Susan. 0 replies.
Sort Posts: Previous Next
  •  31 Mar 2008, 8:24 AM 13573

    Problem with certain tiff images

    ok... so we wrote a web application that takes an image, create a temporary image from that, display in in the webbrowser. then you create a new image, append a page from the old image to the new image, and allow you to save it.

    The basic code to add pages to an attachment looks as follows:

    TiffFile file2 = new TiffFile();

    using (Stream fs1 = new FileStream(Page.MapPath("ImageCache/ini_" + s_uniqueSessionID + "_tn.tif"), FileMode.Open, FileAccess.Read, FileShare.Read)) //read original file

    {

    file1.Read(fs1);

    foreach (TiffDirectory td in file1.Images)

    {

     file2.Images.Add(td);

    }

    file2.Save(Page.MapPath(attLoc+ "_")); //create a temporary file

    File.Delete(Page.MapPath(attLoc)); //delete the old image

    File.Copy(Page.MapPath(attLoc + "_"), Page.MapPath(attLoc),true); //copy new image over old image

     

    For some reason, this code works on certain tiff files, and on other tiff files it goes haywire on the attachments, creating a blank thumbnail and image. if i open the image in a regular window, i can see the thumbnail, but the big image is black.

    Can it be the encoding on that tiff file? any idea how to fix it? 

     

View as RSS news feed in XML