Rdmtx 0.3.0 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ext/rdmtx/Rdmtx.c +10 -7
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 49789c8d196e1191e0c2d7a471558a4c9eab983d
|
4
|
+
data.tar.gz: 6353a4de5f854104eeff831019f60c90acb81ed6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: dac4d735441bd4d78d3ba3a6f55b1c6e554a01294a230efe54fb4106875ea84ea7a77d07b4191a95058d06c20ee1bc41e75eff2235e95fc836b2158116c43a0d
|
7
|
+
data.tar.gz: 1e20418d1b7c0822f7c7609a1677cfaeb93ae5eea328a2dcbb6b62507592f55fef6676192e136a59fc50b6a3c0cb49a34c8114b41958605e0ca63df975c6a6f4
|
data/ext/rdmtx/Rdmtx.c
CHANGED
@@ -84,33 +84,36 @@ static VALUE rdmtx_encode(int argc, VALUE * argv, VALUE self) {
|
|
84
84
|
|
85
85
|
VALUE string, margin, module, size;
|
86
86
|
VALUE safeString;
|
87
|
+
VALUE magickImageClass;
|
88
|
+
VALUE outputImage;
|
89
|
+
|
87
90
|
int safeMargin, safeModule, safeSize;
|
88
|
-
DmtxEncode * enc;
|
89
91
|
int width;
|
90
92
|
int height;
|
91
|
-
|
92
|
-
VALUE outputImage;
|
93
|
+
DmtxEncode * enc;
|
93
94
|
|
94
95
|
rb_scan_args(argc, argv, "13", &string,
|
95
96
|
&margin, &module, &size);
|
96
97
|
|
97
98
|
safeString = StringValue(string);
|
98
|
-
if(margin
|
99
|
+
if(NIL_P(margin)) {
|
99
100
|
safeMargin = 5;
|
100
101
|
} else {
|
101
102
|
safeMargin = NUM2INT(margin);
|
102
103
|
}
|
103
|
-
if(module
|
104
|
+
if(NIL_P(module)) {
|
104
105
|
safeModule = 5;
|
105
106
|
} else {
|
106
|
-
|
107
|
+
safeModule = NUM2INT(module);
|
107
108
|
}
|
108
|
-
if(size
|
109
|
+
if(NIL_P(size)) {
|
109
110
|
safeSize = DmtxSymbolSquareAuto;
|
110
111
|
} else {
|
111
112
|
safeSize = NUM2INT(size);
|
112
113
|
}
|
113
114
|
|
115
|
+
// printf("Margin = %d, Module = %d, Size = %d\n", safeMargin, safeModule, safeSize);
|
116
|
+
|
114
117
|
/* Create and initialize libdmtx structures */
|
115
118
|
enc = dmtxEncodeCreate();
|
116
119
|
|