I am using the deepzoomtools.dll on my website. I allow users to upload an image, which I first resize, and then I use deepzoomtools.dll on the resized image to dynamically create a deepzoom image. This works fine in dev and was working fine on my production hosted site. All of a sudden I started getting the error below and I can't ever create a deepzoom image using the dll. I haven't changed that block of code that does the resizing or utilizes deepzoomtools.dll. My host reset my permissions on my site, but still no good. The error states that the image might be corrupted, but if I download my resized image, it shows up fine in windows explorer. These are all jpg files that I'm working with. If I upload the exact same images in my local visual studio web developer environment using the builtin web server, it works fine. The only difference I can see is I'm using IIS 6 on my hosted site and the builtin visual studio web server on my dev environment. I'm stumped and need help as this has essentially taken my site down.
Here's my code: Imports Microsoft.DeepZoomTools Imports System Imports System.Collections.Generic Imports System.Text Imports Path = System.IO.Path Imports System.IO Imports System.IO.Path Partial Class deepzoomtest Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
'create deepzoom image
Dim imagepath As String = Server.MapPath("~/images/h1.jpg")
Dim ic As New ImageCreator()
ic.TileSize = 254
ic.TileFormat = ImageFormat.Jpg
ic.ImageQuality = 1
ic.TileOverlap = 1
Dim target As String = Server.MapPath("~/output_images/") + System.IO.Path.GetFileNameWithoutExtension(imagepath)
If System.IO.File.Exists(Server.MapPath("~/output_images/") + System.IO.Path.GetFileNameWithoutExtension(imagepath) & ".dzi") = False Then
ic.Create(imagepath, System.IO.Path.ChangeExtension(target, ".dzi"))
End If
Next
End Sub
Here's the error: System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.IO.FileFormatException: The image decoder cannot decode the image. The image might be corrupted. ---> System.Runtime.InteropServices.COMException (0x88982F60): Exception from HRESULT: 0x88982F60 --- End of inner exception stack trace --- at System.Windows.Media.Imaging.BitmapDecoder.SetupDecoderFromUriOrStream(Uri uri, Stream stream, BitmapCacheOption cacheOption, Guid& clsId, Boolean& isOriginalWritable, Stream& uriStream, UnmanagedMemoryStream& unmanagedMemoryStream, SafeFileHandle& safeFilehandle) at System.Windows.Media.Imaging.BitmapDecoder.CreateFromUriOrStream(Uri baseUri, Uri uri, Stream stream, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption, RequestCachePolicy uriCachePolicy, Boolean insertInDecoderCache) at System.Windows.Media.Imaging.BitmapDecoder.Create(Uri bitmapUri, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption, RequestCachePolicy uriCachePolicy) at System.Windows.Media.Imaging.BitmapDecoder.Create(Uri bitmapUri, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption) at Microsoft.DeepZoomTools.BitmapTransformer.CreateBitmapDecoder(StreamEventArgs streamEventArgs, BitmapCreateOptions createOptions, BitmapCacheOption cacheOption) at Microsoft.DeepZoomTools.BitmapTransformer..CreateInputFrame(InputNode inputNode, Int32Rect rectNeeded) at Microsoft.DeepZoomTools.BitmapTransformer.GetPixelSize(String fileName) at Microsoft.DeepZoomTools.SparseImageCreator.Create(ICollection`1 images, String destination) at Microsoft.DeepZoomTools.ImageCreator.Create(String source, String destination)