当前位置:网站首页>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>边栏推荐
- [collection of topics that C language learners must know 1] consolidate the foundation and steadily improve
- Unicorn, valued at $1.5 billion, was suddenly laid off, and another track was cold?
- Unicode file parsing methods and existing problems
- Sword finger offer (x): rectangular coverage
- 【Oauth2】七、微信OAuth2授权登录
- Implementation of SAP ABAP daemon
- Precautions for triggering pytest.main() from other files
- Hcip day 11 comparison (BGP configuration and release)
- Familiarize you with the "phone book" of cloud network: DNS
- LCL三相pwm整流器(逆变器)
猜你喜欢

Time complexity and space complexity

Dimension disaster dimension disaster suspense
![[dark horse morning post] many apps under bytek have been taken off the shelves; The leakage of deoxidizer in three squirrels caused pregnant women to eat by mistake; CBA claimed 406million yuan from](/img/f6/03e39799db36c33a58127359aa2794.png)
[dark horse morning post] many apps under bytek have been taken off the shelves; The leakage of deoxidizer in three squirrels caused pregnant women to eat by mistake; CBA claimed 406million yuan from

Pytorch学习笔记(三)模型的使用、修改、训练(CPU/GPU)及验证

Official announcement! Edweisen group and Baidu xirang reached a deep co creation cooperation

估值15亿美元的独角兽被爆裁员,又一赛道遇冷?

终极套娃 2.0 | 云原生交付的封装

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

LCL three-phase PWM rectifier (inverter)

【C语言学习者必会的题目集锦1】巩固基础,稳步提高
随机推荐
《Kotlin系列》之MVVM架构封装(kotlin+mvvm)
[shaders realize overlay to re cover cross dressing effect _shader effect Chapter 9]
Implementation of SAP ABAP daemon
JSON data transfer parameters & date type parameter transfer
HCIP第十一天比较(BGP的配置、发布)
Frisbee, 2022 "black red" top stream
Intercept the coordinate points (four point coordinates of the face frame) face image from the marked XML file and save it in the specified folder
One stroke problem (Chinese postman problem)
周伟:寻找非共识性投资机会,陪伴延迟满足的创始团队
Subscription and publication of messages
Unicorn, valued at $1.5 billion, was suddenly laid off, and another track was cold?
Can I take your subdomain? Exploring Same-Site Attacks in the Modern Web
Activity. Onstop() delay 10 seconds? Wonderful investigation process
How to realize the reality of temporary graphic elements
LeetCode 263.丑数
B+ tree index uses (7) matching column prefix, matching value range (19)
JUC总结
Pytoch learning notes (III) use, modification, training (cpu/gpu) and verification of the model
Activity.onStop() 延迟10秒?精彩绝伦的排查历程
In 2022, we "sent away" so many Internet products in only one month