mirror of
https://github.com/webmproject/libwebp.git
synced 2025-02-13 07:22:52 +01:00
Mark fragment options as experimental in webpmux
This is to disallow any accidental creation/parsing of fragmented images by users. Change-Id: I970a4bd5ec5a522867b24a0c9efb45164ae67047
This commit is contained in:
parent
9b3db89473
commit
5dbd403029
@ -26,7 +26,6 @@ A list of options is available using the -help command line flag:
|
|||||||
Usage: webpmux -get GET_OPTIONS INPUT -o OUTPUT
|
Usage: webpmux -get GET_OPTIONS INPUT -o OUTPUT
|
||||||
webpmux -set SET_OPTIONS INPUT -o OUTPUT
|
webpmux -set SET_OPTIONS INPUT -o OUTPUT
|
||||||
webpmux -strip STRIP_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]
|
webpmux -frame FRAME_OPTIONS [-frame...] [-loop LOOP_COUNT]
|
||||||
[-bgcolor BACKGROUND_COLOR] -o OUTPUT
|
[-bgcolor BACKGROUND_COLOR] -o OUTPUT
|
||||||
webpmux -info INPUT
|
webpmux -info INPUT
|
||||||
@ -38,7 +37,6 @@ GET_OPTIONS:
|
|||||||
icc Get ICC profile.
|
icc Get ICC profile.
|
||||||
exif Get EXIF metadata.
|
exif Get EXIF metadata.
|
||||||
xmp Get XMP metadata.
|
xmp Get XMP metadata.
|
||||||
frgm n Get nth fragment.
|
|
||||||
frame n Get nth frame.
|
frame n Get nth frame.
|
||||||
|
|
||||||
SET_OPTIONS:
|
SET_OPTIONS:
|
||||||
@ -56,12 +54,6 @@ STRIP_OPTIONS:
|
|||||||
exif Strip EXIF metadata.
|
exif Strip EXIF metadata.
|
||||||
xmp Strip XMP 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):
|
FRAME_OPTIONS(i):
|
||||||
Create animation.
|
Create animation.
|
||||||
file_i +di+xi+yi+mi
|
file_i +di+xi+yi+mi
|
||||||
|
@ -17,12 +17,6 @@
|
|||||||
/* Usage examples:
|
/* Usage examples:
|
||||||
|
|
||||||
Create container WebP file:
|
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 \
|
webpmux -frame anim_1.webp +100+10+10 \
|
||||||
-frame anim_2.webp +100+25+25+1 \
|
-frame anim_2.webp +100+25+25+1 \
|
||||||
-frame anim_3.webp +100+50+50+1 \
|
-frame anim_3.webp +100+50+50+1 \
|
||||||
@ -52,6 +46,10 @@
|
|||||||
webpmux -version
|
webpmux -version
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include "config.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <assert.h>
|
#include <assert.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
@ -185,6 +183,9 @@ static WebPMuxError DisplayInfo(const WebPMux* mux) {
|
|||||||
uint32_t flag;
|
uint32_t flag;
|
||||||
|
|
||||||
WebPMuxError err = WebPMuxGetFeatures(mux, &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");
|
RETURN_IF_ERROR("Failed to retrieve features\n");
|
||||||
|
|
||||||
if (flag == 0) {
|
if (flag == 0) {
|
||||||
@ -272,7 +273,9 @@ static void PrintHelp(void) {
|
|||||||
printf("Usage: webpmux -get GET_OPTIONS INPUT -o OUTPUT\n");
|
printf("Usage: webpmux -get GET_OPTIONS INPUT -o OUTPUT\n");
|
||||||
printf(" webpmux -set SET_OPTIONS INPUT -o OUTPUT\n");
|
printf(" webpmux -set SET_OPTIONS INPUT -o OUTPUT\n");
|
||||||
printf(" webpmux -strip STRIP_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");
|
printf(" webpmux -frgm FRAGMENT_OPTIONS [-frgm...] -o OUTPUT\n");
|
||||||
|
#endif
|
||||||
printf(" webpmux -frame FRAME_OPTIONS [-frame...] [-loop LOOP_COUNT]"
|
printf(" webpmux -frame FRAME_OPTIONS [-frame...] [-loop LOOP_COUNT]"
|
||||||
"\n");
|
"\n");
|
||||||
printf(" [-bgcolor BACKGROUND_COLOR] -o OUTPUT\n");
|
printf(" [-bgcolor BACKGROUND_COLOR] -o OUTPUT\n");
|
||||||
@ -286,7 +289,9 @@ static void PrintHelp(void) {
|
|||||||
printf(" icc Get ICC profile.\n");
|
printf(" icc Get ICC profile.\n");
|
||||||
printf(" exif Get EXIF metadata.\n");
|
printf(" exif Get EXIF metadata.\n");
|
||||||
printf(" xmp Get XMP metadata.\n");
|
printf(" xmp Get XMP metadata.\n");
|
||||||
|
#ifdef WEBP_EXPERIMENTAL_FEATURES
|
||||||
printf(" frgm n Get nth fragment.\n");
|
printf(" frgm n Get nth fragment.\n");
|
||||||
|
#endif
|
||||||
printf(" frame n Get nth frame.\n");
|
printf(" frame n Get nth frame.\n");
|
||||||
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
@ -306,6 +311,7 @@ static void PrintHelp(void) {
|
|||||||
printf(" exif Strip EXIF metadata.\n");
|
printf(" exif Strip EXIF metadata.\n");
|
||||||
printf(" xmp Strip XMP metadata.\n");
|
printf(" xmp Strip XMP metadata.\n");
|
||||||
|
|
||||||
|
#ifdef WEBP_EXPERIMENTAL_FEATURES
|
||||||
printf("\n");
|
printf("\n");
|
||||||
printf("FRAGMENT_OPTIONS(i):\n");
|
printf("FRAGMENT_OPTIONS(i):\n");
|
||||||
printf(" Create fragmented image.\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(" where: 'file_i' is the i'th fragment (WebP format),\n");
|
||||||
printf(" 'xi','yi' specify the image offset for this fragment."
|
printf(" 'xi','yi' specify the image offset for this fragment."
|
||||||
"\n");
|
"\n");
|
||||||
|
#endif
|
||||||
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
printf("FRAME_OPTIONS(i):\n");
|
printf("FRAME_OPTIONS(i):\n");
|
||||||
@ -596,6 +603,7 @@ static int ParseCommandLine(int argc, const char* argv[],
|
|||||||
arg->params_ = argv[i + 1];
|
arg->params_ = argv[i + 1];
|
||||||
++feature_arg_index;
|
++feature_arg_index;
|
||||||
i += 2;
|
i += 2;
|
||||||
|
#ifdef WEBP_EXPERIMENTAL_FEATURES
|
||||||
} else if (!strcmp(argv[i], "-frgm")) {
|
} else if (!strcmp(argv[i], "-frgm")) {
|
||||||
CHECK_NUM_ARGS_LESS(3, ErrParse);
|
CHECK_NUM_ARGS_LESS(3, ErrParse);
|
||||||
if (ACTION_IS_NIL || config->action_type_ == ACTION_SET) {
|
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];
|
arg->params_ = argv[i + 2];
|
||||||
++feature_arg_index;
|
++feature_arg_index;
|
||||||
i += 3;
|
i += 3;
|
||||||
|
#endif
|
||||||
} else if (!strcmp(argv[i], "-o")) {
|
} else if (!strcmp(argv[i], "-o")) {
|
||||||
CHECK_NUM_ARGS_LESS(2, ErrParse);
|
CHECK_NUM_ARGS_LESS(2, ErrParse);
|
||||||
config->output_ = argv[i + 1];
|
config->output_ = argv[i + 1];
|
||||||
@ -660,8 +669,12 @@ static int ParseCommandLine(int argc, const char* argv[],
|
|||||||
} else {
|
} else {
|
||||||
++i;
|
++i;
|
||||||
}
|
}
|
||||||
|
#ifdef WEBP_EXPERIMENTAL_FEATURES
|
||||||
} else if ((!strcmp(argv[i], "frame") ||
|
} else if ((!strcmp(argv[i], "frame") ||
|
||||||
!strcmp(argv[i], "frgm")) &&
|
!strcmp(argv[i], "frgm")) &&
|
||||||
|
#else
|
||||||
|
} else if (!strcmp(argv[i], "frame") &&
|
||||||
|
#endif
|
||||||
(config->action_type_ == ACTION_GET)) {
|
(config->action_type_ == ACTION_GET)) {
|
||||||
CHECK_NUM_ARGS_LESS(2, ErrParse);
|
CHECK_NUM_ARGS_LESS(2, ErrParse);
|
||||||
feature->type_ = (!strcmp(argv[i], "frame")) ? FEATURE_ANMF :
|
feature->type_ = (!strcmp(argv[i], "frame")) ? FEATURE_ANMF :
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
.\" Hey, EMACS: -*- nroff -*-
|
.\" Hey, EMACS: -*- nroff -*-
|
||||||
.TH WEBPMUX 1 "February 26, 2013"
|
.TH WEBPMUX 1 "March 16, 2013"
|
||||||
.SH NAME
|
.SH NAME
|
||||||
webpmux \- command line tool to create WebP Mux/container file.
|
webpmux \- command line tool to create WebP Mux/container file.
|
||||||
.SH SYNOPSIS
|
.SH SYNOPSIS
|
||||||
@ -21,11 +21,6 @@ webpmux \- command line tool to create WebP Mux/container file.
|
|||||||
.B \-o
|
.B \-o
|
||||||
.I OUTPUT
|
.I OUTPUT
|
||||||
.br
|
.br
|
||||||
.B webpmux \-frgm
|
|
||||||
.I FRAGMENT_OPTIONS
|
|
||||||
.B [ \-frgm ... ] \-o
|
|
||||||
.I OUTPUT
|
|
||||||
.br
|
|
||||||
.B webpmux \-frame
|
.B webpmux \-frame
|
||||||
.I FRAME_OPTIONS
|
.I FRAME_OPTIONS
|
||||||
.B [ \-frame ... ] [ \-loop
|
.B [ \-frame ... ] [ \-loop
|
||||||
@ -64,9 +59,6 @@ Get EXIF metadata.
|
|||||||
.B xmp
|
.B xmp
|
||||||
Get XMP metadata.
|
Get XMP metadata.
|
||||||
.TP
|
.TP
|
||||||
.BI frgm " n
|
|
||||||
Get nth fragment.
|
|
||||||
.TP
|
|
||||||
.BI frame " n
|
.BI frame " n
|
||||||
Get nth frame.
|
Get nth frame.
|
||||||
|
|
||||||
@ -98,12 +90,6 @@ Strip EXIF metadata.
|
|||||||
.B xmp
|
.B xmp
|
||||||
Strip XMP metadata.
|
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)
|
.SS FRAME_OPTIONS (\-frame)
|
||||||
.TP
|
.TP
|
||||||
.I file_i +di[+xi+yi[+mi]]
|
.I file_i +di[+xi+yi[+mi]]
|
||||||
@ -163,18 +149,13 @@ webpmux \-get exif exif_container.webp \-o image_metadata.exif
|
|||||||
.br
|
.br
|
||||||
webpmux \-strip exif exif_container.webp \-o without_exif.webp
|
webpmux \-strip exif exif_container.webp \-o without_exif.webp
|
||||||
.br
|
.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
|
.br
|
||||||
.RS 8
|
.RS 8
|
||||||
\-bgcolor 255,255,255,255 \-o anim_container.webp
|
\-bgcolor 255,255,255,255 \-o anim_container.webp
|
||||||
.RE
|
.RE
|
||||||
.br
|
.br
|
||||||
webpmux \-get frame 2 anim_container.webp \-o frame_2.webp
|
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
|
.SH AUTHORS
|
||||||
\fBwebpmux\fP is written by the WebP team.
|
\fBwebpmux\fP is written by the WebP team.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user