使用php从像素计算以英寸或dpi为单位的图像大小 [英] Calculating image size in inches or dpi from pixels using php
本文介绍了使用php从像素计算以英寸或dpi为单位的图像大小的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我需要假设300dpi来计算以英寸为单位的近似图像大小。
I need to calculate an approximate image size in inches assuming 300dpi.
我有一个目标图像大小,我想向用户展示该图像他们已经上传了足够的图片,或者需要进行扩展,并根据此提供各种条件消息。
I have a target image size in mind, and i want to show the user if the image they have uploaded is adequate, or will need to be stretched, and offer various conditional messages based off of this.
我已经有像素的高度和宽度,只需要知道我猜的数学。
I already have the height and width in pixels, just need to know the math i guess.
推荐答案
DPI =每英寸点数。一个点=一个像素。
DPI = "dots per inch". One dot = one pixel.
300 dpi(300 dpi):1英寸。您可以解决:-)
300 pixels in 300 dpi: 1 inch. You can work it out :-)
这篇关于使用php从像素计算以英寸或dpi为单位的图像大小的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文