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

Optimize QR Code Version Selection Based on URL Length #85

Open
ghost opened this issue Nov 9, 2023 · 0 comments
Open

Optimize QR Code Version Selection Based on URL Length #85

ghost opened this issue Nov 9, 2023 · 0 comments
Labels
enhancement New feature or request Later not planned for the initial release and are instead scheduled for a later version
Milestone

Comments

@ghost
Copy link

ghost commented Nov 9, 2023

Issue Description:
Currently, SmartyURL relies on a static QR Code version defined in the configuration file as Smartyurl.qrCodeVersion, with a default value of 7. However, it would be beneficial to dynamically determine the QR Code version based on the length of the URL.

Proposed Solution:
We should modify the function smarty_smart_detect_qrversion() located in Helpers/smarty_helper.php to automatically detect the length of the URL and select an appropriate QR Code version between 1 and 40. This dynamic approach will ensure that both short and long URLs are optimally encoded in QR Codes.

Steps to Implement:

  1. In the Helpers/smarty_helper.php file, update the smarty_smart_detect_qrversion() function to take the URL length into account.
  2. Calculate the length of the URL and use a conditional structure to determine the appropriate QR Code version.
  3. Ensure that the selected QR Code version is within the range of 1 to 40.
  4. Update the QR Code generation logic to use the dynamically determined version.

Expected Outcome:
By implementing this dynamic QR Code version selection based on URL length, we can optimize the QR Code generation process to accommodate both short and long URLs effectively.

Additional Information:

  • Consider testing the modified function with various URL lengths to validate its effectiveness.
  • Review and update the documentation to reflect these changes for future reference.

Please let me know if there are any additional details or specific guidelines for implementing this enhancement.

@mshannaq mshannaq added the enhancement New feature or request label Nov 9, 2023
@mshannaq mshannaq added this to the 1.0.0 milestone Dec 11, 2023
@mshannaq mshannaq added the Later not planned for the initial release and are instead scheduled for a later version label Dec 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Later not planned for the initial release and are instead scheduled for a later version
Projects
None yet
Development

No branches or pull requests

1 participant