当前位置:网站首页>Upload pictures to get width and height
Upload pictures to get width and height
2022-07-26 13:41:00 【Tangce】
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title> Get the width and height of the uploaded image </title>
</head>
<body>
<form>
<input type="file" name="img_upload" id="img_upload" onchange="imgUpload();" />
</form>
</body>
<script type="text/javascript"> function imgUpload() {
var file = document.getElementById('img_upload'); createReader(file.files[0], function (w, h) {
alert(w + ' '+ h)}); } createReader = function(file, whenReady) {
var reader = new FileReader; reader.onload = function (evt) {
var image = new Image(); image.onload = function () {
var width = this.width; var height = this.height; if (whenReady) whenReady(width, height); }; image.src = evt.target.result; }; reader.readAsDataURL(file); } </script>
</html>边栏推荐
- B+ tree index use (6) leftmost principle -- MySQL from entry to proficiency (18)
- Control the probability of random winning [C | random]
- LCL three-phase PWM rectifier (inverter)
- 消息的订阅和发布
- Tupu 3D visual national style design | collision between technology and culture "cool" spark“
- 银行业客户体验管理现状与优化策略分析
- Uncover the secret of white hat: 100 billion black products on the Internet scare musk away
- Seven steps to copywriting script ---- document team collaborative management
- 异步线程池在开发中的使用
- [shaders realize overlay to re cover cross dressing effect _shader effect Chapter 9]
猜你喜欢

【黑马早报】字节旗下多款APP下架;三只松鼠脱氧剂泄露致孕妇误食;CBA公司向B站索赔4.06亿;马斯克否认与谷歌创始人妻子有婚外情...

Hcip day 11 comparison (BGP configuration and release)

天津市应急局与驻津央企签署协议深化应急联动机制建设

多线程使用不当导致的 OOM

We were tossed all night by a Kong performance bug

panic: Error 1045: Access denied for user ‘root‘@‘117.61.242.215‘ (using password: YES)

The last time I heard about eBay, or the last time

历时15年、拥有5亿用户的飞信,彻底死了

Jenkins 中 shell 脚本执行失败却不自行退出

In 2022, we "sent away" so many Internet products in only one month
随机推荐
Team research and development from ants' foraging process (Reprint)
JSON data transfer parameters & date type parameter transfer
Detailed explanation of factory mode
The use of asynchronous thread pool in development
【Oauth2】五、OAuth2LoginAuthenticationFilter
421. Maximum XOR value of two numbers in the array
[oauth2] VII. Wechat oauth2 authorized login
.NET WebAPI 使用 GroupName 对 Controller 分组呈现 Swagger UI
重押海外:阿里、京东、顺丰再拼“内力”
Pytorch学习笔记(一)安装与常用函数的使用
Activity.onStop() 延迟10秒?精彩绝伦的排查历程
Implementation of SAP ABAP daemon
白帽子揭秘:互联网千亿黑产吓退马斯克
天津市应急局与驻津央企签署协议深化应急联动机制建设
Parent class reference to child class (parent class reference points to child class object)
Re bet overseas: Alibaba, jd.com and SF again fight for "internal power"
[flower carving hands-on] interesting and fun music visualization series small project (13) -- organic rod column lamp
B+ tree (5) introduction to MyISAM -- MySQL from getting started to mastering (17)
异步线程池在开发中的使用
周伟:寻找非共识性投资机会,陪伴延迟满足的创始团队