mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-26 13:48:21 +01:00
webpmux: DisplayInfo(): remove unnecessary error checks.
As WebPMuxCreate() would have succeeded by then, many of the calls cannot fail. Change-Id: I3220c59e9aa47c948da9f8741b4098c47b91a8fc
This commit is contained in:
parent
40ae3520b1
commit
54b8e3f6e2
@ -146,12 +146,6 @@ static const char* ErrorString(WebPMuxError err) {
|
||||
return err; \
|
||||
}
|
||||
|
||||
#define RETURN_IF_ERROR2(ERR_MSG, FORMAT_STR) \
|
||||
if (err != WEBP_MUX_OK) { \
|
||||
fprintf(stderr, ERR_MSG, FORMAT_STR); \
|
||||
return err; \
|
||||
}
|
||||
|
||||
#define RETURN_IF_ERROR3(ERR_MSG, FORMAT_STR1, FORMAT_STR2) \
|
||||
if (err != WEBP_MUX_OK) { \
|
||||
fprintf(stderr, ERR_MSG, FORMAT_STR1, FORMAT_STR2); \
|
||||
@ -184,7 +178,7 @@ static WebPMuxError DisplayInfo(const WebPMux* mux) {
|
||||
uint32_t flag;
|
||||
|
||||
WebPMuxError err = WebPMuxGetCanvasSize(mux, &width, &height);
|
||||
RETURN_IF_ERROR("Failed to retrieve canvas width/height.\n");
|
||||
assert(err == WEBP_MUX_OK); // As WebPMuxCreate() was successful earlier.
|
||||
printf("Canvas size: %d x %d\n", width, height);
|
||||
|
||||
err = WebPMuxGetFeatures(mux, &flag);
|
||||
@ -217,13 +211,13 @@ static WebPMuxError DisplayInfo(const WebPMux* mux) {
|
||||
if (is_anim) {
|
||||
WebPMuxAnimParams params;
|
||||
err = WebPMuxGetAnimationParams(mux, ¶ms);
|
||||
RETURN_IF_ERROR("Failed to retrieve animation parameters\n");
|
||||
assert(err == WEBP_MUX_OK);
|
||||
printf("Background color : 0x%.8X Loop Count : %d\n",
|
||||
params.bgcolor, params.loop_count);
|
||||
}
|
||||
|
||||
err = WebPMuxNumChunks(mux, id, &nFrames);
|
||||
RETURN_IF_ERROR2("Failed to retrieve number of %ss\n", type_str);
|
||||
assert(err == WEBP_MUX_OK);
|
||||
|
||||
printf("Number of %ss: %d\n", type_str, nFrames);
|
||||
if (nFrames > 0) {
|
||||
@ -262,21 +256,21 @@ static WebPMuxError DisplayInfo(const WebPMux* mux) {
|
||||
if (flag & ICCP_FLAG) {
|
||||
WebPData icc_profile;
|
||||
err = WebPMuxGetChunk(mux, "ICCP", &icc_profile);
|
||||
RETURN_IF_ERROR("Failed to retrieve the ICC profile\n");
|
||||
assert(err == WEBP_MUX_OK);
|
||||
printf("Size of the ICC profile data: %d\n", (int)icc_profile.size);
|
||||
}
|
||||
|
||||
if (flag & EXIF_FLAG) {
|
||||
WebPData exif;
|
||||
err = WebPMuxGetChunk(mux, "EXIF", &exif);
|
||||
RETURN_IF_ERROR("Failed to retrieve the EXIF metadata\n");
|
||||
assert(err == WEBP_MUX_OK);
|
||||
printf("Size of the EXIF metadata: %d\n", (int)exif.size);
|
||||
}
|
||||
|
||||
if (flag & XMP_FLAG) {
|
||||
WebPData xmp;
|
||||
err = WebPMuxGetChunk(mux, "XMP ", &xmp);
|
||||
RETURN_IF_ERROR("Failed to retrieve the XMP metadata\n");
|
||||
assert(err == WEBP_MUX_OK);
|
||||
printf("Size of the XMP metadata: %d\n", (int)xmp.size);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user