Node.js image manipulation on Azure websites

Con risposta Node.js image manipulation on Azure websites

  • 2012年7月24日 17:30
     
     
    I am currently developing a site using Node.js and I am looking at Azure web sites to deploy it on. The site will need to upload user submitted photos, perform basic manipulation on them (at the moment size them down), and then store them. In my development environment I am currently have GraphicsMagic installed because it has a good node library for using it, but I have also seen good support for ImageMagic in Node. I am wondering if Azure websites have anything that Node can use for image manipulation, or if it possible to install one of the mentioned programs.

全部回复

  • 2012年7月25日 10:50
    版主
     
     

    Hi,

    Does these 3rd-party components need install in Windows Server? or just some library files? I think you can deploy the Node.js application with components (Perhaps create a folder for them) on local server to see if works, if yes, you can deploy it on Azure Web site. If not, perhaps you need create an Azure Virtual Machine for achieving your goal.

    Hope this helps.


    Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact msdnmg@microsoft.com Microsoft One Code Framework

  • 2012年7月25日 12:47
     
     
    The programs that I mentioned need installing. I want to use websites instead of the Virtual Machines for the time being if possible. I am hoping that someone may have a solution or another way of doing image manipulation in Node. If it is really not possible then I may look at the VM's but that is really last resort.
  • 2012年7月26日 5:34
    版主
     
     已答复

    Hi,

    Try to find a Node.js image processing library that doesn’t require installation. You may also want to check out this thread: http://stackoverflow.com/questions/4653433/using-a-net-dll-in-node-js-serverside-javascript. Apparently, you can invoke COM components written in C++ (and even in C# with some additional work) from Node.js. Inside the COM component, you can use Windows Imaging Components to process bitmap images, and use Direct2D to process vector graphics. Those features are built into every copy of Windows, so you don’t need to install anything. Actually they themselves expose some COM interfaces. So you don’t actually need to write your own COM component. You can try to invoke them directly inside the Node.js code.

    Hope this helps.


    Please mark the replies as answers if they help or unmark if not. If you have any feedback about my replies, please contact msdnmg@microsoft.com Microsoft One Code Framework


  • 2012年7月26日 20:00
     
     
    Thanks very much for this response! I will have a look through this tonight and let you know if I get it working.
  • 2012年7月29日 2:21
     
     
    I found a few node "addons" for image manipulation that use C/C++ to do the image manipulation instead of requiring any 3rd party software installed. However they rely on the node-waf  wrapper which is not supported in Windows. It's looking like short of writing my own addon (which I am not in a position to do since I am not familiar with the process and languages needed) it will not be possible for me to do image manipulation on an Azure website running node. But that is not saying it is not possible at all, given the correct knowledge it seems very possible.