Hey gang,
Apologies in advance since I'm sure variations on this question have been asked here multiple times before. I did read the FAQ and do a search but it was a lot of information to wade through and I'm a bit short on time.
I'm looking to generate a spreadsheet with information about ~100 images. The relevant information would ideally be the filename, the color profile, and the dimensions in picas. Is ExifTool a good tool for this purpose? If so, I'll dig in deeper and see if I can learn how this tool works.
Thanks,
Rambo3
I'm on mobile atm so I can't go into details, but take a look at the CSV option. You can export the tags you want and load the results into a spreadsheet. Check faq 12.
Interesting, looking deeper. Is it possible to display dimensions in picas rather than pixels?
Quote from: rambo3 on July 05, 2017, 03:38:13 PM
Is it possible to display dimensions in picas rather than pixels?
No, not by default, but you could for instance create a custom tag to do that for you. Then again, you can do this in the spreadsheet quite easily too, of course.
Why do you want picas anyway? They would also require you to take the pixels per inch into consideration and that could be a different number for each image. Or do you want a default ppi to be used for the calculation for all images?
Quote from: Hayo Baan on July 05, 2017, 04:22:35 PM.
They would also require you to take the pixels per inch into consideration and that could be a different number for each image. Or do you want a default ppi to be used for the calculation for all images?
I was looking into this as best I could on mobile and found a post on Adobe's forum that used 72 as the default res. which seems reasonable.
More here:
https://www.prepressure.com/design/basics/points
Since the DTP revolution, a PostScript point of 1/72in has become the "standard", however this was not always so (so 12 points in a pica, 6 picas to the inch).
As a start point:
exiftool -ICCProfileName -FileName -csv 'INPUT_DIR_or_FILE_PATH' > 'OUTPUT_PATH_and_FILENAME.csv'
You may also be able to use -ProfileDescription instead of -ICCProfileName
Some files may not contain "print size" metadata, so there may only be a width/height value in pixels... To find what tags are in your files you can use:
exiftool -a -G1 -s 'path/to/file or directory'
(Win OS would use straight double quote marks " rather than single, no need for quote marks if there are no word spaces in the file path or name)
So, adding -ImageWidth -ImageHeight would include the pixel dimensions:
exiftool -ICCProfileName -FileName -ImageWidth -ImageHeight -csv 'INPUT_DIR_or_FILE_PATH' > 'OUTPUT_PATH_and_FILENAME.csv'
Here's my attempt at a Pica config file. It creates an XPica and YPica tag. If ResolutionUnit is not defined, it assumes inches. If X/YResolution are not defined, it assumes 72, which can be changed by altering the $DefaultRes variables in both spots in the config file.
This is a subject I am completely unfamiliar with, so if I've made a mistake, please let me know. I've taken the Image Width/Height, divided that the X/Y Resolution. That should give me inches (or cm if defined as such by ResolutionUnit). That is then divided by 6 as there are 6 picas/inch, from what I've read. If the ResolutionUnit is cm, then it's divided by 2.362 (6 pica/inch and 2.54 cm/inch, 6/2.54=2.362).
To use it, the very first option must be -config /path/to/Pica.Config.
Edit: updated to correct error 'cuz math R hard
Edit: second update, fixed error where I assumed variable was printConv value. Now should handle centimeter ResolutionUnit properly.
Hey everyone,
Thanks so much for all of the replies. Unfortunately, I haven't been able to devote time to this today but hopefully will be able to dig in deeper tomorrow.
Regarding picas: I'm working at a Publisher and that's the standard unit of measure here. It makes certain things much more difficult than they would be otherwise. >:(
StarGeek,
For my test image (1890x1417px), the size is 16x12cm / 6.3x4.723in / 453.6x340.1pt / 37.8x28.34picas @ 300ppi
The config file is generating the following:
X Pica : 1.05
Y Pica : 0.787222222222222
When my expectation is: 37.8x28.34
OK, I had to change the base unit for both the X and Y to:
my $Pica2In=0.167;
my $Pica2Cm=0.42;
Then the (close to expected values of 37.8x28.34 as defined by Adobe Photoshop) result was returned:
X Pica : 37.7245508982036
Y Pica : 28.2834331337325
Yeah, I see my mistake now. I divided where I should have multiplied. The other way to fix would be to change the return lines:
return ($val[2]/$Res * ($val[1] eq 'cm' ? $Pica2Cm : $Pica2In ) );
Much better than my hack StarGeek!
Stephen, can you figure out what Photoshop uses as a default res for files that don't have X/YResolution? It'd be nice to fix up the config to default to that.
Hi StarGeek, I believe that the answer to life, the universe and everything = 72 (42 was apparently a misquote)!
You had already assumed the same as Adobe, so all good there I think!
Thank you.
Hello Everyone,
i have a similar issue, but instead of pica i need my information to be in centimeters.
is that possible?
from what i understand i need to first of all invoke the config file so my command line would look something like this
exiftool -config C:\Windows\exiftool\cent.config -csv -ext tif C:\Users\Tiago.Lima\Desktop\folder\ > C:\Users\Tiago.Lima\Desktop\folder\dimensions.csv
however this is all new to me and i cant figure out how to adapt the pica.config to what i need which would be something like cent.config
thank you all in advance
I haven't tested it out, but try this attachment.
Also, you may want to add -xcm -ycm to your command if you only want to extract the resolution information.
- Phil
thank you!
i'll try it out and report back
thanks for the support
just tested it, and worked like a charm.
thanks a lot
however i get a little glitch for some reason, some of the values appear without the comma which makes them a complete different size that they acctually are.
any reason for that to happen?
kind regards, and once again thanks in advance
What comma are you talking about?
i attached the csv to the previous post
all values should be something like 20.47 or 88.56 something like that
however some results appear as 2047 or 8856
Can you tell me what is the output of this command for one of these files?:
exiftool -xresolution -yresolution -resolutionunit -xcm -ycm -G1 FILE
- Phil
the ouput is:
[IFD0] X Resolution : 300
[IFD0] Y Resolution : 300
[IFD0] Resolution Unit : inches
Sorry, I should have added the -config option to the command. Also, please add -imagewidth -imageheight.
The resolutions look OK, so I don't yet understand what could be happening.
- Phil
c:\Windows\exiftool>exiftool -config C:\Windows\exiftool\CM.config -xresolution -yresolution -resolutionunit -imagewidth -imageheight -xcm -ycm -G1 C:\Users\Tiago.Lima\Desktop\teste2\image_21.tif
[IFD0] X Resolution : 300
[IFD0] Y Resolution : 300
[IFD0] Resolution Unit : inches
[IFD0] Image Width : 2494
[IFD0] Image Height : 3516
[Composite] X Cm : 21.1158666666667
[Composite] Y Cm : 29.7688
i really cant understand why this would happen in just a few results
There is nothing wrong with the Xcm and Ycm values here. What is the difference between this and your command to generate the CSV output?
- Phil
c:\Windows\exiftool>exiftool -config C:\Windows\exiftool\CM.config -xresolution -yresolution -resolutionunit -imagewidth -imageheight -xcm -ycm -G1 C:\Users\Tiago.Lima\Desktop\teste2\image_25.tif
[IFD0] X Resolution : 300
[IFD0] Y Resolution : 300
[IFD0] Resolution Unit : inches
[IFD0] Image Width : 3525
[IFD0] Image Height : 4985
[Composite] X Cm : 29.845
[Composite] Y Cm : 42.2063333333333
so in this case i have a image 29.84x42.21 however the csv has the following
SourceFile XCm YCm
C:/Users/Tiago.Lima/Desktop/teste2/image_25.tif 29845 42.2063333333333
where the ycm is correct but the xcm does not have the comma.
I'm still confused. First, what you have shown is not the output of the -csv option from ExifTool. Second, it is a decimal point that is missing, not a comma.
- Phil
sorry i said comma because thats what we use in portugal.
but yes what is not happering in all the csv line is the decimal point.
what can i do to have the output that you need?
Add the -csv option to the last command. But I'm guessing that this output will be fine, and that the problem is in importing the file into whatever spreadsheet you are using.
- Phil
i had already tried that, and the output was fine, thats why i was so confused on what could be the problem, im using openoffice to open the .csv generated.
c:\Windows\exiftool>exiftool -config C:\Windows\exiftool\CM.config -xresolution -yresolution -resolutionunit -imagewidth -imageheight -csv -xcm -ycm -G1 C:\Users\Tiago.Lima\Desktop\teste2\image_25.tif
SourceFile,IFD0:XResolution,IFD0:YResolution,IFD0:ResolutionUnit,IFD0:ImageWidth,IFD0:ImageHeight,Composite:XCm,Composite:YCm
C:/Users/Tiago.Lima/Desktop/teste2/image_25.tif,300,300,inches,3525,4985,29.845,42.2063333333333
has it appears in the line but not how it appears in the .csv :-\
Yup. Sorry. I was asking the wrong questions because I thought you had a problem with ExifTool. I think you need some help with OpenOffice to figure out this problem.
- Phil
yeah thats what i figured, just tought you might have seen something like this before.
i'll try to figure out whats going on, and if so ill get back to you
much appriciated for everything
Tiago
Phil,
I think the problem really was from open office, i tried a simple csv viewer and everything appear as it should.
however it requires me to open the file with one software and then paste it to another and thats ok but if i wanted to try and see if the problem could be solved changing from cm to mm i could just edit the file you sent me and where its my $Cm2In=2.54; i could change it to my $Mm2In=25.4;
Kind regards
I haven't responded to this post because you haven't asked a question. But since you have copied this to me twice in personal messages it seems you are waiting for a response.
What can I help you with?
- Phil
Phil,
Sorry to bother you.
My question was, in order to have the data displayed in MM instead of CM, i tried to change my $Cm2In=2.54 to my $Mm2In=25.4;but that didnt solve it, do i need to make any more changes?
Kind Regards
You would also have to change "Cm2In" to "Mm2In" everywhere it appears in the file.
- Phil
Good Morning Phil,
I hope you had a merry christmas and a happy new year
Sorry to bother you again regarding this matter.
i attached my modifications to change the CM to MM can you check it out and maybe point out what im doing wrong.
kind regards
There was a bug in the original Pica.config and hence my Cm.config as well. I have fixed this bug and done the conversion to mm properly (all that was needed was to multiply by 10).
Attached is a config file that should do what you want.
- Phil
Quote from: Phil Harvey on January 03, 2018, 07:16:50 AM
There was a bug in the original Pica.config
Pica, Pica*
* Translation: Sad StarGeek sorry, has updated config in original post.
Thank you Phil,
I've been away from the office and just now had the chance to try it out and worked like a charm.
Many thanks