CKEDITOR.plugins.pastetools.filters.image
Filtering
Properties
since 4.16.0 private
recognizableImageSignatures : RecognizableImageSignature[]CKEDITOR.plugins.pastetools.filters.image#recognizableImageSignaturesRecognizable image file signatures with their respective types.
The recognizing of image type is done by matching the first bytes of the signature represented as hex string.
Defaults to
[{signature: 'ffd8ff', type: 'image/jpeg'}, {signature: '47494638', type: 'image/gif'}, {signature: '89504e47', type: 'image/png'}]since 4.16.0 private
recognizableImageTypes : RecognizableImageType[]CKEDITOR.plugins.pastetools.filters.image#recognizableImageTypesRecognizable image types with their respective markers.
The recognizing of image type is done by searching for image marker inside the RTF image content.
Defaults to
[{marker: /\\pngblip/, type: 'image/png'}, {marker: /\\jpegblip/, type: 'image/jpeg'}, {marker: /\\emfblip/, type: 'image/emf'}, {marker: /\\wmetafile\d/, type: 'image/wmf'}]since 4.16.0 private
supportedImageTypes : String[]CKEDITOR.plugins.pastetools.filters.image#supportedImageTypes
Methods
since 4.16.0 private
convertBlobUrlToBase64( blobUrlSrc ) → String | null>CKEDITOR.plugins.pastetools.filters.image#convertBlobUrlToBase64Converts blob url into base64 string. Conversion is happening asynchronously. Currently supported file types:
image/png,image/jpeg,image/gif.Parameters
blobUrlSrc : StringAddress of blob which is going to be converted
Returns
String | null>Promise, which resolves to Data URL representing image. If image's type is unsupported, promise resolves to
null.since 4.16.0 private
createSrcWithBase64( img ) → StringCKEDITOR.plugins.pastetools.filters.image#createSrcWithBase64Creates image source as Base64-encoded Data URL.
Parameters
img : ImageDataImage data.
Returns
StringData URL representing the image.
since 4.16.0 private
extractFromRtf( rtfContent ) → ImageData[]CKEDITOR.plugins.pastetools.filters.image#extractFromRtfParses RTF content to find embedded images.
Parameters
rtfContent : StringRTF content to be checked for images.
Returns
ImageData[]An array of images found in the
rtfContent.since 4.16.0 private
extractTagsFromHtml( html ) → String[]CKEDITOR.plugins.pastetools.filters.image#extractTagsFromHtmlExtracts an array of
src`` attributes intags from the given HTML.` tags belonging to VML shapes are removed.
CKEDITOR.plugins.pastefromword.images.extractTagsFromHtml( html ); // Returns: [ 'http://example-picture.com/random.png', 'http://example-picture.com/another.png' ]Parameters
html : StringA string representing HTML code.
Returns
String[]An array of strings representing the
srcattribute of the<img>tags found inhtml.since 4.16.0 private
getImageType( imageContent ) → StringCKEDITOR.plugins.pastetools.filters.image#getImageTypeExtract image type from its RTF content
Parameters
imageContent : StringImage content as RTF string.
Returns
StringIf the image type can be extracted, it is returned in
image/*format. Otherwise,'unknown'is returned.since 4.16.0 private
getImageTypeFromSignature( bytesArray ) → String | nullCKEDITOR.plugins.pastetools.filters.image#getImageTypeFromSignatureReturn file type based on first 4 bytes of given file. Currently recognised file types:
image/png,image/jpeg,image/gif.Parameters
bytesArray : Uint8ArrayTyped array which will be analysed to obtain file type.
Returns
String | nullFile type recognized from given typed array or null.