简体   繁体   中英

Images Isapi filter settings to resize images from parameter in 64 bit

I am working in existing ASP.net2.0 application using C# and deployed on IIS 7.5, in windows 2008 R2 server 64 bit.

In my application various images sizes are handeled from IIS settings given below. Effect of this is, If we access the image size as

http//domainname.com/images/imagename.jpg?w=21&h=213

The image automatically resize with given width and height parametere. All happens because of below entries in web.config

<system.webServer>
    <handlers>      
        <add name="png" path="*.png" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
        <add name="jpg" path="*.jpg" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
        <add name="jpeg" path="*.jpeg" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
    </handlers>
</system.webServer>

The entries has come when we have added isapi filters for images with to point to path aspnet_isapi.dll in web.config file above.

It works great.

Now I have upgraded the application pool on same IIS from 32 bit to 64 bit. Image rezise happening is failing. Reason I think is because in configuration it is saying "bitness32", so we made it to 64 bit like "bitness64" and updated the config

<system.webServer>
    <handlers>      
        <add name="png" path="*.png" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv2.0,bitness64" />
        <add name="jpg" path="*.jpg" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv2.0,bitness64" />
        <add name="jpeg" path="*.jpeg" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" preCondition="classicMode,runtimeVersionv2.0,bitness64" />
    </handlers>
</system.webServer>

but when we did this, various images stopped coming in the site.

Please suggest me, how do we fix this urgently

Regards,

You can set Enable 32-Bit Application to True in IIS 7 (on Application pool that you application is using).

On 64-bit Windows, 32-bit processes cannot load 64-bit DLLs, and 64-bit processes cannot load 32-bit DLLs. If you plan to run 32-bit applications on 64-bit Windows, you must configure IIS to create 32-bit worker processes. Once you have configured IIS to create 32-bit worker processes, you can run the following types of IIS applications on 64-bit Windows:

  • Internet Server API (ISAPI) extensions
  • ISAPI filters
  • Active Server Page (ASP) applications (specifically, scripts calling COM objects where the COM object can be 32-bit or 64-bit)
  • ASP.NET applications

Screen:

在此处输入图片说明

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM