Closed dhrubo001 closed 9 years ago
The make
method only accepts the full file path.
So for your example you could do this:
public function getDecode(){
$image = Input::file('image');
$name = $image->getClientOriginalName();
$path = $image->getRealPath();
$result = ZbarDecoder::make($path); // accepts the full path
echo $result; // Outputs the decoded text
echo $result->format;
}
Sorry Bro, but still getting the error
$process = $this->processBuilder->getProcess(); try { $process->mustRun(); $this->result = new Result($process->getOutput()); } catch (ProcessFailedException $e) { switch($e->getProcess()->getExitCode()) { case 1: throw new \Exception('Bad arguments'); break; case 2:
Now my code is
public function getDecode(){
$image = Input::file('image');
$name = $image->getClientOriginalName();
$path = $image->getRealPath();
$result = ZbarDecoder::make($path);
echo $result; // Outputs the decoded text
echo $result->format;
}
I've just tried your exact code and it's working for me.
The 'Bad arguments' exit code 1 actually comes from zbarimg
If you see their documentation: http://linux.die.net/man/1/zbarimg
An error occurred while processing some image(s). This includes bad arguments, I/O errors and image handling errors from ImageMagick.
I would check you have ImageMagick installed correctly and it has read access to your tmp folder
Also if you have access to the command line / ssh. Try the calling zbarimg
to see if it works:
zbarimg -D <filepath>
Thank for your replies,
But friend can you provide me a complete zip of your code, that would be a real help. As i need a solution fast..
Thank YOu
There's no point me zipping my code as I'm using the same code as you posted and it works.
I made a couple of changes to the code recently, so run a composer update
see if that helps. If it still doesn't work please provide more information about your code envirnoment.
OK Thank you BRO...i will let you know soon
Controller