Skip to content

Commit

Permalink
bugfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kjell committed Nov 24, 2014
1 parent 652311e commit 39ec7c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions adapters/mia-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ function maxDimensionForImage(id, cb) {
rcli = require('redis').createClient()
rcli.hget('object:'+Math.floor(id/1000), id, function(err, json) {
var json = JSON.parse(json)
if(json.image == 'invalid') {
if(json == null || json.image == 'invalid') {
cb('invalid image')
} else {
cb(null, Math.max(json.image_width, json.image_height))
Expand All @@ -18,10 +18,10 @@ module.exports = function(imageId, options, callback) {
if(err) return callback(err)

var imageUrl = 'http://api.artsmia.org/images/'+imageId+'/'+maxDimension+'/full.jpg',
imageFile = options.imagedirectory + '/' + imageId + '.jpg'
imageFile = options.imagedirectory + imageId + '.jpg'

httpget.get({url: imageUrl}, imageFile, function(error, result) {
if(error || result == undefined) { return cb([error, result]) }
if(error || result == undefined) { return callback([error, result]) }

var saw = exec([options.tilesaw+'/tilesaw.sh', imageFile], function(err, out, code) {
if(code == 0) {
Expand Down
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,4 @@ app.get('/', manifest)

http.createServer(app).listen(process.env.PORT || 8887);
console.log('tilesaw running on ' + (process.env.PORT || 8887))
console.log('.')

0 comments on commit 39ec7c3

Please sign in to comment.