Page 1 of 1

Adding filesize to label?

Posted: 2017-11-07T02:54:15-07:00
by jessicaC
Hi everyone!

Is there a shortkey for filesize in imagemagic?

I currently add dimensions and filename for my label via the below code. But I'd also like to add filesize, if possible

Code: Select all

convert filename -set option:mylabel "%wx%h\n%f"...
I know it's possible with %b, but this way I get bytes. Any way to display size in MBs?

Re: Adding filesize to label?

Posted: 2017-11-07T03:13:37-07:00
by snibgo
IM will display the size in MB, if the file is large enough.

Code: Select all

f:\prose\PICTURES>%IM%convert toes.png -format %[size] info:
320KB

f:\prose\PICTURES>%IM%convert toes.png -format %b info:
320KB

f:\prose\PICTURES>%IM%convert AGA_1434_gms.tiff -format %b info:
174.1MB