We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
output example:
array:20 [▼ 0 => "file:///D:/www/tp6/public//images/test7.jpg (format: QR_CODE, type: ADDRESSBOOK):" 1 => "Raw result:" 2 => "BEGIN:VCARD" 3 => "VERSION:3.0" 4 => "FN:huang" 5 => "TEL:13913942792" 6 => "EMAIL:[email protected]" 7 => b"ADR:ÏÃÃż¯ÃÀ" 8 => "END:VCARD" 9 => "Parsed result:" 10 => "huang" 11 => b"ÏÃÃż¯ÃÀ" 12 => "13913942792" 13 => "[email protected]" 14 => "Found 4 result points." 15 => " Point 0: (345.5,293.5)" 16 => " Point 1: (345.5,104.5)" 17 => " Point 2: (534.5,104.5)" 18 => " Point 3: (521.0,280.0)" 19 => "" ]
PHPZxingDecoder.php function createImages set $imageValue = $output[$key+2]; will only get first line text
createImages
$imageValue = $output[$key+2];
The text was updated successfully, but these errors were encountered:
I suggest createImages change as below code:
private function createImages($output) { $image = array(); $valueStartIndex = null; $valueEndIndex = null; foreach ($output as $key => $singleLine) { if (preg_match('/\(format/', $singleLine)) { $imageInfo = $singleLine; $startPos = strpos($imageInfo, "(") + 1; $endPos = strpos($imageInfo, ")"); $dataStr = substr($imageInfo, $startPos, $endPos - $startPos); $dataExplode = explode(",", $dataStr); $contentFormat = explode(":", $dataExplode[0]); $format = $contentFormat[1]; $contentFormat = explode(":", $dataExplode[1]); $type = $contentFormat[1]; $valueStartIndex = $key + 2; $exploded = explode(" ", $singleLine); $imagePath = array_shift($exploded); } else if (preg_match('/No barcode found/', $singleLine)) { $exploded = explode(" ", $singleLine); $imagePath = array_shift($exploded); $image[] = new ZxingBarNotFound($imagePath, 101, "No barcode found"); } else if (preg_match('/Parsed result/', $singleLine)) { $valueEndIndex = $key; $valueArray = array_slice($output, $valueStartIndex, $valueEndIndex - $valueStartIndex); $imageValue = implode(' ', $valueArray); $image[] = new ZxingImage($imagePath, $imageValue, $format, $type); } } return $image; }
get imageValue from every Raw result to Parsed result, and use blank space join multi line text
Raw result
Parsed result
Sorry, something went wrong.
No branches or pull requests
output example:
PHPZxingDecoder.php function
createImages
set$imageValue = $output[$key+2];
will only get first line textThe text was updated successfully, but these errors were encountered: