$image = "filename.gif";
if(substr($image,-3) == "gif")
{
$image_png = exec("command.com /c start gif2png filename.gif >NUL");
}
The above code produces filename.png
However, when I feed the output from the above to another script in real time, and try to use ImageCreateFromPNG() for editing the png picture, it produces this error "Unable to open '' for reading: Permission denied"
The php script, the gif and png images are all in the same folder.
I have a feeling the conversion from gif to png takes a couple of seconds, and hence the png image is not yet available by the time the second script kicks in.
Is there a way to pause a script for a second or two? Maybe that'll solve the problem.
TIA
Richie.