Page 1 of 1

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

Posted: 2008-06-11T18:56:55-07:00
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.

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

Posted: 2008-06-11T20:20:52-07:00
by magick
Try
  • convert rose: -format "%b\n" info:

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

Posted: 2008-06-11T21:52:21-07:00
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$

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

Posted: 2008-06-12T06:56:34-07:00
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.

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

Posted: 2008-06-12T12:12:51-07:00
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