iSammyC / webp

Automatically exported from code.google.com/p/webp
0 stars 0 forks source link

Adding many options to the cweb cli encoder #219

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Try adding many options to the cwebp command.
2. cwebp -q 80 -resize 200 -noalpha 1.png -0 1.webp
3.

What is the expected output? What do you see instead?

The expected output should scale the image to 200 by width and remove the alpha 
channel. But it does not. It just scales the image. Try this and also try 
adding more options.

What version of the product are you using? On what operating system?
Latest Version. Updated today.

Please provide any additional information below.

Original issue reported on code.google.com by siddhart...@gmail.com on 9 Sep 2014 at 11:14

GoogleCodeExporter commented 9 years ago
> -0 1.webp

That should be "-o", not "-0" (minus zero).

Anyhow, this works correctly if the second parameter of -resize isn't omitted.

This works as intended:

cwebp -q 80 -resize 200 0 -noalpha 1.png -o 1.webp

I'd say it should throw an error if either parameter isn't an integer. Right 
now it silently eats "-noalpha" and pretends that this was a 0 (= scale 
proportionally).

Original comment by googlegr...@kaioa.com on 9 Sep 2014 at 11:54

GoogleCodeExporter commented 9 years ago
Hey sorry it was a typo while I was posting to the forum. But i enter -o on
my command line.

Original comment by siddhart...@gmail.com on 10 Sep 2014 at 6:18

GoogleCodeExporter commented 9 years ago
Yeah I later figured it out. I saw in the docs that if second parameter is
omitted it will scale the image while keeping it in proper proportion.
Hence all the confusion. Docs will be updated right?

-resize width height

Resize the source to a rectangle with size width x height. If either (but
not both) of the width or height parameters is 0, the value will be
calculated preserving the aspect-ratio.

The above is from the docs.

On Wed, Sep 10, 2014 at 11:48 AM, Siddhartha R <siddhartharramesh@gmail.com>
wrote:

Original comment by siddhart...@gmail.com on 10 Sep 2014 at 6:20

GoogleCodeExporter commented 9 years ago
The docs don't say you can omit either, they say you can use a width or height 
of 0.

The docs are fine.

However, cwebp should check if those two arguments are actually integers. It 
should have told you that "-whatever" isn't an int.

Original comment by googlegr...@kaioa.com on 10 Sep 2014 at 11:32

GoogleCodeExporter commented 9 years ago
This is a good suggestion. There's a patch pending that should address this:

https://gerrit.chromium.org/gerrit/#/c/71527/

Original comment by jz...@google.com on 11 Sep 2014 at 6:20

GoogleCodeExporter commented 9 years ago
This has been merged, thanks again for the report!

e3b343e Merge "examples: warn on invalid numeric parameters"
96d43a8 examples: warn on invalid numeric parameters

Original comment by jz...@google.com on 12 Sep 2014 at 6:25

GoogleCodeExporter commented 9 years ago
Nice! Yeah I misread the omit part. It appeared confusing to me. Maybe I was in 
a hurry. But a feature to omit either of width or height is a good thing rather 
than explicitly setting it to zero. Thanks!

Too bad IOS and Safari still does not support webp. What is wrong with the 
world :(  

Original comment by siddhart...@gmail.com on 12 Sep 2014 at 12:53