I am trying to see if my company can use Azure Functions to automate conversions of TIFF files to a number of JPG and PNG formats and sizes. I am using Functions with Node.js, but other languages could be used.
My problem is, that I can't get GraphicsMagick or ImageMagick to work on Functions. I used the normal procedures for installment using npm install.
It seems to install ok, and the module also seems to load, but nothing happens when I try to process a file. Nothing, as in no errors either.
var fs = require('fs'); var gm = require('gm');
module.exports = function (context, req) { context.log('Start...');
try { context.log('Looking for GM...'); context.log(require.resolve("gm")); } catch(e) { console.log("GM is not found"); process.exit(e.code); } gm('D:/home/site/wwwroot/HttpTriggerJS1/input/870003-02070-main-nfh.jpg') .resize(240, 240) .noProfile() .write('D:/home/site/wwwroot/HttpTriggerJS1/output/resize.jpg', function (err) { context.log('TEST'); if (!err) { context.log('done'); } } ); context.done(null, res); };
I'm not sure that it's even possible, but I haven't found any information that states that it can't.
So, can I use ImageMagick, GraphicsMagick or a third image converter in Functions? If yes, is there something special that I need to be aware of when installing?
Is there also a C# solution to this?