White spaces in file names

August 10, 2009 by nuno costa 4 comments

 

phMagick :: White spaces in file names

Depending on your OS you may get into problems if you have white spaces in file names.

phMagick does not check for correct paths, it’s completly dumb.

 

Is your responsability as developer to ensure the paths are correct

4 comments so far Add Your Comment

  1. by Mátyás Horváth on January 29 2010 at 23:47

    Hi Nuno,

    I try to integrate your ImageMagick php implementation into my webshop to crop images.
    So I found the output filename is always this: 2>&1

    Here is the little code to try:
    getDestination();
    $p->crop(100,100,50,50);
    echo ”;
    echo ”;
    ?>

    Not a complex one. Name “rotated.jpg” hasn’t any whitespace I know. So what is it, and why is it. Please help me.

    Thank you very much.
    Mátyás

  2. by Mátyás Horváth on January 29 2010 at 23:49

    hmmm, Something wrong…
    The whole script is:

    getDestination();
    $p->crop(100,100,50,50);
    echo ”;
    echo ”;
    ?>

  3. by Mátyás Horváth on January 29 2010 at 23:52

    Hey. First part of my script always croped!! (maybe you eliminate php tags)
    Last try:

    include “phmagick.php”;
    $p = new phMagick(“orig.jpg”,”rotated.jpg”);
    echo “Dest: ” . $p->getDestination();
    $p->crop(100,100,50,50);
    echo ”;
    echo ”;

  4. by nuno costa on February 7 2010 at 13:11

    @Mátyás Horváth

    this is really weird,

    the &2>1 at the end of the command should redirect the stderr to stdout so you can see any error messages from imagemagick

    it’s working well under unix and windows

    so what system are you using ?

More from francodacosta.com

© francodacosta.com - All rights reserved