New %B to show 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 %B to show file size in bytes without the B

Post by fmw42 »

Starting with IM 6.9.10.4 and IM 7.0.8.4, you can get the file size in bytes without the trailing B.

Code: Select all

convert lena.png -format "%B\n" info:
118327

Code: Select all

magick lena.png -format "%B\n" info:
118327
snibgo
Posts: 12159
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: New %B to show file size in bytes without the B

Post by snibgo »

Hooray! Can it be used in arithmetic expressions, eg:

Code: Select all

magick lena.png -format "%[fx:B>1000?1:0]" info:
snibgo's IM pages: im.snibgo.com
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: New %B to show file size in bytes without the B

Post by fmw42 »

Result seems to be 0. So it appears not, at least at this time.

Allowing this would be a nice addition. I will suggest it.
Post Reply