user772436
user772436

Reputation: 51

How to turn off ImageResizer file size limit in Orchard?

I am using the MediaProcessing Module in Orchard V1.7. The source images are large TIFF files (typically up to 4928 x 3264 pixels). I have two filters set up on the image profile:

  1. Resize to 200 x 200
  2. Format the image to Jpg

When I display the page I get an exception logged

2013-08-12 16:30:55,982 [22] Orchard.MediaProcessing.Shapes.MediaShapes - An error occured while rendering shape Lightbox for image /OrchardLocal/Media/Default/Stamps%20of%20Australia/ClaytonTremlett244.tif
ImageResizer.Plugins.Basic.SizeLimits+SizeLimitException (0x80004005): 
The dimensions of the output image (2668x3364) exceed the maximum permitted dimensions of 3200x3200.

ImageResizer documentation states that the default maximum file size for output is 3200 x 3200, but I am requesting a size of 200 x 200. I have logged this as an issue (1642).

My question is, does anyone know how to turn off the maximum file size limit check for ImageResizer when it is used through the ImageResizer managed API, as Orchard has chosen to do?

Upvotes: 1

Views: 972

Answers (3)

AmiNadimi
AmiNadimi

Reputation: 5715

In your web.config/app.config add below sections (or change them if they exist):

<configuration>

<configSections>
....
     <section name="resizer" type="ImageResizer.ResizerSection" 
requirePermission="false" />
</configSections>
<appSettings>
....
</appSettings>
<resizer>
     <pipeline fakeExtensions=".ashx" defaultCommands="autorotate.default=true"/>
     <plugins>
           <add name="DiskCache" />
           <add name="SizeLimiting" />
           ....
     </plugins>
     <sizelimits totalBehavior="ignorelimits" />
</resizer>

...

Upvotes: 0

Ivan Gritsenko
Ivan Gritsenko

Reputation: 4236

You can do it by setting "totalBehavior" to "ignorelimits". You can also set up totalWidth/totalHeight. http://imageresizing.net/plugins/sizelimiting

Upvotes: 0

Bertrand Le Roy
Bertrand Le Roy

Reputation: 17814

Make sure you resize first, then change the format.

Upvotes: 1

Related Questions