Output wild card use in PHP exec

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
gweiss27
Posts: 12
Joined: 2015-07-06T13:46:15-07:00
Authentication code: 1151

Output wild card use in PHP exec

Post by gweiss27 »

Maybe you can help me with one more thing. I'm trying to dynamically name my files with numbering but I can't get the wildcards to work.

This is my EXEC code:
  • $new_file = $dir_name . '/' . $file_name_base . '_Page_';

    $cmd = '/usr/local/bin/convert ' .
    ' -density ' . $compression .
    ' -profile USWebCoatedSWOP.icc ' .
    $file_name .
    ' -profile sRGB_v4_ICC_preference.icc ' .
    ' -scene 1' .
    ' -trim ' .
    ' -resize x1732 ' .
    ' -quality ' . $compressQuality .
    ' ' . $new_file . '%+02d'. $ext;
but this is what I get out.

EvilErnie_04_Page_%+02d-1.jpg

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

Re: Output wild card use in PHP exec

Post by fmw42 »

'%+02d
try %02d without the +
Post Reply