ImageResizer  3.4.0
 All Classes Namespaces Functions Variables Enumerations Enumerator Properties Events
Public Member Functions | Properties | List of all members
ImageResizer.Plugins.FreeImageEncoder.FreeImageEncoderPlugin Class Reference
Inheritance diagram for ImageResizer.Plugins.FreeImageEncoder.FreeImageEncoderPlugin:
Inheritance graph
[legend]
Collaboration diagram for ImageResizer.Plugins.FreeImageEncoder.FreeImageEncoderPlugin:
Collaboration graph
[legend]

Public Member Functions

 FreeImageEncoderPlugin (ResizeSettings settings, object original)
 
IPlugin Install (Configuration.Config c)
 
bool Uninstall (Configuration.Config c)
 
IEncoder CreateIfSuitable (ResizeSettings settings, object original)
 If the encoder can handle the requirements specified by 'settings' and 'source', it should return an encoder instance. If not, it should return null. More...
 
void Write (System.Drawing.Image i, System.IO.Stream s)
 
- Public Member Functions inherited from ImageResizer.Plugins.IPlugin
IPlugin Install (Config c)
 Installs the plugin in the specified Config instance. The plugin must handle all the work of loading settings, registering the plugin etc. More...
 
bool Uninstall (Config c)
 Uninstalls the plugin. Should reverse all changes made during Install More...
 
- Public Member Functions inherited from ImageResizer.Encoding.IEncoder
void Write (Image i, Stream s)
 Encodes the image to the specified stream More...
 

Properties

FREE_IMAGE_FORMAT Format [get, set]
 
FREE_IMAGE_SAVE_FLAGS EncodingOptions [get, set]
 
bool SupportsTransparency [get]
 
string MimeType [get]
 
string Extension [get]
 
- Properties inherited from ImageResizer.Encoding.IEncoder
bool SupportsTransparency [get]
 True if the output format will support transparency as it is currently configured. More...
 
string MimeType [get]
 Returns the appropriate mime-time for the output format as currently configured. More...
 
string Extension [get]
 Returns a file extension appropriate for the output format as currently configured, without a leading dot. More...
 

Detailed Description

Definition at line 12 of file FreeImageEncoder.cs.

Member Function Documentation

IEncoder ImageResizer.Plugins.FreeImageEncoder.FreeImageEncoderPlugin.CreateIfSuitable ( ResizeSettings  settings,
object  original 
)
inline

If the encoder can handle the requirements specified by 'settings' and 'source', it should return an encoder instance. If not, it should return null.

Parameters
settingsRequest settings, like format, quality, colors, dither, etc.
originalMay be a Drawing.Image instance, a path, or null. To provide both, set Image.tag to the path. Helps the encoder detect the original format if the format was not specified. May also be used for palette generation hinting by some encoders.
Returns

Implements ImageResizer.Encoding.IEncoder.

Definition at line 81 of file FreeImageEncoder.cs.

81  {
82 
83  ImageFormat requestedFormat = DefaultEncoder.GetRequestedFormat(settings.Format, ImageFormat.Jpeg);
84  if (requestedFormat == null || !IsValidOutputFormat(requestedFormat)) return null; //An unsupported format was explicitly specified.
85  if (!"freeimage".Equals(settings["encoder"], StringComparison.OrdinalIgnoreCase)) return null;
86  if (!FreeImage.IsAvailable()) return null;
87  return new FreeImageEncoderPlugin(settings, original);
88  }

The documentation for this class was generated from the following file: