topical media & game development

talk show tell print

mobile-query-three-www-images-plugins-convert.js / js



  #!/usr/bin/env node
  
  var dirname        = ".";
  var filenames        = require('fs').readdirSync(dirname);
  filenames        = filenames.filter(function(filename){
          return filename.match(/\-original\.png/);
  });
  
  filenames.forEach(function(filename){
          var newname        = filename.replace(/-original\./, '.');
          var cmdline        = "convert '"+filename+"' -resize 260x180 '"+newname+"'"
          console.log("running  "+cmdline)
          require('child_process').exec(cmdline);
  });
  


(C) Æliens 04/09/2009

You may not copy or print any of this material without explicit permission of the author or the publisher. In case of other copyright issues, contact the author.