possible bug in string formats in IM 6.4.1-6 Q16 HDRI

Post any defects you find in the released or beta versions of the ImageMagick software here. Include the ImageMagick version, OS, and any command-line required to reproduce the problem. Got a patch for a bug? Post it here.
Post Reply
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

possible bug in string formats in IM 6.4.1-6 Q16 HDRI

Post by fmw42 »

I notice that all string formats are now displayed to the terminal WITHOUT a new line at the end?

freds-mac-mini:~ fred$ convert rose: -format "%b" info:
9673freds-mac-mini:~ fred$

Is this intentional?

perhaps to avoid a new line character when saved to a variable?

such as with:

size=`convert rose: -format "%b" info:`

or if that would not matter, then it would be nice to have the new line displayed in the terminal for ease of reading.
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: possible bug in string formats in IM 6.4.1-6 Q16 HDRI

Post by magick »

Try
  • convert rose: -format "%b\n" info:
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug in string formats in IM 6.4.1-6 Q16 HDRI

Post by fmw42 »

Sorry, I don't mean to bug you as it is not a serious problem.

Yes, thanks, I knew I could do that. I just wanted to know if this is intended and will be this way even though there is still the inconsistency that I pointed out with respect to the difference between identify and convert, which I thought was going to be fixed in 6.4.1-6. See viewtopic.php?f=3&t=11389


freds-mac-mini:~ fred$ identify -format "%b" rose:
9673
freds-mac-mini:~ fred$


freds-mac-mini:~ fred$ convert rose: -format "%b" info:
9673freds-mac-mini:~ fred$
User avatar
magick
Site Admin
Posts: 11064
Joined: 2003-05-31T11:32:55-07:00

Re: possible bug in string formats in IM 6.4.1-6 Q16 HDRI

Post by magick »

The recent patch was intentional to normalize the output of the -format option for the convert and identify commands. If you feel the convert program should automatically include a newline, we can revert the patch.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: possible bug in string formats in IM 6.4.1-6 Q16 HDRI

Post by fmw42 »

From my point of view, identify and convert should report the same way, either with or without the new line. If I have a choice, I would make them both report to the terminal with a new line unless adding that would cause problems with making the results into a variable, e.g.

size=`convert <image> -format "%b" info:`

or

size=`identify -format "%b" <image>`

Note this includes fx escapes too, such as

convert rose: -format "%[pixel:u.p{0,0}]" info:

which now also have lost the new line.

But see what Anthony says, too.

Thanks for your consideration. Let me know what you guys decide.

Fred
Post Reply