mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-13 06:24:27 +02:00
add a 'format' field to WebPBitstreamFeatures
Change-Id: I79a688e4c34fb77527127bbdf4bc844efa6aa9a4
This commit is contained in:
committed by
James Zern
parent
dde91fde96
commit
86c0031eb2
@ -573,6 +573,10 @@ static const char* const kStatusMessages[] = {
|
||||
"UNSUPPORTED_FEATURE", "SUSPENDED", "USER_ABORT", "NOT_ENOUGH_DATA"
|
||||
};
|
||||
|
||||
static const char* const kFormatType[] = {
|
||||
"unspecified", "lossy", "lossless"
|
||||
};
|
||||
|
||||
int main(int argc, const char *argv[]) {
|
||||
int ok = 0;
|
||||
const char *in_file = NULL;
|
||||
@ -741,14 +745,18 @@ int main(int argc, const char *argv[]) {
|
||||
}
|
||||
|
||||
if (out_file != NULL) {
|
||||
fprintf(stderr, "Decoded %s. Dimensions: %d x %d%s. Now saving...\n",
|
||||
fprintf(stderr, "Decoded %s. Dimensions: %d x %d %s. Format: %s. "
|
||||
"Now saving...\n",
|
||||
in_file, output_buffer->width, output_buffer->height,
|
||||
bitstream->has_alpha ? " (with alpha)" : "");
|
||||
bitstream->has_alpha ? " (with alpha)" : "",
|
||||
kFormatType[bitstream->format]);
|
||||
ok = SaveOutput(output_buffer, format, out_file);
|
||||
} else {
|
||||
fprintf(stderr, "File %s can be decoded (dimensions: %d x %d)%s.\n",
|
||||
fprintf(stderr, "File %s can be decoded "
|
||||
"(dimensions: %d x %d %s. Format: %s).\n",
|
||||
in_file, output_buffer->width, output_buffer->height,
|
||||
bitstream->has_alpha ? " (with alpha)" : "");
|
||||
bitstream->has_alpha ? " (with alpha)" : "",
|
||||
kFormatType[bitstream->format]);
|
||||
fprintf(stderr, "Nothing written; "
|
||||
"use -o flag to save the result as e.g. PNG.\n");
|
||||
}
|
||||
|
Reference in New Issue
Block a user