调整动画GIF的大小会失去透明度和动画效果

时间:2014-08-12 09:59:32

标签: c# .net gif animated-gif imageresizer

我在IIS托管的.NET Web服务上使用ImageResizer .NET组件来处理调整存储在Amazon S3中的图像的大小。

它适用于除动画GIF之外的所有内容(因此JPEG,PNG,标准GIF没有问题)

使用动画GIF但动画会丢失,透明度会变为黑色。

我是否在查询字符串中添加显式 format = gif 参数似乎没有任何区别。

resizer.debug页面的输出如下所示:

Image resizer diagnostic sheet      12/08/2014 09:36:08

2 Issues detected:

(Warning):  To potentially see additional errors here, perform an image resize request.


(Warning):  NoCache is only for development usage, and cannot scale to production use.
            Add DiskCache or CloudFront for production use


You are using plugins from the Performance Edition: S3Reader2 (Performance Edition), AnimatedGifs (Performance Edition), PrettyGifs (Performance Edition)

Registered plugins:

ImageResizer.Plugins.Basic.DefaultEncoder
ImageResizer.Plugins.Basic.NoCache
ImageResizer.Plugins.Basic.ClientCache
ImageResizer.Plugins.Basic.Diagnostic
ImageResizer.Plugins.Basic.SizeLimiting
ImageResizer.Plugins.S3Reader2.S3Reader2
ImageResizer.Plugins.AnimatedGifs.AnimatedGifs
ImageResizer.Plugins.PrettyGifs.PrettyGifs
ImageResizer.Plugins.Logging.LoggingPlugin

Configuration:

<resizer>
<plugins>
<add name="S3Reader2" vpp="false" buckets="implat.imagr.220triathlon,implat.imagr.babyexpert,implat.imagr.control,implat.imagr.gardenersworld,implat.imagr.golfmagic,implat.imagr.junior,implat.imagr.loveyourhair,implat.imagr.madeformums,implat.imagr.outdoormagic,implat.imagr.outdoorsmagic,implat.imagr.radiotimes,implat.imagr.runnersworld,implat.imagr.test,implat.imagr.visordown,implat.imagr.youandyourwedding" accessKeyId="[redacted]" secretAccessKey="[redacted]" prefix="~/s3/" useSubdomains="true" region="eu-west-1" />
<add name="AnimatedGifs" />
<add name="PrettyGifs" />
<add name="Logging" />
</plugins>
<diagnostics enableFor="Localhost" />
</resizer>


Accepted querystring keys:

quality, format, thumbnail, colors, dither, 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-IIS/8.0 on Microsoft Windows NT 6.1.7601 Service Pack 1 and CLR 4.0.30319.18444
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)\IIS Express\iisexpress.exe
IntegratedPipeline: True

Loaded assemblies:

mscorlib                                 Assembly: 4.0.0.0         File: 4.0.30319.18444 Info: 4.0.30319.18444
System.Web                               Assembly: 4.0.0.0         File: 4.0.30319.18446 Info: 4.0.30319.18446
System                                   Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
System.Core                              Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
System.Web.ApplicationServices           Assembly: 4.0.0.0         File: 4.0.30319.18446 Info: 4.0.30319.18446
System.Configuration                     Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
System.Xml                               Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
System.Runtime.Caching                   Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
Microsoft.Build.Utilities.v4.0           Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
Microsoft.JScript                        Assembly: 10.0.0.0        File: 11.0.50938.18408 Info: 11.0.50938.18408
Microsoft.CSharp                         Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
System.Data                              Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
System.Web.Services                      Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
System.Drawing                           Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
System.EnterpriseServices                Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
System.IdentityModel                     Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
System.Runtime.Serialization             Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
System.ServiceModel                      Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
System.ServiceModel.Activation           Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
System.ServiceModel.Web                  Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
System.Activities                        Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
System.ServiceModel.Activities           Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
System.WorkflowServices                  Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
System.Web.Extensions                    Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
System.Data.DataSetExtensions            Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
System.Xml.Linq                          Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
System.ComponentModel.DataAnnotations    Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
System.Web.DynamicData                   Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
AWSSDK                                   Assembly: 2.2.2.0         File: 2.2.2.0        
ImageResizer                             Assembly: 3.4.3.103       File: 3.4.3.103       Info: 3-4-3  Commit: bf92fd7
ImageResizer.Plugins.AnimatedGifs        Assembly: 3.4.3.103       File: 3.4.3.103       Info: 3-4-3  Commit: bf92fd7
ImageResizer.Plugins.Logging             Assembly: 3.4.3.103       File: 3.4.3.103       Info: 3-4-3  Commit: bf92fd7
ImageResizer.Plugins.PrettyGifs          Assembly: 3.4.3.103       File: 3.4.3.103       Info: 3-4-3  Commit: bf92fd7
ImageResizer.Plugins.S3Reader2           Assembly: 3.4.3.103       File: 3.4.3.103       Info: 3-4-3  Commit: bf92fd7
Imagr.Resizer                            Assembly: 1.0.0.0         File: 1.0.0.0        
NLog                                     Assembly: 3.1.0.0        
System.Web.WebPages.Deployment           Assembly: 2.0.0.0         File: 2.0.20710.0    
Microsoft.VisualStudio.Web.PageInspector.Loader Assembly: 1.0.0.0         File: 12.3.50717.0   
System.Xaml                              Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
Microsoft.VisualStudio.Web.PageInspector.Runtime Assembly: 12.3.0.0        File: 12.3.50717.0   
Microsoft.Web.Infrastructure             Assembly: 1.0.0.0         File: 1.0.20105.407  
Microsoft.VisualStudio.Web.PageInspector.Tracing Assembly: 12.3.0.0        File: 12.3.50717.0   
System.Web.RegularExpressions            Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
System.Data.Services.Design              Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
App_global.asax.2z_wgdg2                 Assembly: 0.0.0.0        
System.Net.Http                          Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
System.Net.Http.WebRequest               Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
System.ServiceModel.Internals            Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408
SMDiagnostics                            Assembly: 4.0.0.0         File: 4.0.30319.18408 Info: 4.0.30319.18408

提前致谢!

阿德里安

0 个答案:

没有答案