Skip to content
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

URL generator doesn't work #515

Closed
MaximKitsenko opened this issue May 3, 2024 · 2 comments
Closed

URL generator doesn't work #515

MaximKitsenko opened this issue May 3, 2024 · 2 comments

Comments

@MaximKitsenko
Copy link

MaximKitsenko commented May 3, 2024

Type of issue

[ x] Bug
[ ] Question (e.g. about handling/usage)
[ ] Request for new feature/improvement

Expected Behavior

generation svg qr code from URL, when trying to scan it appears corrupted

Current Behavior

Possible Solution (optional)

Steps to Reproduce (for bugs)

  1.  ```
    

var qrGenerator = new QRCodeGenerator();
Url generator = new Url($"http://localhost:5021/api/dishes/f275207a-bd72-4d25-b67e-430b4c03a744/tenant-104");
string plainText = generator.ToString();
QRCodeData qrCodeData = qrGenerator.CreateQrCode(plainText, QRCodeGenerator.ECCLevel.Q);
var qrCode = new SvgQRCode(qrCodeData);
var qrCodeAsSvg = qrCode.GetGraphic(20);

	// saving
	
	var fileName = qrCodeExternalId.ExternalId + ".svg";
	string uploadFolderPath = refInfoTenantId.ToString();
	var relativePath = Path.Combine(uploadFolderPath, fileName);
	string uploadBaseFolderPath = "C:\\uploads\\";
	var filePath = Path.Combine(uploadBaseFolderPath, relativePath);

	using var stream = new FileStream(filePath, FileMode.Create);
	using var streamW = new StreamWriter(stream);
	streamW.Write(qrCodeAsSvg);
		
		2) Scan qr Code with iphone 14pro camera, receive just "localhost"

## Your Environment
<!--
Include as many relevant details about the environment you experienced the bug in.  

* Version used:  "QRCoder" Version="1.5.1"
* Compiled from source or NuGet package?: 
* Payload/Encoded text:  
* Used payload generator:  
* Used ECC-level:  
* Used renderer class:  
* Environment (.NET 3.5, .NET 4.X, .NETCore, ...):  net8, Windows10 home
-->
@MaximKitsenko
Copy link
Author

It was shoed in camera like local host, but in reality it contains all parameters

@codebude
Copy link
Owner

codebude commented May 3, 2024

Glad you could solve your problem.

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

2 participants