vseventer/sharp-cli

Number specificity

Closed this issue · 4 comments

Expected positive integer for width but received 1204.9586776859503 of type number

Specify --help for available options

I'm getting this error in 1.13.1 — is it because of the crazy specificity I'm passing, and it's supposed to error like this, or is this a bug? 😅 I don't think this failed in earlier versions, but I'm having problems installing older versions on my new computer...

This looks like a sharp error - what command are you using @tmjoen?

Sorry for the late reply!

I fixed it by rounding my parameters, but this is an example of a command that errored for me:

-i input.jpg -o thumb/{name}{ext} --quality 85 --format jpg resize 266.58653846153845 \ 
--height 150.0 --fit inside -- extract 0 58.0 150.0 150.0

If i round resize to 267, it works :)

You can't resize to half pixels :)

Yes, I realize—but it didn't error in earlier versions, so I wanted to check if there was something else going on :)