Skip to content

this is a simple demo for select one image file ,and then resize and compress it ,and then push to server by ajax.

Notifications You must be signed in to change notification settings

monkey1609/jrcp

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 

Repository files navigation

this is a h5/js demo for resize and compress image to jpg.

when we select one image file in mobile, the file maybe too large 
to upload to server , so we need resize and compress it. 
this demo do it.

if has any question in use, please feedback me on github, thanks.

the method is simple:
step1:
 you need import the frcp.js, such as use:

<script src="js/jrcp.js"></script>

step2:

 you need to change the file object to the image object;

var result = this.result;
var img = new Image();
img.src = result;

step3:
  
   call the resizeAndCompress method in the jrcp.js to compress
the image.

you can find the detail in the source code. thanks!

About

this is a simple demo for select one image file ,and then resize and compress it ,and then push to server by ajax.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published