iron-software / IronSoftware.System.Drawing

An open-source System.Drawing.Common replacement for .NET 5 and above on all platforms. Bringing together System.Drawing, Maui, and ImageSharp's Bitmap, Image, Font, and Shape types via an agnostic free NuGet package.
Other
114 stars 18 forks source link

Add support for rendering partially valid TIFF #45

Closed regan-ironsoftware closed 1 year ago

regan-ironsoftware commented 1 year ago

As a developer, I want to be able to render partially valid TIFF files when rendering images to PDF. This works on System.Drawing but throws “ImageFormatException” when using IronSoftware.Drawing.

// ERROR AnyBitmap anyBitmap = new AnyBitmap("partial_valid.tif"); var pdf = ImageToPdfConverter.ImageToPdf(anyBitmap, IronPdf.Imaging.ImageBehavior.FitToPageAndMaintainAspectRatio); // ERROR var pdf = ImageToPdfConverter.ImageToPdf("partial_valid.tif", IronPdf.Imaging.ImageBehavior.FitToPageAndMaintainAspectRatio); // WORKAROUND System.Drawing.Bitmap bytes = new System.Drawing.Bitmap("partial_valid.tif"); var pdf = ImageToPdfConverter.ImageToPdf(bytes, IronPdf.Imaging.ImageBehavior.FitToPageAndMaintainAspectRatio);

sample.zip