KO
|
EN
gitlite — search
Search
#python
#javascript
#reactjs
#react
#hacktoberfest
#typescript
#css
#java
#rust
#styled-components
#aws
#firebase
js-image-base64
★ 45
Open GitHub ↗
JS前端上传图片、压缩、并且处理旋转问题,生成base64数据
Download README (.md)
Explore Similar Repositories
FFmpegGUI
:
Free video filter graph editor
sentinelhub-qgis-plugin
:
QGIS Plugin for Sentinel Hub
bitfinex_algo
:
Orderbook based trading algorithm for Bitfinex, based on open source from jndok and dawsbot
AutoGridView
:
:traffic_light:AutoGridView可以更轻松实现QQ空间和微信朋友圈的九宫格、点击展开、点击加号添加照片等功能,而且采用Adapter方式,可以自定义item,更加灵活,使用起来就像ListView和BaseAdapter搭配一样简单...
react-native-global-font
:
No description available.
// repository documentation
Was this content helpful?
★ 0
(0 ratings)
Select Rating:
★
★
★
★
★
Submit Feedback
Recent Feedback
×
Download README
Do you want to download the
README.md
file for
js-image-base64
?
Download (.md)
## 简介 JS前端上传图片、压缩、并且处理旋转问题,生成base64数据 ### 演示地址 http://www.tkc8.com/test/pic/index.html ## 示例代码 ``` <!DOCTYPE html> <html lang="zh-CN"> <head> <title>image-test</title> <meta charset="utf-8"/> <script src="base64image.js" type="text/javascript"></script> <script src="exif.js" type="text/javascript"></script> </head> <body> <input type="file" style="display: none" onchange="fileUp(this)" id="file-up"> <input type="button" value="点我上传图片" onclick="document.getElementById('file-up').click();"/> <div id='image-list'></div> <script> var fileUp = function (me) { base64Image({ width:750, /*【选填】宽度默认750,如果图片尺寸大于该宽度,图片将被设置为该宽度*/ ratio:0.75, /*【选填】压缩率默认0.75 */ file: me, /*【必填】对应的上传元素 */ callback: function (imageUrl) { /*【必填】处理成功后的回调函数 */ /*imageUrl为得到的图片base64数据,这里可以进行上传到服务器或者其他逻辑操作 */ var img = new Image(); img.src = imageUrl; $("#image-list").append(img); }, }); }; </script> </body> </html> ``` ## 交流方式 ### 联系我们 QQ群: 298420174  作者: Sponge 邮箱: 1796512918@qq.com