You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
596 B
24 lines
596 B
'use strict';
|
|
|
|
|
|
var probeStream = require('./stream');
|
|
var probeHttp = require('./http');
|
|
|
|
/* eslint-disable consistent-return */
|
|
|
|
module.exports = function get_image_size(src, options) {
|
|
|
|
if (typeof src.on === 'function' && typeof src.emit === 'function') {
|
|
// looks like an EventEmitter, treating it as a stream
|
|
return probeStream(src, options);
|
|
}
|
|
|
|
// HTTP (not stream)
|
|
return probeHttp(src, options || {});
|
|
};
|
|
|
|
|
|
module.exports.parsers = require('./lib/parsers_stream');
|
|
module.exports.sync = require('./sync');
|
|
module.exports.Error = require('./lib/common').ProbeError;
|