-composite with spacekey

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
Darknet
Posts: 18
Joined: 2014-01-15T10:52:19-07:00
Authentication code: 6789

-composite with spacekey

Post by Darknet » 2015-07-02T05:18:29-07:00

I need the -composite command with space. How do I that?

snibgo
Posts: 12428
Joined: 2010-01-23T23:01:33-07:00
Authentication code: 1151
Location: England, UK

Re: -composite with spacekey

Post by snibgo » 2015-07-02T06:59:38-07:00

I don't understand the question.
snibgo's IM pages: im.snibgo.com

Darknet
Posts: 18
Joined: 2014-01-15T10:52:19-07:00
Authentication code: 6789

Re: -composite with spacekey

Post by Darknet » 2015-07-02T08:48:52-07:00

I use from imagemagicx these Command:

/usr/bin/convert converting/size-0.jpg -quality 100% converting/logosafe/" . $piclog . " -gravity SouthEast -geometry +" . $pos . "+" . $pos . " -composite " . $gallerie . "/'" . $pic . "'"



If in the String oft he Varaiable $gallerie a space blank –composite does not work.

If the space blank a _ it works. But it must work with a space blank.

User avatar
fmw42
Posts: 25757
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: -composite with spacekey

Post by fmw42 » 2015-07-02T08:51:49-07:00

What version of IM and platform are you using? What is the interface -- PHP exec()? Perhaps this is an interface issue with quoting.

Why must it work with a space in " -composite "?

In any case, I do not think a space should make any problems inside a quote when parsed to the IM command line.

Should you not have spaces between . and " rather than in the quotes?

Darknet
Posts: 18
Joined: 2014-01-15T10:52:19-07:00
Authentication code: 6789

Re: -composite with spacekey

Post by Darknet » 2015-07-02T09:01:17-07:00

Version: ImageMagick 6.8.9-9 Q16 i686 2014-11-05

I use PHP yes.

It copy the pics in a file. These file is a Galleryname. And the galleryname can have spaces.

User avatar
fmw42
Posts: 25757
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: -composite with spacekey

Post by fmw42 » 2015-07-02T09:02:38-07:00

Filenames with spaces in them should be enclosed in double quotes. Try using "$gallerie" rather than $gallerie. If that does not work, check your variable $gallery to see that it does have all of the filename and and not just the first word.

canavan
Posts: 23
Joined: 2013-02-18T10:12:03-07:00
Authentication code: 6789

Re: -composite with spacekey

Post by canavan » 2015-07-06T07:36:20-07:00

If the gallery name is provided by the user in any way, this is a potential security problem. You may have to use escapeshellarg() on all arguments for which you are not absolutely certain that they don't contain characters that may be unsafe in the shell. Using imagick (http://php.net/manual/en/book.imagick.php) may be a better option.

Post Reply