mirror of
https://github.com/chillerlan/php-qrcode.git
synced 2026-08-17 12:33:09 +00:00
🚿
This commit is contained in:
+7
-4
@@ -259,8 +259,12 @@ class QRCode{
|
||||
$eciCharset = new ECICharset($encoding);
|
||||
// get charset name
|
||||
$eciCharsetName = $eciCharset->getName();
|
||||
|
||||
if($eciCharsetName === null){
|
||||
throw new QRCodeException('unable to add ECI segment');
|
||||
}
|
||||
|
||||
// convert the string to the given charset
|
||||
if($eciCharsetName !== null){
|
||||
$data = mb_convert_encoding($data, $eciCharsetName, mb_internal_encoding());
|
||||
|
||||
if($data === false){
|
||||
@@ -273,11 +277,10 @@ class QRCode{
|
||||
;
|
||||
}
|
||||
|
||||
throw new QRCodeException('unable to add ECI segment');
|
||||
}
|
||||
|
||||
/**
|
||||
* Reads a QR Code from a given file
|
||||
*
|
||||
* @codeCoverageIgnore
|
||||
*/
|
||||
public function readFromFile(string $path):DecoderResult{
|
||||
return $this->readFromSource($this->luminanceSourceFQN::fromFile($path, $this->options));
|
||||
|
||||
Reference in New Issue
Block a user