Note that there are some explanatory texts on larger screens.

plurals
  1. POImageResizer/System.Drawing and CMYK JPEGs
    primarykey
    data
    text
    <p>I'm doing some simple image resizing and rotation in an ASP.NET MVC 4 project, using the ImageResizer library. The problem is that when I use it to process 32-bpp CMYK JPEG files, it fails with an ArgumentException, but only on my (Windows Server 2008 R2) server - it works fine on my (Windows Vista) laptop.</p> <p>The JPEG files in question aren't too large (700x500) or otherwise non-standard - all web browsers and Paint can open them just fine, even on the server in question itself. The JPEGs have been generated using ImageMagick, and everything works fine if I ask ImageMagick to use an RGB colorspace (<code>-colorspace sRGB</code>.)</p> <p>The weird thing is, just resizing the image works fine in all cases, but it fails if I try to resize and rotate the image on the server.</p> <p>It looks like some lower-level Win32 or GDI+ function call is what's failing here - here's the relevant part of the stack trace:</p> <pre><code>[ArgumentException: Parameter is not valid.] System.Drawing.Graphics.CheckErrorStatus(Int32 status) +1621285 System.Drawing.Graphics.DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr, DrawImageAbort callback, Int32 callbackData) +727 System.Drawing.Graphics.DrawImage(Image image, PointF[] destPoints, RectangleF srcRect, GraphicsUnit srcUnit, ImageAttributes imageAttr) +73 ImageResizer.ImageBuilder.RenderImage(ImageState s) +763 ImageResizer.ImageBuilder.Render(ImageState s) +174 ImageResizer.ImageBuilder.Process(ImageState s) +105 ImageResizer.ImageBuilder.buildToBitmap(Bitmap source, ResizeSettings settings, Boolean transparencySupported) +276 ImageResizer.ImageBuilder.buildToStream(Bitmap source, Stream dest, ResizeSettings settings) +149 ImageResizer.ImageBuilder.BuildJob(ImageJob job) +940 ImageResizer.ImageBuilder.Build(ImageJob job) +223 </code></pre> <p>Any ideas?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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