# CKEDITOR.plugins.image2

class singleton

A set of Enhanced Image (image2) plugin helpers.

## Methods

• ### checkHasNaturalRatio( image ) → BooleanCKEDITOR.plugins.image2#checkHasNaturalRatio

Checks whether the current image ratio matches the natural one by comparing dimensions.

#### Parameters

image : element

#### Returns

Boolean
• ### getLinkAttributesGetter() → FunctionCKEDITOR.plugins.image2#getLinkAttributesGetter

since 4.5.5

Returns an attribute getter function. Default getter comes from the Link plugin and is documented by CKEDITOR.plugins.link.getLinkAttributes.

Note: It is possible to override this method and use a custom getter e.g. in the absence of the Link plugin.

Note: If a custom getter is used, a data model format it produces must be compatible with CKEDITOR.plugins.link.getLinkAttributes.

Note: A custom getter must understand the data model format produced by getLinkAttributesParser to work correctly.

#### Returns

Function

A function that gets (composes) link attributes.

• ### getLinkAttributesParser() → FunctionCKEDITOR.plugins.image2#getLinkAttributesParser

since 4.5.5

Returns an attribute parser function. Default parser comes from the Link plugin and is documented by CKEDITOR.plugins.link.parseLinkAttributes.

Note: It is possible to override this method and use a custom parser e.g. in the absence of the Link plugin.

Note: If a custom parser is used, a data model format produced by the parser must be compatible with getLinkAttributesGetter.

Note: If a custom parser is used, it should be compatible with the CKEDITOR.plugins.link.parseLinkAttributes data model format. Otherwise the Link plugin dialog may not be populated correctly with parsed data. However as long as Enhanced Image is not used with the Link plugin dialog, any custom data model will work, being stored as an internal property of Enhanced Image widget's data only.

#### Returns

Function

A function that parses attributes.

• ### getNatural( image ) → ObjectCKEDITOR.plugins.image2#getNatural

Returns natural dimensions of the image. For modern browsers it uses natural(Width|Height). For old ones (IE8) it creates a new image and reads the dimensions.

#### Parameters

image : element

#### Returns

Object