yeahdongcn / RSBarcodes_Swift

1D and 2D barcodes reader and generators for iOS 8 with delightful controls. Now Swift.
MIT License
707 stars 185 forks source link

Target Size and QR Tags colorisation support #137

Closed mjrehder closed 4 years ago

mjrehder commented 4 years ago

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 commented 4 years ago

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%) :arrow_up:

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 commented 4 years ago

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 commented 4 years ago

Sorry to get back so late. Merged.

mjrehder commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

πŸŽ‰ Congrats

πŸš€ RSBarcodes_Swift (5.0.2) successfully published πŸ“… June 18th, 03:55 🌎 https://cocoapods.org/pods/RSBarcodes_Swift πŸ‘ Tell your friends!

sotrosh commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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.