获取图片dpi
发表于|更新于
|浏览量:
在只能说谎与沉默两者来选择的时候,沉默也是好的。——何其芳
可以通过下面的代码获取:
1 | ImageInfo imageInfo = Imaging.getImageInfo(file); |
对应的依赖:
1 | <dependency> |
用的是apache-commons的commons-imaging这个库
https://commons.apache.org/proper/commons-imaging/index.html
相关推荐
2022-05-28
mvn一键换版本
一条路并不因为它路边长满荆棘而丧失其美丽,旅行者照旧向前进。——罗曼·罗兰 命令: 1mvn versions:set -DnewVersion=[版本号] 例如 1mvn versions:set -DnewVersion=0.0.1 即可
2023-06-19
写一个基于lambda的copyProperties
和任何人都认朋友,结果和任何人都交不成朋友。——佚名 代码仓库: https://gitee.com/dromara/stream-query 相关提交: https://gitee.com/dromara/stream-query/commit/31114dbc1374f78aad17daa4da615766d93194a2 使用方式: 123456789@Testvoid testCopyProperties() { LambdaExecutable source = LambdaHelper.resolve( (Serializable & Function<LambdaExecutable, String>) LambdaExecutable::getName); LambdaExecutable target = BeanHelper.copyProperties(source, null); Assertions.assertNotNull(target); Assertions.assertEqu...
2021-07-09
手动回滚、提交事务
再小的个子,也能给沙漠留下长长的身影;再小的人物,也能让历史吐出重重的叹息。——余秋雨《文化苦旅》 我们可以手动管理事务 首先需要引用两个Bean 1234@Resourceprivate TransactionDefinition transactionDefinition;@Resourceprivate IArticleEnclosureService articleEnclosureService; 然后是使用 1234567891011 PlatformTransactionManager transactionManager = Objects.requireNonNull(transactionTemplate.getTransactionManager()); TransactionStatus transactionStatus = transactionManager.getTransaction(transactionDefinition);if (逻辑执行正确) { //提交事务 transactionManager.c...
2023-02-04
rewriteBatchedStatements
从前的日色变得慢,车,马,邮件都慢,一生只够爱一个人。——木心 我们在使用mybatis进行批量更新时,可以在mysql的链接url处添加rewriteBatchedStatements=true提升效率. 文档:https://dev.mysql.com/doc/connector-j/8.0/en/connector-j-connp-props-performance-extensions.html 1rewriteBatchedStatements Should the driver use multi-queries, regardless of the setting of ‘allowMultiQueries’, as well as rewriting of prepared statements for INSERT and REPLACE queries into multi-values clause statements when ‘executeBatch()’ is called? Notice that this might allow SQL...
2024-10-24
AjPlus Captcha
如同明日将死那样生活,如同永远不死那样求知。——甘地 行为验证码(滑动拼图、点选文字),前后端(java)交互,包含h5/Android/IOS/flutter/uni-app的源码和实现 github: https://github.com/anji-plus/captcha 在线文档:https://ajcaptcha.beliefteam.cn/captcha-doc/简介 AJ-Captcha行为验证码,包含滑动拼图、文字点选两种方式,UI支持弹出和嵌入两种方式。后端提供Java实现,前端提供了php、angular、html、vue、uni-app、flutter、android、ios等代码示例。 1 在线体验在线体验暂时下线 2 功能概述 2.1 组件介绍 行为验证码采用嵌入式集成方式,接入方便,安全,高效。抛弃了传统字符型验证码展示-填写字符-比对答案的流程,采用验证码展示-采集用户行为-分析用户行为流程,用户只需要产生指定的行为轨迹,不需要键盘...
2022-09-28
springboot动态配置
耐心和持久胜过激烈和狂热——拉封丹 分享一个springboot动态配置框架:https://github.com/Code2Life/spring-boot-dynamic-config 在一些场景下可以用到热更新配置 轻量方便,简单好用 GAV 12345<dependency> <groupId>top.code2life</groupId> <artifactId>spring-boot-dynamic-config</artifactId> <version>1.0.9</version></dependency> 添加注解:@DynamicConfig 以及@Value 1234567891011121314151617181920212223242526272829303132333435import lombok.Data;import org.springframework.beans.factory.annotation.Value;impor...

阿超
我的名字叫阿超 年龄25岁 家在北京市 职业是软件开发 每天最晚也会在八点前回家 不抽烟 酒浅尝辄止 晚上十二点上床 保证睡足八个小时 睡前写一篇博客 再做二十分钟俯卧撑暖身 然后再睡觉 基本能熟睡到天亮 像婴儿一样不留下任何疲劳和压力 就这样迎来第二天的早晨 健康检查结果也显示我很正常 我想说明我是一个不论何时都追求内心平稳的人 不拘泥于胜负 不纠结于烦恼 不树立使我夜不能寐的敌人 这就是我在这社会的生活态度
Follow Me公告
This is my Blog