• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 194
  • Last Modified:

ASP.net - Large Images NOT Showing?

OK, so I have this code to convert TIFF Images to PNG, but when I go to display VERY Large (FULL Page) Documents they DO NOT display???

        Dim path As String = Server.MapPath("~/Images/" & TextBox1.Text & ".tif")
        Dim image As System.Drawing.Image = System.Drawing.Image.FromFile(path)

        Using memoryStream As New MemoryStream()
            image.Save(memoryStream, ImageFormat.Png)
            Dim bytes As [Byte]() = New [Byte](memoryStream.Length - 1) {}
            memoryStream.Position = 0
            memoryStream.Read(bytes, 0, CInt(bytes.Length))
            Dim base64String As String = Convert.ToBase64String(bytes, 0, bytes.Length)
            DocumentImage.Src = "data:image/png;base64," & base64String
        End Using

Is there some kind of PNG Limit or String Limit on the "base64String"?

Thanks,
Mark
0
smithmrk
Asked:
smithmrk
  • 3
  • 2
1 Solution
 
Kamal KhaleefaInformation Security SpecialistCommented:
try to increase the maxRequestLength in web.config to higher value to be able to execute your command

for example

      <httpRuntime useFullyQualifiedRedirectUrl="true" maxRequestLength="15360" requestLengthDiskThreshold="15360" executionTimeout="400"/>
   

this directive is inside <system.web>
0
 
smithmrkAuthor Commented:
OK, I added that line, but it still doesn't display my image.
I get a Red X

Mark
0
 
Kamal KhaleefaInformation Security SpecialistCommented:
hi

check this link

http://bytes.com/topic/c-sharp/answers/267798-convert-tiff-images-gif-jpeg

also try this

System.Drawing.
    Bitmap.FromFile("your image.tif")
              .Save("your image.png", System.Drawing.Imaging.ImageFormat.Png);
0
 
smithmrkAuthor Commented:
OK, Yes I can convert it and save it...but I don't want to have to clean up those files once done.
I was hoping I could take the TIF Image and convert it in memory use it then just clear the memory rather than have to clean up PNG Files on the server.

Mark
0
 
smithmrkAuthor Commented:
OK, I gave up...I'm going to save the image display it and when I'm done remove it.

Thanks,
Mark
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now