function serveImage(req, res){
    cloudant.use(req.params.dronename + '_images').attachment.get(req.params.docID, "image", function(err, image){
        if(err){
            logger.error(err.description);
            res.status(404).send("No image found");
        } else {
            res.set('Content-Type', 'image/jpeg').status(200).send(image);
        }
    });
}
/**
 * Serve image from Cloudant database
 * @param req {Object} The request from the client
 * @param req.params.docID {String} The requested document id
 * @param res {Object} The response for the client
 */
Serve image from Cloudant database
@param req {Object} The request from the client
@param req.params.docID {String} The requested document id
@param res {Object} The response for the client
Serve image from Cloudant database @param req { Object } The request from the client @param req . params . docID { String } The requested document id @param res { Object } The response for the client
function serveImage(req, res){
    cloudant.use(req.params.dronename + '_images').attachment.get(req.params.docID, "image", function(err, image){
        if(err){
            logger.error(err.description);
            res.status(404).send("No image found");
        } else {
            res.set('Content-Type', 'image/jpeg').status(200).send(image);
        }
    });
}
function serveImage ( req , res ) { cloudant . use ( req . params . dronename + '_images' ) . attachment . get ( req . params . docID , "image" , function ( err , image ) { if ( err ) { logger . error ( err . description ) ; res . status ( 404 ) . send ( "No image found" ) ; } else { res . set ( 'Content-Type' , 'image/jpeg' ) . status ( 200 ) . send ( image ) ; } } ) ; }
Serve image from Cloudant database
 @param req {Object} The request from the client
 @param req.params.docID {String} The requested document id
 @param res {Object} The response for the client
Serve image from Cloudant database @param req { Object } The request from the client @param req . params . docID { String } The requested document id @param res { Object } The response for the client