当前位置:网站首页>上传图片获取宽高
上传图片获取宽高
2022-07-26 10:24:00 【唐策】
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>获取上传图片的宽高</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>边栏推荐
- PLC overview
- Nacos custom service change subscription
- modelsim 安装教程(应用未安装)
- Review of database -- 1. Overview
- Uniapp common error [wxml file compilation error]./pages/home/home Wxml and using MySQL front provided by phpstudy to establish an independent MySQL database and a detailed tutorial for independent da
- Flask framework beginner-03-template
- All codes of Tetris
- Redis realizes distributed lock and gets a watchdog
- 【Halcon视觉】阈值分割
- The difference between equals and = =
猜你喜欢

【Halcon视觉】算子的结构

Deduct daily question 838 of a certain day

议程速递 | 7月27日分论坛议程一览
![[Halcon vision] image gray change](/img/62/426713becba851f034e6008f28bdb0.png)
[Halcon vision] image gray change

On the compilation of student management system of C language course (simple version)

【Halcon视觉】数组

Vs Code configures go locale and successfully installs go related plug-ins in vscode problem: Tools failed to install

Basics of data communication - basic knowledge of network

About automatic operation on Web pages

Meeting OA project (III) -- my meeting (meeting seating and submission for approval)
随机推荐
【杂谈】Error loading psycopg2 module :No module named psycopg2
【Halcon视觉】图像滤波
Network related journals and conferences in CS
Google与Pixar开发Draco支持USD格式 加速3D对象传输&lt;转发&gt;
Android greendao数据库的使用
30分钟彻底弄懂 synchronized 锁升级过程
Session based recommendations with recurrent neural networks
Review of database -- 3. SQL language
新建福厦铁路全线贯通 这将给福建沿海带来什么?
数据库的复习--3.SQL语言
Learning about tensor (III)
MLX90640 红外热成像仪测温传感器模块开发笔记(六)
Data communication foundation - layer 2 switching principle
[Qualcomm][Network] qti服务分析
[award-winning question] ask Judea pearl, the Turing prize winner and the father of Bayesian networks
Strange Towers of Hanoi|汉诺塔4柱问题
句句解析js中的完美 / 缓冲运动框架(新手专用)
Solution of inputting whole line string after inputting integer
[socket] the three handshakes are completed in listen, and accept only takes out one connection from the queue that completes the connection
数通基础-STP原理