happytiff
Advanced tools
Comparing version 0.3.0 to 0.3.1
20
index.js
@@ -1,3 +0,4 @@ | ||
var omnivore = require('mapnik-omnivore'); | ||
var Raster = require('mapnik-omnivore/lib/raster'); | ||
var util = require('util'); | ||
var fs = require('fs'); | ||
var sm = new (require('sphericalmercator'))(); | ||
@@ -15,7 +16,18 @@ var EXTENT = 20037508.342789244; | ||
function info(filepath, callback) { | ||
omnivore.digest(filepath, afterDigest); | ||
function afterDigest(err, info) { | ||
fs.stat(filepath, afterStat); | ||
function afterStat(err, stat) { | ||
if (err) return callback(err); | ||
try { | ||
var ds = new Raster(filepath); | ||
} catch(err) { | ||
return callback(err); | ||
} | ||
ds.getExtent(afterExtent); | ||
} | ||
function afterExtent(err, extent) { | ||
if (err) return callback(err); | ||
var zxy; | ||
try { zxy = fromExtent(info.extent); } | ||
try { zxy = fromExtent(extent); } | ||
catch(err) { return callback(err); } | ||
@@ -22,0 +34,0 @@ return callback(null, zxy); |
{ | ||
"name": "happytiff", | ||
"version": "0.3.0", | ||
"version": "0.3.1", | ||
"description": "Utility to detect/verify happytiffs", | ||
@@ -8,3 +8,3 @@ "main": "index.js", | ||
"dependencies": { | ||
"mapnik-omnivore": "~6.2.0", | ||
"mapnik-omnivore": "6.2.0", | ||
"minimist": "1.1.x", | ||
@@ -11,0 +11,0 @@ "sphericalmercator": "1.0.x" |
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
51485
75
2
Updatedmapnik-omnivore@6.2.0