node-s3-uploader icon indicating copy to clipboard operation
node-s3-uploader copied to clipboard

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

Open erezger opened this issue 9 years ago • 16 comments

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

erezger avatar May 31 '16 09:05 erezger

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:

  • Operating system and version
  • Node.js version (node --version)
  • npm version (npm --version)
  • ImageMagick version (identify -version)

Starefossen avatar May 31 '16 09:05 Starefossen

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

Starefossen avatar May 31 '16 09:05 Starefossen

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?

erezger avatar May 31 '16 09:05 erezger

You need to install the ImageMagick binaries for Windows

Starefossen avatar May 31 '16 09:05 Starefossen

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?

erezger avatar May 31 '16 09:05 erezger

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

identify -version

Starefossen avatar Jun 06 '16 10:06 Starefossen

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

erezger avatar Jun 06 '16 10:06 erezger

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

Starefossen avatar Jun 06 '16 10:06 Starefossen

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

erezger avatar Jun 06 '16 10:06 erezger

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]

gustavost26 avatar Jul 06 '16 13:07 gustavost26

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

identify -version

Starefossen avatar Jul 06 '16 15:07 Starefossen

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

gustavost26 avatar Jul 06 '16 16:07 gustavost26

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'];

Starefossen avatar Jul 06 '16 18:07 Starefossen

Thanks a lot.

gustavost26 avatar Jul 06 '16 20:07 gustavost26

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 %*

jalal-haider-makki avatar Nov 03 '16 11:11 jalal-haider-makki

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

mklled200 avatar Apr 24 '20 04:04 mklled200