Skip to content

capptions/sc-resize

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sc-resize

Polymer 1.0 element for resizing images

<sc-resize> is an element that helps you resizing images, helpful before uploading

  • Based on blueimp's loadimage and canvas-to-blob
  • Resize images
  • Remove exif-tags (up = up)
  • Etc.

Getting started

Install with bower

First you need bower, see their site for details

bower install --save sc-resize

Attributes

Attribute Name Functionality Default
maxWidth A number stating the maximum width of the outputed image 1050
maxHeight A number stating the maximum height of the outputed image 874
minWidth A number stating the minimum width of the outputed image 140
maxHeight A number stating the minimum height of the outputed image 80
file The file object to be resized
resized The resized blob version of the file after resizing

How to use

  <sc-resize id="resize" on-resize="resized" on-error="error"></sc-resize>
  resize: function (file) {
    this.$.resize.set('file', file);
  },
  resized: function (e) {
    window.alert('Successfully resized!');
    window.console.log(e.detail);
  },
  error: function (e) {
  	window.alert('Sorry, this image can not be processed!');
  }

Contributions welcome, please create issues!

About

Polymer 1.0 element for resizing images

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages