Turistforeningen / node-s3-uploader

Flexible and efficient resize, rename, and upload images to Amazon S3 disk storage. Uses the official AWS Node SDK for transfer, and ImageMagick for image processing. Support for multiple image versions targets.
https://www.npmjs.com/package/s3-uploader
MIT License
241 stars 54 forks source link

Error: Command failed: C:\WINDOWS\system32\cmd.exe #77

Open erezger opened 8 years ago

erezger commented 8 years ago

hello i am having this issue

{ [Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "identify -format "name=
size=%[size]
format=%m
colorspace=%[colorspace]
height=%[height]
width=%[width]
orientation=%[orientation]
" /images/erez.jpg"
'identify' is not recognized as an internal or external command,
operable program or batch file.
]
  killed: false,
  code: 1,
  signal: null,
  cmd: 'C:\\WINDOWS\\system32\\cmd.exe /s /c "identify -format "name=\nsize=%[size]\nformat=%m\ncolorspace=%[colorspace]\nheight=%[height]\nwidth=%[width]\norientation=%[orientation]\n" /images/erez.jpg"' }

this is my code

var Upload = require('s3-uploader');
var im = require('imagemagick');
var client = new Upload('radiomize', {
  aws: {
    path: 'images/',
    region: 'eu-west-1',
    accessKeyId: 'key',
    secretAccessKey: 'key'
  }, 
  cleanup: {
    versions: true,
    original: false
  }, 
  original: {
    awsImageAcl: 'private'
  },
  versions: [{
    maxHeight: 1040,
    maxWidth: 1040,
    format: 'jpg',
    suffix: '-large',
    quality: 80,
    awsImageExpires: 31536000,
    awsImageMaxAge: 31536000
  },{
    maxWidth: 780,
    aspect: '3:2!h',
    suffix: '-medium'
  },{
    maxWidth: 320,
    aspect: '16:9!h',
    suffix: '-small'
  },{
    maxHeight: 100,
    aspect: '1:1',
    format: 'png',
    suffix: '-thumb1'
  },{
    maxHeight: 250,
    maxWidth: 250,
    aspect: '1:1',
    suffix: '-thumb2'
  }]
});
app.post('/upload', function(req, res) {
    client.upload('/images/erez.jpg', {  }, function(err, versions, meta) {
        if (err) { console.log(err); return; }
        versions.forEach(function(image) {
            console.log(image.width, image.height, image.url);
        });
    });
});

i was trying adding {mime: "image/jpeg" } also was trying to see if the image exist and it does exist

Please help me

i am saving the image by multer if its matter

Starefossen commented 8 years ago

Hi @erezger and thank you for using the s3-uploader library 😄

Could you post the following information in order to bets help you with this:

Starefossen commented 8 years ago

Make sure you have the latest version of ImageMagick installed since this package requires ImageMagick to be installed.

erezger commented 8 years ago

windows 10 64-bit operting system, x64-based processor latest imagemagick installed node - v4.4.3 npm - 2.15.1 imagemagick : "^0.1.3"

since you said this required imagemagick if uplaod this to amazon beanstalk ec2 server it will work?

Starefossen commented 8 years ago

You need to install the ImageMagick binaries for Windows

erezger commented 8 years ago

installed ImageMagick-7.0.1-7-Q16-x64-dll.exe and still not working

since you said this required imagemagick if uplaod this to amazon beanstalk ec2 server it will work?

Starefossen commented 8 years ago

Sorry for the late response @erezger! Could you open PowerShell and run the following command:

identify -version
erezger commented 8 years ago

'identify' is not recognized as an internal or external command, operable program or batch file.

Starefossen commented 8 years ago

You need to reinstall and make sure to check “Add application directory to your system path” in the installation, otherwise Windows won’t recognize any of the commands and tell you something like ‘convert’ is not recognized as an internal or external command, operable program or batch file.

imagemagick_install

erezger commented 8 years ago

its the default but i reinstalled and still the same error its weird i know Thanks for the effort apriciete that

gustavost26 commented 8 years ago

I'm having the same problem and can not solve.

Error: Command failed: C:\WINDOWS\system32\cmd.exe /s /c "identify -format "name= size=%[size] format=%m colorspace=%[colorspace] height=%[height] width=%[width] orientation=%[orientation]

Starefossen commented 8 years ago

@gustavost26 Could you open PowerShell and copy/paste the output from the following command:

identify -version
gustavost26 commented 8 years ago

And presented the following message: Version: ImageMagick 6.8.6-8 04/08/2013 Q16 http://www.imagemagick.org Copyright: Copyright (C) 1999-2013 ImageMagick Studio LLC Features: DPC OpenMP Delegates: bzlib djvu fftw fontconfig freetype jng jp2 jpeg lcms lzma OpenEXR pango png ps tiff webp x xml zlib

Starefossen commented 8 years ago

Thanks a lot @gustavost26, I am currently not on a Windows machine so I appreciate you helping me out. Could you try this approach suggested in aheckmann/gm#296:

process.env['PATH'] = "d:\\apps\\ImageMagick-6.8.9-Q16;" + process.env['PATH'];
gustavost26 commented 8 years ago

Thanks a lot.

jalal-haider-makki commented 7 years ago

In Windows identify command is not available. So, have to create a identify.cmd file in the installation folder of ImageMagick then add following content in it.

magick identify %*

mklled200 commented 4 years ago

C. C: \ Windows \ system32 \ cmd.exe Please help more than once but the same result [wf] Face type (f / wf / head?: he lp>: wf wf In] Write de bug images to aligned_debug? (y / n>: n Extracting faces ... Traceback (most recent call last): File "C: \ Users \ A1-Mawshor \ Documents \ ANYMP4 Studio \ Uideo \ DeepFaceLab_NUIDIAN_i ternalNDeepFaceLab \ main. py ", line 314, in arguments..func (arguments> File "C: NUsersNA1-Mawshor \ Documents \ ANYMP4 Studio \ Video \ DeepFaceLab_NUIDIAN_i ternalNDeepFaceLab \ main.py ", line 40, in