@GaG No it wasn't the issue, else is not in parenthesis so it's gonna execute anyway. I know that's not the ideal code :P
P.S- the above guy's solution worked.
How to reduce image size using BAS
BAS master please help me !!
Thanks all
UP
@Royal-Russia said in How to reduce image size using BAS:
How to reduce image size using BAS
BAS master please help me !!
Thanks all

@Royal-Russia if you need to compress a image, you can use node.js libraries (sharp and etc)
const sharp = require('sharp')
const data = await sharp('./test.jpeg')
.jpeg({ quality: 30 })
.toFile('./test.jpeg')
@Royal-Russia said in How to reduce image size using BAS:
@Fox I need to reduce image size, not resize it :(
Have you checked the work of this action?

Result:
Test script: 2755.xml
or did you mean to degrade the quality in order to reduce the file size?