当前位置:网站首页>JS获取图片或base64的宽高等基本信息
JS获取图片或base64的宽高等基本信息
2022-06-29 08:18:00 【S筱潇S四维Smile】
let newImage = new Image()
// 这里将src传入需要获取信息的图片地址或base64
newImage.src = base64
// onload是异步的,封装的话可以用promise
newImage.onload = () => {
// 输出图片信息 比如可以获取图片宽高
console.log(newImage)
console.log(newImage.width)
console.log(newImage.height)
}
边栏推荐
- Standard | China payment and clearing Association releases the first privacy computing financial specification
- Does the SQL server run with administrator privileges? Or run it as a normal user?
- 批量处理实验接触角数据-MATLAB分析
- 2022第六季完美童模 海口赛区 选拔赛圆满落幕
- 《乔布斯传》英文原著重点词汇笔记(七)【 chapter five】
- Debugging nocturnal simulator with ADB command
- (pytorch进阶之路三)encoder self attention mask
- Summary of various series (harmonic, geometric)
- The return values of hostname -f and uname -n may be different
- 晋升或汇报,你真的把事情讲清楚了吗?
猜你喜欢
![Speech synthesis: overview [generation task of unequal length sequence relation modeling]](/img/13/bd9def50f0efde49b622d139f63a83.png)
Speech synthesis: overview [generation task of unequal length sequence relation modeling]
![[microservices openfeign] timeout of openfeign](/img/b1/9bc92250b4d544c704d2af5c08d059.png)
[microservices openfeign] timeout of openfeign

The sixth season of 2022 perfect children's model Qingyuan competition area audition came to a successful conclusion

今年的网络安全“体检”你做了吗?

闭关修炼(二十五)基础web安全

Debugging nocturnal simulator with ADB command

x86和x64的区别

“国防七校”之一西工大遭境外网络攻击

ThreadLocal thread variable

新版付费塔罗牌测算源码 (附带搭建教程)
随机推荐
Core development board & debugger
New spark in intelligent era: wireless irrigation with Lora wireless transmission technology
闭关修炼(二十一)Servlet生命周期、service方法源码分析、线程安全问题
微信小程序开发,如何添加多个空格
Compare homekit, MI family, and zhiting family cloud edition for what scene based experiences
VMware vcenter/esxi series vulnerability summary
启牛学堂让开的证券账户是真的安全靠谱吗?
图解SOC中的Timer(一):系统里有哪些Timer?
【Redis】Redis6学习框架思路和细节
Résumé des différentes séries (harmoniques, géométriques)
Uber前安全主管面临欺诈指控 曾隐瞒数据泄露事件
dcase_ Util tutorial
首次触电,原来你是这样的龙蜥社区 | 龙蜥开发者说第8期
TypeScript 變量聲明 —— 類型斷言
开发小技巧-图片资源管理
Voice annotation automatic segment alignment tool sppas usage notes
微积分学习
“国防七校”之一西工大遭境外网络攻击
2022 spring summer collection koreano essential reshapes the vitality of fashion
A high-frequency problem, three kinds of model thinking to solve this risk control problem