GithubHelp home page GithubHelp logo

risyandi / vue-image-compressor Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bosnaufal/vue-image-compressor

0.0 2.0 0.0 134 KB

Vue Component To Compress Image Files Via Client Side. https://bosnaufal.github.io/vue-image-compressor

License: MIT License

HTML 1.85% Vue 65.93% JavaScript 32.22%

vue-image-compressor's Introduction

Vue Image Compressor

Vue Component To Compress Image Files. It's based on cpol-image and others references

DEMO

Install

You can import vue-image-compressor.vue to your vue component file like this and process it with your preprocessor.

You can install it via NPM

npm install vue-image-compressor

Or Just put it after Vue JS~

<script src="https://vuejs.org/js/vue.min.js"></script>
<script src="./dist/vue-image-compressor.js"></script>

Import Module

import imageCompressor from 'vue-image-compressor'
// Or
var imageCompressor = require('vue-image-compressor');

Usage

<template>

  <image-compressor
    :done="getFiles"
    :scale="scale"
    :quality="quality">
  </image-compressor>

</template>


<script>

  import imageCompressor from 'vue-image-compressor';

  export default {

    components: { imageCompressor },

    methods: {
      getFiles(obj){
        console.log(obj);
      }
    }
  };

</script>

Props

done (Function)

Callback after Compress the image. It will pass original file and compressed file and also the canvas element. The object pretty complete with blob and base64 and other needed information.

scale (Number)

The percentage of image scaling it starts from 1 to 100.

quality (Number)

The percentage of image quality it starts from 1 to 100.

Credits

Thank You for Making this useful~

Let's talk about some projects with me

Just Contact Me At:

License

MIT Copyright (c) 2016 - forever Naufal Rabbani

vue-image-compressor's People

Contributors

bosnaufal avatar

Watchers

James Cloos avatar Risyandi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.