Note that there are some explanatory texts on larger screens.

plurals
  1. POWhy does ImageResizer not handle extraction of tiff pages if the tiff has pages of differing image types?
    text
    copied!<p>I'm using imageresizer.net in a console app to pull pages out of tiff images, but when the tiff contains pages of differing image types, what imageresizer extracts does not always represent the original page. </p> <p>I am using the managed API, with this code: <code>ImageBuilder.Current.Build(sourceImagePath, destinationImagePath, new ResizeSettings("page=[whatever]"));</code></p> <p>The TIFF image contains...</p> <ul> <li>Page 1, image type "Bilevel (white is zero)", compression "Group 3", size "485kb".</li> <li>Page 2, image type "YCbCr (2,1 subsampling)", compression "JPEG (old style)", size "11MB".</li> <li>Page 3, image type "YCbCr (2,1 subsampling)", compression "JPEG (old style)", size "11MB".</li> <li>Page 4, image type "Grayscale (256 grays, black is zero)", compression "JPEG (old style)", size "4MB".</li> </ul> <p>The behaviour I am getting is...</p> <ul> <li>Extracting page 1 works correctly.</li> <li>Extracting page 2 ends up extracting an image of page 1.</li> <li>Extracting page 3 ends up extracting an image of page 1, but squashed into a band about 1cm wide on the left hand side of the image, with the remaining image black.</li> <li>Extracting page 4 works correctly.</li> </ul> <p>I have also used libtiff.net to extract the same images using <a href="http://bitmiracle.com/libtiff/help/convert-color-tiff-to-a-32-bit-system.drawing.bitmap.aspx" rel="nofollow">this method</a>, which does not exhibit the same fault.</p> <p>Edit - using this code to test with the Wic decoder:</p> <pre><code>var settings = new ResizeSettings("decoder=wic&amp;page=" + pageNumber); Config.Current.Plugins.GetOrInstall&lt;WicDecoderPlugin&gt;(); ImageBuilder.Current.Build(sourceImagePath, destImagePath, settings); </code></pre> <p>This works for page 1 &amp; 4 (no change there), but I get an 'Object reference not set to an instance of an object.' error for page 2 &amp; 3 when using the Wic decoder.</p> <p>Edit 2 - converted the bit that's failing to an MVC project to get /resizer.debug:</p> <pre><code>Image resizer diagnostic sheet 29/06/2012 4:08:14 a.m. 4 Issues detected: (Warning): To potentially see additional errors here, perform an image resize request. (Warning): You are running a hotfix version of the ImageResizer. You should upgrade to a released version with an equal or higher version number as soon as possible. Hotfix and release DLLs with the same version number are not the same - the release DLL should be used instead. Assemblies marked as hotfix versions: ImageResizer, ImageResizer.Mvc (Warning): NoCache is only for development usage, and cannot scale to production use. Add DiskCache or CloudFront for production use (Warning): Potentially incompatible ImageResizer assemblies were detected. Please make sure all ImageResizer assemblies are from the same version. Compatibility issues are possible if you mix plugins from different releases. 3.2.3 assemblies: ImageResizer, ImageResizer.Mvc 3.2.2 assemblies: ImageResizer.Plugins.Logging, ImageResizer.Plugins.Wic You are using paid bundles: Design Bundle Registered plugins: ImageResizer.Plugins.Basic.DefaultEncoder ImageResizer.Plugins.Basic.NoCache ImageResizer.Plugins.Basic.ClientCache ImageResizer.Plugins.Basic.Diagnostic ImageResizer.Plugins.Basic.SizeLimiting ImageResizer.Plugins.MvcRoutingShim.MvcRoutingShimPlugin ImageResizer.Plugins.WicDecoder.WicDecoderPlugin ImageResizer.Plugins.Logging.LoggingPlugin Configuration: &lt;resizer&gt; &lt;plugins&gt; &lt;add name="MvcRoutingShim" /&gt; &lt;add name="WicDecoder" /&gt; &lt;add name="Logging" /&gt; &lt;/plugins&gt; &lt;/resizer&gt; Accepted querystring keys: quality, format, thumbnail, maxwidth, maxheight, width, height, w, h, scale, stretch, crop, cropxunits, cropyunits, page, bgcolor, rotate, flip, sourceFlip, sFlip, sRotate, borderWidth, borderColor, paddingWidth, paddingColor, ignoreicc, frame, useresizingpipeline, cache, process, margin, anchor, dpi, mode, zoom, Accepted file extensions: bmp, gif, exif, png, tif, tiff, tff, jpg, jpeg, jpe, jif, jfif, jfi, Environment information: Running Microsoft Windows NT 6.1.7601 Service Pack 1 and CLR 4.0.30319.269 Trust level: Unrestricted OS bitness: x86 !! Warning, running as 32-bit on a 64-bit OS(AMD64). This will limit ram usage !! Executing assembly: C:\Program Files (x86)\Common Files\Microsoft Shared\DevServer\10.0\WebDev.WebServer40.exe IntegratedPipeline: False Loaded assemblies: mscorlib Assembly: 4.0.0.0 File: 4.0.30319.269 Info: 4.0.30319.269 System.Web Assembly: 4.0.0.0 File: 4.0.30319.272 Info: 4.0.30319.272 System Assembly: 4.0.0.0 File: 4.0.30319.269 Info: 4.0.30319.269 System.Core Assembly: 4.0.0.0 File: 4.0.30319.233 Info: 4.0.30319.233 System.Configuration Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1 System.Xml Assembly: 4.0.0.0 File: 4.0.30319.233 Info: 4.0.30319.233 System.Runtime.Caching Assembly: 4.0.0.0 File: 4.0.30319.237 Info: 4.0.30319.237 Microsoft.Build.Utilities.v4.0 Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1 System.Web.RegularExpressions Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1 Microsoft.Build.Framework Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1 System.Data Assembly: 4.0.0.0 File: 4.0.30319.237 Info: 4.0.30319.237 Microsoft.JScript Assembly: 10.0.0.0 File: 10.0.30319.1 Info: 10.0.30319.1 CppCodeProvider Assembly: 10.0.0.0 File: 10.0.30319.1 Info: 10.0.30319.1 System.Web.WebPages.Deployment Assembly: 1.0.0.0 File: 1.0.20105.407 System.Web.WebPages Assembly: 1.0.0.0 File: 1.0.20105.407 System.Web.Mvc Assembly: 3.0.0.0 File: 3.0.20105.0 Microsoft.Web.Infrastructure Assembly: 1.0.0.0 File: 1.0.20105.407 System.Web.WebPages.Razor Assembly: 1.0.0.0 File: 1.0.20105.407 System.Web.Razor Assembly: 1.0.0.0 File: 1.0.20105.407 App_global.asax.ijrgfwnu Assembly: 0.0.0.0 PNCC.LimDocumentBuilder.ImageResizerTest Assembly: 1.0.0.0 File: 1.0.0.0 WebDev.WebHost40 Assembly: 10.0.0.0 File: 10.0.40219.1 Info: 10.0.40219.1 System.Web.Mobile Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1 System.ServiceModel.Activation Assembly: 4.0.0.0 File: 4.0.30319.233 Info: 4.0.30319.233 System.ServiceModel Assembly: 4.0.0.0 File: 4.0.30319.233 Info: 4.0.30319.233 System.Runtime.DurableInstancing Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1 SMDiagnostics Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1 System.Xaml.Hosting Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1 System.Web.Extensions Assembly: 4.0.0.0 File: 4.0.30319.272 Info: 4.0.30319.272 Microsoft.CSharp Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1 System.Web.Services Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1 System.Drawing Assembly: 4.0.0.0 File: 4.0.30319.282 Info: 4.0.30319.282 System.EnterpriseServices Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1 System.IdentityModel Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1 System.Runtime.Serialization Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1 System.ServiceModel.Web Assembly: 4.0.0.0 File: 4.0.30319.233 Info: 4.0.30319.233 System.Activities Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1 System.ServiceModel.Activities Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1 System.WorkflowServices Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1 System.Data.DataSetExtensions Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1 System.Xml.Linq Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1 System.ComponentModel.DataAnnotations Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1 System.Web.DynamicData Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1 System.Web.ApplicationServices Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1 EntityFramework Assembly: 4.1.0.0 File: 4.1.10331.0 Info: 4.1.10331.0 ImageResizer Assembly: 3.2.3.766 File: 3.2.3.766 Info: 3-2-beta-3-temp-hotfix-jun-27-2012-9am Commit: a0f4f1e ImageResizer.Mvc Assembly: 3.2.3.766 File: 3.2.3.766 Info: 3-2-beta-3-temp-hotfix-jun-27-2012-9am Commit: a0f4f1e ImageResizer.Plugins.Logging Assembly: 3.2.2.0 File: 3.2.2.0 Info: 3-2-beta-2 Commit: 3704dd6 ImageResizer.Plugins.Wic Assembly: 3.2.2.0 File: 3.2.2.0 Info: 3-2-beta-2 Commit: 3704dd6 NLog Assembly: 2.0.0.0 System.Web.Abstractions Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1 System.Web.Helpers Assembly: 1.0.0.0 File: 1.0.20105.407 System.Web.Routing Assembly: 4.0.0.0 File: 4.0.30319.1 Info: 4.0.30319.1 </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload