hello,

i have some  tif-files in a directory that i want to convert to jpg-files.

i take the tif-fles from the directory and place them in an array named $allTif

then i use a foreach loop for the array and  with each iteration the parameters 
for the exec() function are set and
the exec() function is called.

the only problem is: it does not work, and i can't understand why

the strange thing is: when i do not use variables but place the values hard 
coded
in the exec() function it works fine, like: 
exec(c:/apache/magick/ImageMagick/convert  image001.tif  -compress lzw  001.jpg)



----------------------------------- source code -----------------------------

foreach($allTif as $k => $v){
    
        /* replace extension from image */
        $newName = str_replace(".tif", '.jpg', $v);
        
        /* make conversion statement; */
        $conversie =  $v . " " . " -compress lzw " . " " . $newname; 
        
        /* execute conversion; */
        $plaatje = exec($convertPad . $conversie , $ok); 

}

---------------------------------------------------------------------------------------

when i echo the code i get:

------------------------- echo -----------------------------------
$allTif[0]=image001.tif
$allTif[1]=image002.tif
$allTif[2]=image003.tif
$allTif[3]=image004.tif
$allTif[4]=origineel.tif
$allTif[5]=tifplaatje.tif

$newName: image001.jpg
$conversie: image001.tif  -compress lzw 001.jpg
exec(c:/apache/magick/ImageMagick/convert  image001.tif  -compress lzw  001.jpg)

$newName: image002.jpg
$conversie: image002.tif  -compress lzw image002.jpg
exec(c:/apache/magick/ImageMagick/convert  image002.tif  -compress lzw 
image002.jpg )

(rest of the echo is just the same idea)
-----------------------------------------------------------------------------

so, my question is: how do i get this to work?

thanks
_______________________________________________
Magick-users mailing list
[email protected]
http://studio.imagemagick.org/mailman/listinfo/magick-users

Reply via email to