Error in the result of the size of the images in inch, centimeter and millimetre.

Advanced Renamer forum
#1 : 11/01-18 05:49
trainant fabrice
trainant fabrice
Posts: 1
Hello,
The values of dimension(size) in millimeter with regard to(compared with) the dpi and the resolution are false.
I would thus love with a script, calculated real dimension(size) in graduated(well organized) with the following formula:

(<ExifTool:ImageWidth>/ <ExifTool:XResolution>) x 25.1 = x mm
(<ExifTool:ImageHeight>/ <ExifTool:YResolution>) x 25.1 = y mm

Values that I to put in the name of the file : x mm and y mm

example :
x 1920
y 1080
x dpi : 300
y dpi : 300
x = 1920/300= 6.4 inch
y = 1080/300 = 3.6 inch

x = 6.4 x 25.1 = 160.64 mm
y = 3.6 x 25.1 = 90.36 mm.

Here is an example of false value.

formula :pixel <ExifTool:ImageWidth> x <ExifTool:ImageHeight> taille mm <Img Width Mm> x <Img Height Mm> DPI <ExifTool:XResolution>

result :
pixel 800 x 950 taille mm 282 x 335 DPI 300

or : 800/300 = 2.66
2.66 x 25.1 = 66.66 mm
but not : 282 mm.

thx

sorry i'am french and my english this is very bad.


11/01-18 05:49
#2 : 01/02-18 03:23
Brian Hanlon
Brian Hanlon
Posts: 29
Bonjour trainant fabric;

First, the correct inch => mm factor is 25.5 not 25.1 - that will help a lot!

Second, I think that your 800x950 example is actually 72 DPI, not 300 DPI.

A few calculations on your data:

At 300 DPI:
1920px/300 DPI = 6.40 in or 162.56 mm
1080px/300 DPI = 3.60 in or 91.44 mm

At 300 DPI:
800px/300 DPI = 2.67 in or 67.73 mm <<== which you expect, based on 300 DPI
950px/300 DPI = 3.17 in or 80.43 mm

AT 72 DPI:
800px/72 DPI = 11.11 in or 282.22 mm <<== which you see from your image = 72 DPI
950px/72 DPI = 13.19 in or 335.14 mm

Most graphics software will allow you to change the DPI with which the file is saved, and this can make it very difficult to categorise images according to print size. For example:

If I prepared an image for professional printing (600 DPI) with dimensions 6 in by 4 in, (152.4 mm by 101.6 mm) the image would be 3600px by 2400px.

If I saved the original plus three copies, with one copy set to 24 DPI and the other set to 2400 DPI, they would all have the same file-size, all show 3600px by 2400px, but the apparent Print Sizes would vary thus:

3600px by 2400px at 24 DPI = 150 in by 100 in or 3810 mm by 2540 mm
3600px by 2400px at 600 DPI = 6 in by 4 in or 152.4 mm by 101.6 mm
3600px by 2400px at 2400 DPI = 1.5 in by 1 in or 38.1 mm by 25.4 mm

Yet they are all the same image!

Screencaps are a great offender in this regard, as they can be 96 DPI, 120 DPI, or whatever the user has the screen set to, modified, of course, by whatever zoom factor they have used to display the image!

Better, in my opinion, to categorise images by pixel size rather than apparent Print Size.

Brian


01/02-18 03:23