deepzoomtools.dll throwing error with some images on website, but not all
I'm using deepzoomtools.dll on my website to dynamically create deepzoom images when a user uploads an image. It seemed like it was working fine, but I've noticed recently that some images are throwing an error and not creating the image and I'm not sure why. The images I'm using are the jpgs in the sample pictures folder found in the my documents folder in Windows 7 (the default images). I haven't done anything to the images themselves and they display fine. Before I upload the photo to my site, I resize the picture. Then I use deepzoomtools.dll to dynamically create a deepzoom image from the resized image. It has worked fine with most of the images I've tried, but these sample pictures fail every time with the above errors on my site. When I try the same images on my local dev machine using visual studio 2008 and the builtin web server (not IIS), the deepzoom images are created correctly. Any idea what is going on or how I can resolve it? The only difference I can see is that I'm using a shared hosting environment that uses IIS 6. The resized uploaded images show up fine if I view them in the browser, so I don't think it is corrupted... I've seen two different errors with the same set of jpg files.
Here is my code:
Dim imagepath As String = thePath
Dim ic As New ImageCreator()
ic.TileSize = 254
ic.TileFormat = ImageFormat.Jpg
ic.ImageQuality = 1
ic.TileOverlap = 1
Dim target As String = System.IO.Path.ChangeExtension(imagepath, "dzi").Replace("UploadedImages\", "zoom\")
If System.IO.File.Exists(target) = False Then
ic.Create(imagepath, target)
End If
Here's the errors:
System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Runtime.InteropServices.COMException (0x8000FFFF): Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
at MS.Win32.UnsafeNativeMethods.IInternetSecurityManager.MapUrlToZone(String pwszUrl, Int32& pdwZone, Int32 dwFlags)
at MS.Internal.PresentationCore.SecurityHelper.MapUrlToZoneWrapper(Uri uri)
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)
and the other one is:
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)
Here is my code:
Dim imagepath As String = thePath
Dim ic As New ImageCreator()
ic.TileSize = 254
ic.TileFormat = ImageFormat.Jpg
ic.ImageQuality = 1
ic.TileOverlap = 1
Dim target As String = System.IO.Path.ChangeExtension(imagepath, "dzi").Replace("UploadedImages\", "zoom\")
If System.IO.File.Exists(target) = False Then
ic.Create(imagepath, target)
End If
Here's the errors:
System.Web.HttpUnhandledException: Exception of type 'System.Web.HttpUnhandledException' was thrown. ---> System.Runtime.InteropServices.COMException (0x8000FFFF): Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))
at MS.Win32.UnsafeNativeMethods.IInternetSecurityManager.MapUrlToZone(String pwszUrl, Int32& pdwZone, Int32 dwFlags)
at MS.Internal.PresentationCore.SecurityHelper.MapUrlToZoneWrapper(Uri uri)
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)
and the other one is:
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)
1
person has this question
I have this question, too!
Tell me when someone answers.
The more people who ask this question, the more it gets noticed.
The more people who ask this question, the more it gets noticed.
-
Inappropriate?Is this a beta build of Windows 7, or the final release build? This looks like something I've run into with pre-release Windows 7 builds.
-
I'm guessing it's not Win7, since he says it's happening only on the hosted site (not locally). The hosting company is probably running Server 2K3, since it's IIS6. Tgakk, can you tell us the full specs of the hosting company's machines? -
Inappropriate?Thank you for the replies and sorry for the delay in responding. On my dev machine, I'm using Windows 7 RC (64 bit). I'm using the builtin webserver that Visual Studio 2008 has, not IIS7 locally. It works great on my dev machine. My host is using Server 2008 (64 bit), so they have IIS7, but my site is running in IIS 6 classic mode as I was having some problems with some other third party dlls not running correctly in IIS7 integrated pipeline mode.
I had the hosting provider reset permissions on my site and it seems to have gotten rid of the first error, but I get the second error with every image I try to make a dzi image now. This was working fine on my host before and it just seems like in the last few days it started having problems although I haven't touched the core code that makes the dzi image. I tried making sure that the files weren't being uploaded as read only, tried creating the dzi image into the same directory that I'm uploading the original image to, made sure I had a mime type set for dzi images, made sure I could view the image I was trying to make the dzi image from, made sure paths to the original image and target were correct, asked my host if they'd made any sort of server or configuration changes recently etc. I have a few more things I'm going to try and am in the process of seeing if my host can move me to a different server to rule out anything there.
If you have any other ideas, I'd really appreciate hearing them. -
Inappropriate?So this is weird. I'm trying to upload different jpg photos to see if deepzoom images are created from any of them. Some pictures are creating deepzoom images successfully and some aren't. For example, the pictures found in C:\users\Public\Pictures\Sample Pictures on Windows 7 RC fail every time on my host with the second error I listed above. However, most of the pictures I've tried from my camera seem to work ok. I'm going to try more photos from my camera and see if I can figure out if there is any rhyme or reason to which photos it likes and which ones it doesn't. With the pictures in the Sample Pictures folder, in my dev environment, the deepzoom images create fine, so I'm still not clear why on my host I can create deepzoom images from some jpg images I upload and why I can't create deepzoom images from others. If it was a problem with deepzoomtools not being able to handle specific sizes or dpi or whatever with various jpg images, I'd reason that those same images that were failing in my hosted environment would fail locally in my dev environment too but they aren't. Any picture I upload uses the same code to create the deepzoom image (same code I listed in my first post).
Any thoughts? -
Inappropriate?Any thoughts on this guys? I'm a little nervous about using this if I get the above error on some images I try to upload and not others.
I’m frustrated
-
Inappropriate?Sorry it took me a while to get back to you.
This looks like a bug I've seen in the Windows Imaging Component - it's fixed in Windows 7, but not yet in Server 2008.
There should be a patch coming out for Server 2008 soon, but it's not available yet. I know this is annoying, because I've run up against it myself a bunch! -
Inappropriate?Thanks for the reply. So is there any eta on the patch? Will it be available via windows update or is it just a hotfix that needs to be downloaded from Microsoft Connect? I'm using shared hosting, but I'd like to be able to provide them with information on how to patch it (if they will). I'm sure you are extremely busy, but would you mind posting back her when the patch is released so that I know (and posterity) that this patch resolves the issue?
Also, what scenarios cause this error? Like I said, it seems to work with 99% of all of the pictures I've tried to upload and so far just seems to be failing on those sample images for some reason. I just want to determine if it is something that will affect me frequently, or if I can say that certain types of images might cause it to fail more than others (maybe it is a certain resolution, dpi, or something else). Or is it completely random?
Thanks again for the reply!
Lance -
Inappropriate?Those are all things that I wish I knew the answer to!
The error that I think this is happens when you try to convert an image that has a lot of red and orange in it - the Chrysanthemum sample photo in Win7 is the one that will always do it for me. I don't know how much red/orange is too much, though! -
Inappropriate?Interesting... That one does it for me too. But I get the same thing on the Koala sample photo in Win7 as well. But I've tried about 60 different photos from my camera and some from the web and they work fine.
So this isn't an issue that you are aware of in Win2k3 server? Maybe I'll see if my host has that option available to see if it resolves it until the patch comes out.
Anxiously awaiting the patch and thanks for the assistance,
Lance -
Inappropriate?Based on your response above about it being an issue with Server 2008, I asked my shared hosting company if there was the possibility that I could move to Server 2003. They said I was already on Server 2003 and IIS 6. Can you confirm if this issue with WIC is also on Server 2003? If it isn't a confirmed issue on Server 2003, is there anything we can do to investigate further to find a solution?
-
Inappropriate?Well .... I've had same problem with my solution - seems that the whole thing can be narrowed down to the call to the create method - somehow I found out that it only failed on the first time a webapplication calls that method - so with a try/catch around this it actually solved my problem ( remember to call the Create method again in the catch ) - I know that this is not a need solution - but since it seems to be related to the DeepZoom implementation and LiveLab hasn't released any update - this might help U guys as well for now...
-
Huh, I'll give it a try and see if it fixes it for me. I put a try/catch around it originally, but didn't try to create the dzi again in the catch, so that's a good idea. I'll report back whether or not that fixed it for me. Thanks for the suggestion! -
Just FYI, I finally tried doing the Create method again when it initially erred out and it still failed in my Catch. Too bad. -
Inappropriate?Hi, tgakk,
A beta version of the patch is out, but only for Vista or Windows Server 2008.
http://www.microsoft.com/downloads/de...
I'm trying to find out if this will be available on Server 2003 as well, since this is the same issue. -
Inappropriate?Apparently, the patch won't be available for Server 2003. Sorry!
-
Inappropriate?Melinda, thanks for the reply. That's too bad it won't be available for 2003. Why did they make that decision? 2003 isn't in extended support yet I don't think. My site is currently being hosted on 2003. Seems like with normal photos I've tried (from various consumer digital cameras) I haven't had the problem. It is only those sample photos that cause the problem.
Loading Profile...



EMPLOYEE