@@ -164,44 +164,44 @@ object ImageAnalyzerAndroid {
164164 * Validate image against criteria
165165 */
166166 fun validate (bitmap : Bitmap , options : ReadableMap ): WritableMap {
167- val issues = Arguments .createArray()
167+ val errors = Arguments .createArray()
168168 var isValid = true
169169
170170 val width = bitmap.width
171171 val height = bitmap.height
172172
173173 // Check minimum dimensions
174174 if (options.hasKey(" minWidth" ) && width < options.getInt(" minWidth" )) {
175- issues .pushString(" Width ${width} is less than minimum ${options.getInt(" minWidth" )} " )
175+ errors .pushString(" Width ${width} is less than minimum ${options.getInt(" minWidth" )} " )
176176 isValid = false
177177 }
178178
179179 if (options.hasKey(" minHeight" ) && height < options.getInt(" minHeight" )) {
180- issues .pushString(" Height ${height} is less than minimum ${options.getInt(" minHeight" )} " )
180+ errors .pushString(" Height ${height} is less than minimum ${options.getInt(" minHeight" )} " )
181181 isValid = false
182182 }
183183
184184 // Check maximum dimensions
185185 if (options.hasKey(" maxWidth" ) && width > options.getInt(" maxWidth" )) {
186- issues .pushString(" Width ${width} exceeds maximum ${options.getInt(" maxWidth" )} " )
186+ errors .pushString(" Width ${width} exceeds maximum ${options.getInt(" maxWidth" )} " )
187187 isValid = false
188188 }
189189
190190 if (options.hasKey(" maxHeight" ) && height > options.getInt(" maxHeight" )) {
191- issues .pushString(" Height ${height} exceeds maximum ${options.getInt(" maxHeight" )} " )
191+ errors .pushString(" Height ${height} exceeds maximum ${options.getInt(" maxHeight" )} " )
192192 isValid = false
193193 }
194194
195195 // Check aspect ratio
196196 val aspectRatio = width.toDouble() / height.toDouble()
197197
198198 if (options.hasKey(" minAspectRatio" ) && aspectRatio < options.getDouble(" minAspectRatio" )) {
199- issues .pushString(" Aspect ratio $aspectRatio is less than minimum ${options.getDouble(" minAspectRatio" )} " )
199+ errors .pushString(" Aspect ratio $aspectRatio is less than minimum ${options.getDouble(" minAspectRatio" )} " )
200200 isValid = false
201201 }
202202
203203 if (options.hasKey(" maxAspectRatio" ) && aspectRatio > options.getDouble(" maxAspectRatio" )) {
204- issues .pushString(" Aspect ratio $aspectRatio exceeds maximum ${options.getDouble(" maxAspectRatio" )} " )
204+ errors .pushString(" Aspect ratio $aspectRatio exceeds maximum ${options.getDouble(" maxAspectRatio" )} " )
205205 isValid = false
206206 }
207207
@@ -214,7 +214,7 @@ object ImageAnalyzerAndroid {
214214 0.01
215215
216216 if (kotlin.math.abs(aspectRatio - required) > tolerance) {
217- issues .pushString(" Aspect ratio $aspectRatio does not match required $required (tolerance: $tolerance )" )
217+ errors .pushString(" Aspect ratio $aspectRatio does not match required $required (tolerance: $tolerance )" )
218218 isValid = false
219219 }
220220 }
@@ -223,13 +223,13 @@ object ImageAnalyzerAndroid {
223223 val channels = if (bitmap.hasAlpha()) 4 else 3
224224
225225 if (options.hasKey(" requiredChannels" ) && channels != options.getInt(" requiredChannels" )) {
226- issues .pushString(" Image has $channels channels but $${options.getInt(" requiredChannels" )} required" )
226+ errors .pushString(" Image has $channels channels but $${options.getInt(" requiredChannels" )} required" )
227227 isValid = false
228228 }
229229
230230 return Arguments .createMap().apply {
231231 putBoolean(" isValid" , isValid)
232- putArray(" issues " , issues )
232+ putArray(" errors " , errors )
233233 putInt(" width" , width)
234234 putInt(" height" , height)
235235 putInt(" channels" , channels)
0 commit comments