[magick-users] Backslashes and percentage signs in image comments
Anthony Thyssen
anthony at griffith.edu.au
Thu Feb 15 21:25:15 CST 2007
Felix Hagemann on wrote...
| Hello,
| I try to add image comments that contain backslashes and/or percentage
| signs but I am not having much success. Consider the following
| example:
|
| $ convert -comment 'test\123\456\n%%w' logo: png:- | identify \
| -format '%c' png:-
|
| Its output for ImageMagick 6.2.3 and some earlier versions, which were
| available for testing:
|
| test\123\456
| 640
|
| For ImageMagick 6.2.4:
|
| test1346
| 641
|
VERIFIED as FAILING on the latest beta... IM v6.3.2-6 Feb 14 23:??
The escaping of escapes is failing!
=======8<--------
convert -version
Version: ImageMagick 6.3.2 02/15/07 Q16 http://www.imagemagick.org
Copyright: Copyright (C) 1999-2007 ImageMagick Studio LLC
convert -comment 'test\\123\\456\\n%%w' logo: png:- |\
identify -format '%c' png:-
test123456
640
=======8<--------
That last should have returned the exact string...
test\123\456\n%w
this is also failing with label...
=======8<--------
convert -label 'test\\123\\456\\n%%w' logo: png:- |\
identify -format '%l' png:-
test123456
640
=======8<--------
Trying this with the -set operator method, also fails..
=======8<--------
convert logo: -set comment 'test\\123\\456\\n%%w' png:- |\
identify -format '%c' png:-
test123456
640
convert logo: -set label 'test\\123\\456\\n%%w' png:- |\
identify -format '%l' png:-
test123456
640
=======8<--------
Continuing escape escaping with labels....
=======8<--------
convert -comment 'test' label:'test\\123\\456\\n%%c' x:
=======8<--------
Image reads...
=======8<--------
test\123\456
%c
=======8<--------
Which is correct for most things, but WRONG for the newline character
Without the escaped escapes however...
=======8<--------
convert -comment 'test' label:'test\123\456\n%c' x:
=======8<--------
Image reads
=======8<--------
test123456
test
=======8<--------
And that is CORRECT.
ASIDE: You can escape the special meaning of a '@' at the start of a
line with backslash, and that is working. Though the '@' special
meaning does not work for label or comment settings....
=======8<--------
echo "stdin" | convert label:'\@-' x:
=======8<--------
Anthony Thyssen ( System Programmer ) <A.Thyssen at griffith.edu.au>
-----------------------------------------------------------------------------
Shh! Be vewy vewy qwiwet. I'm hunting dose peskwey wuntime ewwors.
-----------------------------------------------------------------------------
Anthony's Home is his Castle http://www.cit.gu.edu.au/~anthony/
More information about the Magick-users
mailing list