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

Target Size and QR Tags colorisation support #137

Merged
merged 2 commits into from Jun 18, 2020

Conversation

mjrehder
Copy link
Contributor

Target size was added to the interface in order to scale the resulting image before it is converted into an UIImage. Scaling a UIImage results in pixellation, so the change is done on the CIImage.

Setting stroke and fill colours did not apply to CIFilter generated code tags. This is now supported.

The code changes are backwards compatible.

@codecov-commenter
Copy link

Codecov Report

Merging #137 into master will increase coverage by 0.28%.
The diff coverage is 62.79%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #137      +/-   ##
==========================================
+ Coverage   51.94%   52.22%   +0.28%     
==========================================
  Files          22       22              
  Lines        1236     1256      +20     
==========================================
+ Hits          642      656      +14     
- Misses        594      600       +6     
Impacted Files Coverage Δ
Source/RSUnifiedCodeGenerator.swift 83.33% <60.00%> (ø)
Source/RSCodeGenerator.swift 45.45% <63.63%> (+3.38%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0118956...0ab6f3b. Read the comment docs.

@sotrosh
Copy link

sotrosh commented Jun 17, 2020

Great feature! Thank you. How can I use it in my project?
when I do
pod 'RSBarcodes_Swift'
it doesn't clone the feature above.

@yeahdongcn yeahdongcn merged commit 58baf74 into yeahdongcn:master Jun 18, 2020
@yeahdongcn
Copy link
Owner

Sorry to get back so late. Merged.

@mjrehder
Copy link
Contributor Author

Sorry to get back so late. Merged.

Thanks. Did you also push a new version to cocoapods (pod trunk push...) so that @sotrosh just can do a "pod 'RSBarcodes_Swift'" ?

@yeahdongcn
Copy link
Owner

Sorry to get back so late. Merged.

Thanks. Did you also push a new version to cocoapods (pod trunk push...) so that @sotrosh just can do a "pod 'RSBarcodes_Swift'" ?

No problem, working on it.

@yeahdongcn
Copy link
Owner


🎉 Congrats

🚀 RSBarcodes_Swift (5.0.2) successfully published
📅 June 18th, 03:55
🌎 https://cocoapods.org/pods/RSBarcodes_Swift
👍 Tell your friends!

@sotrosh
Copy link

sotrosh commented Jun 18, 2020

Thank you for merge. Unfortunately, it doesn't work as expected. When I'm trying:

result = RSUnifiedCodeGenerator.shared.generateCode("Text Example",machineReadableCodeObjectType: AVMetadataObject.ObjectType.qr.rawValue,
targetSize: CGSize(width: 1000, height: 1000))
debugPrint(result?.size)

size is

- width : 13.5
- height : 13.5

@mjrehder
Copy link
Contributor Author

Thank you for merge. Unfortunately, it doesn't work as expected. When I'm trying:

result = RSUnifiedCodeGenerator.shared.generateCode("Text Example",machineReadableCodeObjectType: AVMetadataObject.ObjectType.qr.rawValue,
targetSize: CGSize(width: 1000, height: 1000))
debugPrint(result?.size)

size is

- width : 13.5
- height : 13.5

Hmm. I just tested with version 5.0.2 in my own project and it still works... Need to have a deeper look into it. Did you try with other values? Is the image (even though it is small) a correct QR tag?

@mjrehder
Copy link
Contributor Author

Thank you for merge. Unfortunately, it doesn't work as expected. When I'm trying:

result = RSUnifiedCodeGenerator.shared.generateCode("Text Example",machineReadableCodeObjectType: AVMetadataObject.ObjectType.qr.rawValue,
targetSize: CGSize(width: 1000, height: 1000))
debugPrint(result?.size)

size is

- width : 13.5
- height : 13.5

Hmm. I just tested with version 5.0.2 in my own project and it still works... Need to have a deeper look into it. Did you try with other values? Is the image (even though it is small) a correct QR tag?

I tested it some more and did not encounter an issue (also tested with 1000x1000 and got an image of size 500x500pt in scale 2 == 1000x1000px).

@yeahdongcn
Copy link
Owner

Thank you for merge. Unfortunately, it doesn't work as expected. When I'm trying:

result = RSUnifiedCodeGenerator.shared.generateCode("Text Example",machineReadableCodeObjectType: AVMetadataObject.ObjectType.qr.rawValue,
targetSize: CGSize(width: 1000, height: 1000))
debugPrint(result?.size)

size is

- width : 13.5
- height : 13.5

Hmm. I just tested with version 5.0.2 in my own project and it still works... Need to have a deeper look into it. Did you try with other values? Is the image (even though it is small) a correct QR tag?

I tested it some more and did not encounter an issue (also tested with 1000x1000 and got an image of size 500x500pt in scale 2 == 1000x1000px).

Yeah, I tried the same thing in the sample code, it works as expected.

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

Successfully merging this pull request may close these issues.

None yet

4 participants