Home > database >  How can I run this bat file?
How can I run this bat file?

Time:02-06

This code works properly if I put it directly on cmd:

magick img.jpg -alpha Set -virtual-pixel transparent -distort Perspective '0,0,0,0 0,1900,0,1900 900,0,900,200 900,900,900,900' img_x.jpg

However, if I put this code in a bat file, it doesn't work.

@echo off
Setlocal EnableDelayedExpansion
magick img.jpg -alpha Set -virtual-pixel transparent -distort Perspective '0,0,0,0 0,1900,0,1900 900,0,900,200 900,900,900,900' img_x.jpg

It gives this error:

magick: invalid list of numbers '-distort' 

How can I do this. Thanks...

CodePudding user response:

The argument for the -distort option needs to be enclosed in quotes.

@echo off
Setlocal EnableDelayedExpansion
magick img.jpg -alpha Set -virtual-pixel transparent -distort Perspective "0,0,0,0 0,1900,0,1900 900,0,900,200 900,900,900,900" img_x.jpg
  • Related