Skip to content

Commit

Permalink
ensure ph.exit()
Browse files Browse the repository at this point in the history
  • Loading branch information
stygeo committed Dec 13, 2011
1 parent e073d95 commit 578243f
Show file tree
Hide file tree
Showing 155 changed files with 6,626 additions and 20 deletions.
46 changes: 26 additions & 20 deletions app.js
Expand Up @@ -50,30 +50,36 @@ app.get('/api/1.0/export/:format', function(req, res, next) {

page.render(output);

if(req.query.size) {
var split = req.query.size.split("x");
try {
if(req.query.size) {
var split = req.query.size.split("x");

if(split.length > 1) {
var size = {};
if(split.length > 1) {
var size = {};

size.width = parseInt(split[0]);
size.height = parseInt(split[1]);
var Fs = require('fs');
console.log(Fs.lstatSync(output));
im.resize({
srcPath: output,
dstPath: output,
width: size.width,
height: size.height
}, function(err,stdout,stderr){
if(err)
console.log(err);
else
console.log(size);
});
size.width = parseInt(split[0]);
size.height = parseInt(split[1]);
var Fs = require('fs');
console.log(Fs.lstatSync(output));
im.resize({
srcPath: output,
dstPath: output,
width: size.width,
height: size.height
}, function(err,stdout,stderr){
if(err)
console.log(err);
else
console.log(size);
});
}
}
} catch(err) {
console.log("Image magic failed resizing image: "+fileName);
} finally {
ph.exit();
}
ph.exit();

try {
res.send({
success: true,
Expand Down
1 change: 1 addition & 0 deletions node_modules/.bin/uglifyjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions node_modules/uglify-js/.gitignore

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 578243f

Please sign in to comment.