New fx numerical only file size in Bytes without the B

Announcements pertaining to ImageMagick, or ImageMagick related software. This list is moderated. No discussions here, instead post to the users group instead.
Post Reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

New fx numerical only file size in Bytes without the B

Post by fmw42 »

As of IM 6.9.10-6 and 7.0.8-6, there is an fx term for the numerical file size in Bytes without the B. It is called "extent". So now one can do

Code: Select all

convert rose: -format "%[fx:extent]\n" info:
9673

Code: Select all

convert logo: -format "%[fx:extent]\n" info:
28576

Code: Select all

convert logo: rose: -format "%[fx:u.extent>v.extent?1:0]\n" info:
1
1

If using two images, you will get 0 or 1 two times. So at least in Unix, you can do

Code: Select all

convert  logo: rose: -format "%[fx:u.extent>v.extent?1:0]\n" info: | head -n 1
1
Post Reply