Problem with Tiff images

Hello


We got a complained from a client using our system. It seems the Viewer (through the Annotations DLL) can not open a TIFF image because of an error that comes up. Here below is that stack trace. What pops out is: “Index was outside the bounds of the array” and “Image export failed”.

We have noticed that some TIFF images seem to be a problem. Do you know what the issue might be? I can unfortunately not share the document with you as this one is confidential. All other documents with the client were fine oddly enough.

Best regards
Robert Badi

[IndexOutOfRangeException: Index was outside the bounds of the array.]<o:p></o:p>

<o:p></o:p>


…() +1005<o:p></o:p>

<o:p></o:p>


…(StreamContainer , Rectangle ) +259<o:p></o:p>

.[1].(Rectangle ) +174<o:p></o:p>

..LoadRawData(Rectangle , RawDataSettings , IPartialRawDataLoader ) +85<o:p></o:p>

..LoadPartialPixels(Rectangle , IPartialPixelLoader ) +164<o:p></o:p>

Aspose.Imaging…(Rectangle ) +53<o:p></o:p>

.<o:p></o:p>


.(Rectangle ,  , , Int32 , Int32 ) +1238<o:p></o:p>

.<o:p></o:p>


.(Rectangle ,  ) +46<o:p></o:p>

Aspose.Imaging.RasterImage.LoadPixelsInternal(Rectangle rectangle, IPartialPixelLoader pixelLoader) +87<o:p></o:p>

Aspose.Imaging.RasterImage.(Rectangle , Color[] , Boolean , IPartialPixelLoader ) +95<o:p></o:p>

Aspose.Imaging.RasterImage.(Rectangle , Boolean , IPartialPixelLoader ) +681<o:p></o:p>

Aspose.Imaging.RasterImage.LoadPixels(Rectangle rectangle) +189<o:p></o:p>

…(Rectangle ) +812<o:p></o:p>

.<o:p></o:p>


.(Rectangle ,  , , Int32 , Int32 ) +1238<o:p></o:p>

.<o:p></o:p>


.(Rectangle ,  ) +46<o:p></o:p>

.ƒ.(TiffStream , Rectangle , IPartialPixelLoader ) +224<o:p></o:p>

..LoadPartialPixels(Rectangle , IPartialPixelLoader ) +158<o:p></o:p>

Aspose.Imaging…(Rectangle ) +53<o:p></o:p>

.<o:p></o:p>


.(Rectangle ,  , , Int32 , Int32 ) +1238<o:p></o:p>

.<o:p></o:p>


.(Rectangle ,  ) +46<o:p></o:p>

Aspose.Imaging.RasterImage.LoadPixelsInternal(Rectangle rectangle, IPartialPixelLoader pixelLoader) +87<o:p></o:p>

Aspose.Imaging.RasterImage.(Rectangle , Color[] , Boolean , IPartialPixelLoader ) +95<o:p></o:p>

Aspose.Imaging.RasterImage.(Rectangle , Boolean , IPartialPixelLoader ) +681<o:p></o:p>

Aspose.Imaging.RasterImage.LoadPartialPixels(Rectangle desiredRectangle, IPartialPixelLoader pixelLoader) +113<o:p></o:p>

Aspose.Imaging.FileFormats.Jpeg.JpegImage.(RasterImage , Stream , JFIFData , JpegExifData , JpegOptions ) +764<o:p></o:p>

.‚.Export(Image , Stream , ImageOptionsBase ) +105<o:p></o:p>

Aspose.Imaging.Image.Save(Stream stream, ImageOptionsBase optionsBase) +241<o:p></o:p>

[ImageSaveException: Image export failed.]<o:p></o:p>

Aspose.Imaging.Image.Save(Stream stream, ImageOptionsBase optionsBase) +460<o:p></o:p>


??.Perform() +556<o:p></o:p>

Groupdocs.Engine.Documents.Document`2.SaveAs(String path, FileType type, SaverOptions options) +501<o:p></o:p>

Groupdocs.Engine.Documents.TiffDocument.SaveAs(String path, FileType type, SaverOptions options) +40<o:p></o:p>

Groupdocs.Engine.Viewing.ViewingDocumentFactory.CreatePdf(String filePath, IFileStorage storage, String outputPath, IFileStorage tempStorage, String modificationTimeString) +534<o:p></o:p>

Groupdocs.Engine.Viewing.ViewingService.OpenDocument(String filePath, Boolean usePdf, Boolean splitPdf, Boolean checkFileDateTime, Boolean isLicensed) +395<o:p></o:p>

Groupdocs.Engine.Viewing.ViewingService.OpenDocument(Boolean usePdf, Boolean splitPdf, Boolean checkFileDateTime, Boolean isLicensed) +45<o:p></o:p>

Groupdocs.Engine.Viewing.
.1 +61<o:p></o:p>

Groupdocs.Engine.Viewing.ViewingService.[1](String [1], ViewingOptions<o:p></o:p>


, String ) +2343<o:p></o:p>

Groupdocs.Engine.Viewing.ViewingService.GeneratePageImages(String filePath, ViewingOptions options, String outputFolder) +465<o:p></o:p>

Groupdocs.Web.UI.Handlers.ViewDocumentHandler.ProcessRequest(HttpContext context) +3096<o:p></o:p>

System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +913<o:p></o:p>

System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +165<o:p></o:p>


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.34249

Hi Robert,


Thank you for asking. If I understand you correctly you use GroupDocs.Annotation library to view the document - is it correct? If yes then please share with me the source code example of the web page with annotation that I can check the Annotation widget options.

Thank you.

Hello Pavel


Thank you for your response. You understood correctly. Here is a zip file with the page and it’s codebehind. The Viewer.ClientCode() options are in the codebehind.

Best regards
Robert Badi

Hi Robert,


Thank you for the code example. Please try to set the stream position to 0 before using it in the Viewer widget. For example:
_fs.Position = 0;

Unfortunately with out the document I can’t reproduce the issue. Also from your code I can’t see Annotation code so wonder does you really need the Annotation library, if no you can migrate to the latest Viewer and the issue should be resolved in it.

Best regards.

Hi Pavel


Thank you for your suggestion. I have changed the code on my end as you suggest and we will try the changed version with our client at an opportune moment.

As to you last question we are using the Groupdocs.Viewer in this case that is included in the Annotations library and therefore reference that.

Best regards
Robert Badi

Hi Robert,


Thank you for the notification. Yes, I understand how you use the Viewer, but maybe it will be better to use the Viewer library it self instead of using it from the Annotation library.

Best regards.