Skip to content

Expose some useful internal file handling methods and document them #13

@safrazik

Description

@safrazik

For example:

import {utils} from 'vue-file-agent';

// thumbnailSize: in pixels
// file instanceof File (optional)
// url - when file is not provided (optional). Returns promise
utils.resizeImage(thumbnailSize, file, url).then((data)=> {
  console.log(data.image); // image instanceof Image - for further customization
  console.log(data.canvas); // the canvas element 
  console.log(data.url); // the base64 string of resized image
  console.log(data.color); // the average (or dominant) color calculated
});

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions