Escaping qoutes while annotating

Questions and postings pertaining to the development of ImageMagick, feature enhancements, and ImageMagick internals. ImageMagick source code and algorithms are discussed here. Usage questions which are too arcane for the normal user list should also be posted here.
Post Reply
abhishekv1

Escaping qoutes while annotating

Post by abhishekv1 »

Hi,

I am trying to annotate text over an image.
Th text is:
Let's meet

But it's not getting annotated properly even after escaping.
I am doing:
-annotate 0x0+0+0 'Let\'s Meet'
This works :
-annotate 0x0+0+0 "Let\'s Meet"

But mine is a program in Php where user can enter text and using convert I annotate the text on the image. So user can enter single qoutes or double qoutes, I need a way so that the qoutes are escaped perfectly. Is there a solution ?

The IM version I am using is 6.2.7.

Regards,
Abhishek
User avatar
anthony
Posts: 8883
Joined: 2004-05-31T19:27:03-07:00
Authentication code: 8675308
Location: Brisbane, Australia

Post by anthony »

Your problem is technically a PHP problem not IM.
Even so I have some example sof quoting text (for shell) in IM Examples, Drawing Section.
http://www.cit.gu.edu.au/~anthony/graph ... w/#special

This may be of help, though it isn't PHP specific.
Anthony Thyssen -- Webmaster for ImageMagick Example Pages
https://imagemagick.org/Usage/
abhishekv1

Post by abhishekv1 »

Hi,

Thx for the link. It was a great help.
My problem was not of PHP...I was parsing the special characters
in PHP but was not able to parse in IM while making the convert command
and hitting the system call. Basically I was using annotate and was not
able to parse single quotes (') and backslashes(\); the link you sent was
a great help. My problem is solved now.

Thanks,
Regards,
Abhishek
Post Reply