diff --git a/README.mux b/README.mux index e70921ae..3c58c56c 100644 --- a/README.mux +++ b/README.mux @@ -26,7 +26,6 @@ A list of options is available using the -help command line flag: Usage: webpmux -get GET_OPTIONS INPUT -o OUTPUT webpmux -set SET_OPTIONS INPUT -o OUTPUT webpmux -strip STRIP_OPTIONS INPUT -o OUTPUT - webpmux -frgm FRAGMENT_OPTIONS [-frgm...] -o OUTPUT webpmux -frame FRAME_OPTIONS [-frame...] [-loop LOOP_COUNT] [-bgcolor BACKGROUND_COLOR] -o OUTPUT webpmux -info INPUT @@ -38,7 +37,6 @@ GET_OPTIONS: icc Get ICC profile. exif Get EXIF metadata. xmp Get XMP metadata. - frgm n Get nth fragment. frame n Get nth frame. SET_OPTIONS: @@ -56,12 +54,6 @@ STRIP_OPTIONS: exif Strip EXIF metadata. xmp Strip XMP metadata. -FRAGMENT_OPTIONS(i): - Create fragmented image. - file_i +xi+yi - where: 'file_i' is the i'th fragment (WebP format), - 'xi','yi' specify the image offset for this fragment. - FRAME_OPTIONS(i): Create animation. file_i +di+xi+yi+mi diff --git a/examples/webpmux.c b/examples/webpmux.c index f51de34c..341def4b 100644 --- a/examples/webpmux.c +++ b/examples/webpmux.c @@ -17,12 +17,6 @@ /* Usage examples: Create container WebP file: - webpmux -frgm fragment_1.webp +0+0 \ - -frgm fragment_2.webp +960+0 \ - -frgm fragment_3.webp +0+576 \ - -frgm fragment_4.webp +960+576 \ - -o out_fragment_container.webp - webpmux -frame anim_1.webp +100+10+10 \ -frame anim_2.webp +100+25+25+1 \ -frame anim_3.webp +100+50+50+1 \ @@ -52,6 +46,10 @@ webpmux -version */ +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + #include #include #include @@ -185,6 +183,9 @@ static WebPMuxError DisplayInfo(const WebPMux* mux) { uint32_t flag; WebPMuxError err = WebPMuxGetFeatures(mux, &flag); +#ifndef WEBP_EXPERIMENTAL_FEATURES + if (flag & FRAGMENTS_FLAG) err = WEBP_MUX_INVALID_ARGUMENT; +#endif RETURN_IF_ERROR("Failed to retrieve features\n"); if (flag == 0) { @@ -272,7 +273,9 @@ static void PrintHelp(void) { printf("Usage: webpmux -get GET_OPTIONS INPUT -o OUTPUT\n"); printf(" webpmux -set SET_OPTIONS INPUT -o OUTPUT\n"); printf(" webpmux -strip STRIP_OPTIONS INPUT -o OUTPUT\n"); +#ifdef WEBP_EXPERIMENTAL_FEATURES printf(" webpmux -frgm FRAGMENT_OPTIONS [-frgm...] -o OUTPUT\n"); +#endif printf(" webpmux -frame FRAME_OPTIONS [-frame...] [-loop LOOP_COUNT]" "\n"); printf(" [-bgcolor BACKGROUND_COLOR] -o OUTPUT\n"); @@ -286,7 +289,9 @@ static void PrintHelp(void) { printf(" icc Get ICC profile.\n"); printf(" exif Get EXIF metadata.\n"); printf(" xmp Get XMP metadata.\n"); +#ifdef WEBP_EXPERIMENTAL_FEATURES printf(" frgm n Get nth fragment.\n"); +#endif printf(" frame n Get nth frame.\n"); printf("\n"); @@ -306,6 +311,7 @@ static void PrintHelp(void) { printf(" exif Strip EXIF metadata.\n"); printf(" xmp Strip XMP metadata.\n"); +#ifdef WEBP_EXPERIMENTAL_FEATURES printf("\n"); printf("FRAGMENT_OPTIONS(i):\n"); printf(" Create fragmented image.\n"); @@ -313,6 +319,7 @@ static void PrintHelp(void) { printf(" where: 'file_i' is the i'th fragment (WebP format),\n"); printf(" 'xi','yi' specify the image offset for this fragment." "\n"); +#endif printf("\n"); printf("FRAME_OPTIONS(i):\n"); @@ -596,6 +603,7 @@ static int ParseCommandLine(int argc, const char* argv[], arg->params_ = argv[i + 1]; ++feature_arg_index; i += 2; +#ifdef WEBP_EXPERIMENTAL_FEATURES } else if (!strcmp(argv[i], "-frgm")) { CHECK_NUM_ARGS_LESS(3, ErrParse); if (ACTION_IS_NIL || config->action_type_ == ACTION_SET) { @@ -612,6 +620,7 @@ static int ParseCommandLine(int argc, const char* argv[], arg->params_ = argv[i + 2]; ++feature_arg_index; i += 3; +#endif } else if (!strcmp(argv[i], "-o")) { CHECK_NUM_ARGS_LESS(2, ErrParse); config->output_ = argv[i + 1]; @@ -660,8 +669,12 @@ static int ParseCommandLine(int argc, const char* argv[], } else { ++i; } +#ifdef WEBP_EXPERIMENTAL_FEATURES } else if ((!strcmp(argv[i], "frame") || !strcmp(argv[i], "frgm")) && +#else + } else if (!strcmp(argv[i], "frame") && +#endif (config->action_type_ == ACTION_GET)) { CHECK_NUM_ARGS_LESS(2, ErrParse); feature->type_ = (!strcmp(argv[i], "frame")) ? FEATURE_ANMF : diff --git a/man/webpmux.1 b/man/webpmux.1 index d2c2d1b6..393c3f82 100644 --- a/man/webpmux.1 +++ b/man/webpmux.1 @@ -1,5 +1,5 @@ .\" Hey, EMACS: -*- nroff -*- -.TH WEBPMUX 1 "February 26, 2013" +.TH WEBPMUX 1 "March 16, 2013" .SH NAME webpmux \- command line tool to create WebP Mux/container file. .SH SYNOPSIS @@ -21,11 +21,6 @@ webpmux \- command line tool to create WebP Mux/container file. .B \-o .I OUTPUT .br -.B webpmux \-frgm -.I FRAGMENT_OPTIONS -.B [ \-frgm ... ] \-o -.I OUTPUT -.br .B webpmux \-frame .I FRAME_OPTIONS .B [ \-frame ... ] [ \-loop @@ -64,9 +59,6 @@ Get EXIF metadata. .B xmp Get XMP metadata. .TP -.BI frgm " n -Get nth fragment. -.TP .BI frame " n Get nth frame. @@ -98,12 +90,6 @@ Strip EXIF metadata. .B xmp Strip XMP metadata. -.SS FRAGMENT_OPTIONS (\-frgm) -.TP -.I file_i +xi+yi -Where: 'file_i' is the i'th fragment (WebP format) and 'xi','yi' specify the -image offset for this fragment. - .SS FRAME_OPTIONS (\-frame) .TP .I file_i +di[+xi+yi[+mi]] @@ -163,18 +149,13 @@ webpmux \-get exif exif_container.webp \-o image_metadata.exif .br webpmux \-strip exif exif_container.webp \-o without_exif.webp .br -webpmux \-frame anim_1.webp +0+0+0 \-frame anim_2.webp +50+50+0 \-loop 10 +webpmux \-frame anim_1.webp +100 \-frame anim_2.webp +100+50+50 \-loop 10 .br .RS 8 \-bgcolor 255,255,255,255 \-o anim_container.webp .RE .br webpmux \-get frame 2 anim_container.webp \-o frame_2.webp -.br -webpmux \-tile tile_1.webp +0+0 \-tile tile_2.webp +960+0 \-tile tile_3.webp -+0+576 \-tile tile_4.webp +960+576 \-o tile_container.webp -.br -webpmux \-get tile 2 tile_container.webp \-o tile_2.webp .SH AUTHORS \fBwebpmux\fP is written by the WebP team.