如何使用ImageMagick转换字幕功能打印反斜杠?

问题描述 投票:0回答:1

我正在尝试打印非常简单的内容

The double quotes "
The single quote '
The backslash \
And 2x backslashes \\

我正在使用此命令

convert -size 600x600 -gravity center -pointsize 30 caption:"The double quotes \"\nThe single quote \'\nThe backslash \\ \nAnd 2x backslashes \\\\" out.jpg

并获得此结果:

Image output

问题是转义的反斜杠无法正常工作

我尝试使用单引号而不是像这样的double运行命令:

convert -size 600x600 -gravity center -pointsize 30 caption:'The double quot...

但是我不知道如何转义单引号'。我确实知道这很简单,但我没有其他想法。

imagemagick imagemagick-convert caption
1个回答
0
投票

我认为您可以按照自己的意愿去做:

convert -size 600x600 -gravity center -pointsize 30 caption:'The double quotes \"\nThe single quote '"'"'\nThe backslash \\ \nAnd 2x backslashes \\\\' out.jpg

enter image description here

© www.soinside.com 2019 - 2024. All rights reserved.