Kenshin
Kenshin

Reputation: 159

How can I run this bat file?

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...

Upvotes: 0

Views: 49

Answers (1)

Marwi
Marwi

Reputation: 274

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

Upvotes: 2

Related Questions