mirror of
https://github.com/DeviceFarmer/stf.git
synced 2026-04-18 16:13:24 +02:00
Rename "roles" to "units". Put units in their own folders.
This commit is contained in:
14
lib/units/storage/plugins/image/param/crop.js
Normal file
14
lib/units/storage/plugins/image/param/crop.js
Normal file
@@ -0,0 +1,14 @@
|
||||
var RE_CROP = /^([0-9]*)x([0-9]*)$/
|
||||
|
||||
module.exports = function(raw) {
|
||||
var parsed
|
||||
|
||||
if (raw && (parsed = RE_CROP.exec(raw))) {
|
||||
return {
|
||||
width: +parsed[1] || 0
|
||||
, height: +parsed[2] || 0
|
||||
}
|
||||
}
|
||||
|
||||
return null
|
||||
}
|
||||
Reference in New Issue
Block a user