imagelib.imageResize.js 497 B

123456789101112131415161718
  1. console.log("Image Resizing Test");
  2. //To test this, put a test.jpg on your desktop
  3. var srcPath = "user:/Desktop/test.jpg";
  4. var destPath = "user:/Desktop/output.jpg";
  5. //Require the image library
  6. var loaded = requirelib("imagelib");
  7. if (loaded) {
  8. //Library loaded. Call to the functions
  9. var success = imagelib.resizeImage(srcPath, destPath, 200, 0);
  10. if (success){
  11. sendResp("OK")
  12. }else{
  13. sendResp("Failed to resize image");
  14. }
  15. } else {
  16. console.log("Failed to load lib: imagelib");
  17. }