Skip to content

Exemple avec AssetMapper #83

New issue

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

Open
JeDeveloppe opened this issue Jan 18, 2025 · 0 comments
Open

Exemple avec AssetMapper #83

JeDeveloppe opened this issue Jan 18, 2025 · 0 comments

Comments

@JeDeveloppe
Copy link

JeDeveloppe commented Jan 18, 2025

Hello,

Do you have an example using AssetMapper to find the logo path please ?
AssetMapper generate a fake link like that in public folder: assets/images/logoSite-nTKj4NV.png

My code in Service:
`
public function generateQrCodeWithLogo(string $fullUrl, string $logoPath)
{
$result = $this->customQrCodeBuilder->build(
data: $fullUrl,
margin: 0,
size: 250,
logoPath: $logoPath
);

    $response = new QrCodeResponse($result);

    return $response;
}

`

And my Controller:
$baseurl = $request->getScheme() . '://' . $request->getHttpHost() . $request->getBasePath(); $qrCode = $this->qrCodeService->generateQrCodeWithLogo('https://www.url.com',$baseurl.'/assets/images/logoSite-nTKj4NV.png'); $qrCodeImage = $qrCode->getContent();

But I have this error:
Could not read logo image data from path "https://127.0.0.1:8000/assets/images/logoSite-nTKj4NV.png": file_get_contents(https://127.0.0.1:8000/assets/images/logoSite-nTKj4NV.png): Failed to open stream: operation failed

If I paste the url in browser (https://127.0.0.1:8000/assets/images/logoSite-nTKj4NV.png) I see the image...

Thank you, sorry for my English and this disturbance !

René

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant