Report an issue
Class

CKEDITOR.plugins.pastetools.filters.image

class

Filtering

Properties

  • since 4.16.0 private

    recognizableImageSignatures : RecognizableImageSignature[]

    Recognizable 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[]

    Recognizable 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[]

    Array of all supported image formats.

    Defaults to ['image/png', 'image/jpeg', 'image/gif']

Methods

  • since 4.16.0 private

    convertBlobUrlToBase64( blobUrlSrc ) → String | null>

    Converts blob url into base64 string. Conversion is happening asynchronously. Currently supported file types: image/png, image/jpeg, image/gif.

    Parameters

    blobUrlSrc : String

    Address 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 ) → String

    Creates image source as Base64-encoded Data URL.

    Parameters

    img : ImageData

    Image data.

    Returns

    String

    Data URL representing the image.

  • since 4.16.0 private

    extractFromRtf( rtfContent ) → ImageData[]

    Parses RTF content to find embedded images.

    Parameters

    rtfContent : String

    RTF content to be checked for images.

    Returns

    ImageData[]

    An array of images found in the rtfContent.

  • since 4.16.0 private

    extractTagsFromHtml( html ) → String[]

    Extracts 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 : String

    A string representing HTML code.

    Returns

    String[]

    An array of strings representing the src attribute of the <img> tags found in html.

  • since 4.16.0 private

    getImageType( imageContent ) → String

    Extract image type from its RTF content

    Parameters

    imageContent : String

    Image content as RTF string.

    Returns

    String

    If the image type can be extracted, it is returned in image/* format. Otherwise, 'unknown' is returned.

  • since 4.16.0 private

    getImageTypeFromSignature( bytesArray ) → String | null

    Return file type based on first 4 bytes of given file. Currently recognised file types: image/png, image/jpeg, image/gif.

    Parameters

    bytesArray : Uint8Array

    Typed array which will be analysed to obtain file type.

    Returns

    String | null

    File type recognized from given typed array or null.