mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-26 05:38:22 +01:00
webpmux binary: Rename 'xmp' option to 'meta'
Change-Id: I00d7d2aa43ccb1e86b58e75e8677ea8ef7e1226e
This commit is contained in:
parent
ddfe871a51
commit
f6c096aad3
16
README.mux
16
README.mux
@ -8,7 +8,7 @@ Description:
|
|||||||
============
|
============
|
||||||
|
|
||||||
WebP Mux: library to create a WebP container object for features like
|
WebP Mux: library to create a WebP container object for features like
|
||||||
color profile, XMP metadata, animation & tiling. A reference command line
|
color profile, metadata, animation & tiling. A reference command line
|
||||||
tool 'webpmux' and WebP container specification 'doc/webp-container-spec.txt'
|
tool 'webpmux' and WebP container specification 'doc/webp-container-spec.txt'
|
||||||
are also provided in this package.
|
are also provided in this package.
|
||||||
|
|
||||||
@ -33,21 +33,21 @@ Usage: webpmux -get GET_OPTIONS INPUT -o OUTPUT
|
|||||||
GET_OPTIONS:
|
GET_OPTIONS:
|
||||||
Extract relevant data.
|
Extract relevant data.
|
||||||
icc Get ICCP Color profile.
|
icc Get ICCP Color profile.
|
||||||
xmp Get XMP metadata.
|
meta Get XMP/EXIF metadata.
|
||||||
tile n Get nth tile.
|
tile n Get nth tile.
|
||||||
frame n Get nth frame.
|
frame n Get nth frame.
|
||||||
|
|
||||||
SET_OPTIONS:
|
SET_OPTIONS:
|
||||||
Set color profile/metadata.
|
Set color profile/metadata.
|
||||||
icc file.icc Set ICC Color profile.
|
icc file.icc Set ICC Color profile.
|
||||||
xmp file.xmp Set XMP metadata.
|
meta file.meta Set XMP/EXIF metadata.
|
||||||
where: 'file.icc' contains the color profile to be set,
|
where: 'file.icc' contains the color profile to be set,
|
||||||
'file.xmp' contains the metadata to be set
|
'file.meta' contains the metadata to be set
|
||||||
|
|
||||||
STRIP_OPTIONS:
|
STRIP_OPTIONS:
|
||||||
Strip color profile/metadata.
|
Strip color profile/metadata.
|
||||||
icc Strip ICCP color profile.
|
icc Strip ICCP color profile.
|
||||||
xmp Strip XMP metadata.
|
meta Strip XMP/EXIF metadata.
|
||||||
|
|
||||||
TILE_OPTIONS(i):
|
TILE_OPTIONS(i):
|
||||||
Create tiled image.
|
Create tiled image.
|
||||||
@ -67,9 +67,9 @@ INPUT & OUTPUT are in webp format.
|
|||||||
WebP Mux API:
|
WebP Mux API:
|
||||||
==============
|
==============
|
||||||
The WebP Mux API contains methods for adding data to and reading data from
|
The WebP Mux API contains methods for adding data to and reading data from
|
||||||
WebPMux (a WebP container object). This API currently supports XMP metadata,
|
WebPMux (a WebP container object). This API currently supports XMP/EXIF
|
||||||
color profile, animation & tiling. Other features will be added in subsequent
|
metadata, ICC color profile, animation & tiling. Other features will be added in
|
||||||
releases.
|
subsequent releases.
|
||||||
|
|
||||||
Example#1 (pseudo code): Creating a WebPMux object with image data, color
|
Example#1 (pseudo code): Creating a WebPMux object with image data, color
|
||||||
profile & XMP metadata.
|
profile & XMP metadata.
|
||||||
|
@ -31,17 +31,17 @@
|
|||||||
-o out_animation_container.webp
|
-o out_animation_container.webp
|
||||||
|
|
||||||
webpmux -set icc image_profile.icc in.webp -o out_icc_container.webp
|
webpmux -set icc image_profile.icc in.webp -o out_icc_container.webp
|
||||||
webpmux -set xmp image_metadata.xmp in.webp -o out_xmp_container.webp
|
webpmux -set meta image_metadata.meta in.webp -o out_meta_container.webp
|
||||||
|
|
||||||
Extract relevant data from WebP container file:
|
Extract relevant data from WebP container file:
|
||||||
webpmux -get tile n in.webp -o out_tile.webp
|
webpmux -get tile n in.webp -o out_tile.webp
|
||||||
webpmux -get frame n in.webp -o out_frame.webp
|
webpmux -get frame n in.webp -o out_frame.webp
|
||||||
webpmux -get icc in.webp -o image_profile.icc
|
webpmux -get icc in.webp -o image_profile.icc
|
||||||
webpmux -get xmp in.webp -o image_metadata.xmp
|
webpmux -get meta in.webp -o image_metadata.meta
|
||||||
|
|
||||||
Strip data from WebP Container file:
|
Strip data from WebP Container file:
|
||||||
webpmux -strip icc in.webp -o out.webp
|
webpmux -strip icc in.webp -o out.webp
|
||||||
webpmux -strip xmp in.webp -o out.webp
|
webpmux -strip meta in.webp -o out.webp
|
||||||
|
|
||||||
Misc:
|
Misc:
|
||||||
webpmux -info in.webp
|
webpmux -info in.webp
|
||||||
@ -81,7 +81,7 @@ typedef struct {
|
|||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
NIL_FEATURE = 0,
|
NIL_FEATURE = 0,
|
||||||
FEATURE_XMP,
|
FEATURE_META,
|
||||||
FEATURE_ICCP,
|
FEATURE_ICCP,
|
||||||
FEATURE_FRM,
|
FEATURE_FRM,
|
||||||
FEATURE_TILE
|
FEATURE_TILE
|
||||||
@ -242,8 +242,8 @@ static WebPMuxError DisplayInfo(const WebPMux* mux) {
|
|||||||
if (flag & META_FLAG) {
|
if (flag & META_FLAG) {
|
||||||
WebPData metadata;
|
WebPData metadata;
|
||||||
err = WebPMuxGetChunk(mux, "META", &metadata);
|
err = WebPMuxGetChunk(mux, "META", &metadata);
|
||||||
RETURN_IF_ERROR("Failed to retrieve the XMP metadata\n");
|
RETURN_IF_ERROR("Failed to retrieve the metadata\n");
|
||||||
printf("Size of the XMP metadata: %zu\n", metadata.size_);
|
printf("Size of the metadata: %zu\n", metadata.size_);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((flag & ALPHA_FLAG) && !(flag & (ANIMATION_FLAG | TILE_FLAG))) {
|
if ((flag & ALPHA_FLAG) && !(flag & (ANIMATION_FLAG | TILE_FLAG))) {
|
||||||
@ -270,7 +270,7 @@ static void PrintHelp(void) {
|
|||||||
printf("GET_OPTIONS:\n");
|
printf("GET_OPTIONS:\n");
|
||||||
printf(" Extract relevant data.\n");
|
printf(" Extract relevant data.\n");
|
||||||
printf(" icc Get ICCP Color profile.\n");
|
printf(" icc Get ICCP Color profile.\n");
|
||||||
printf(" xmp Get XMP metadata.\n");
|
printf(" meta Get XMP/EXIF metadata.\n");
|
||||||
printf(" tile n Get nth tile.\n");
|
printf(" tile n Get nth tile.\n");
|
||||||
printf(" frame n Get nth frame.\n");
|
printf(" frame n Get nth frame.\n");
|
||||||
|
|
||||||
@ -278,15 +278,15 @@ static void PrintHelp(void) {
|
|||||||
printf("SET_OPTIONS:\n");
|
printf("SET_OPTIONS:\n");
|
||||||
printf(" Set color profile/metadata.\n");
|
printf(" Set color profile/metadata.\n");
|
||||||
printf(" icc file.icc Set ICC Color profile.\n");
|
printf(" icc file.icc Set ICC Color profile.\n");
|
||||||
printf(" xmp file.xmp Set XMP metadata.\n");
|
printf(" meta file.meta Set XMP/EXIF metadata.\n");
|
||||||
printf(" where: 'file.icc' contains the color profile to be set,\n");
|
printf(" where: 'file.icc' contains the color profile to be set,\n");
|
||||||
printf(" 'file.xmp' contains the metadata to be set\n");
|
printf(" 'file.meta' contains the metadata to be set\n");
|
||||||
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
printf("STRIP_OPTIONS:\n");
|
printf("STRIP_OPTIONS:\n");
|
||||||
printf(" Strip color profile/metadata.\n");
|
printf(" Strip color profile/metadata.\n");
|
||||||
printf(" icc Strip ICCP color profile.\n");
|
printf(" icc Strip ICCP color profile.\n");
|
||||||
printf(" xmp Strip XMP metadata.\n");
|
printf(" meta Strip XMP/EXIF metadata.\n");
|
||||||
|
|
||||||
printf("\n");
|
printf("\n");
|
||||||
printf("TILE_OPTIONS(i):\n");
|
printf("TILE_OPTIONS(i):\n");
|
||||||
@ -430,7 +430,7 @@ static int ValidateCommandLine(int argc, const char* argv[],
|
|||||||
|
|
||||||
assert(ok == 1);
|
assert(ok == 1);
|
||||||
if (num_frame_args == 0 && num_tile_args == 0) {
|
if (num_frame_args == 0 && num_tile_args == 0) {
|
||||||
// Single argument ('set' action for XMP or ICCP, OR a 'get' action).
|
// Single argument ('set' action for META or ICCP, OR a 'get' action).
|
||||||
*num_feature_args = 1;
|
*num_feature_args = 1;
|
||||||
} else {
|
} else {
|
||||||
// Multiple arguments ('set' action for animation or tiling).
|
// Multiple arguments ('set' action for animation or tiling).
|
||||||
@ -570,10 +570,10 @@ static int ParseCommandLine(int argc, const char* argv[],
|
|||||||
ERROR_GOTO1("ERROR: Action must be specified before other arguments.\n",
|
ERROR_GOTO1("ERROR: Action must be specified before other arguments.\n",
|
||||||
ErrParse);
|
ErrParse);
|
||||||
}
|
}
|
||||||
if (!strcmp(argv[i], "icc") || !strcmp(argv[i], "xmp")) {
|
if (!strcmp(argv[i], "icc") || !strcmp(argv[i], "meta")) {
|
||||||
if (FEATURETYPE_IS_NIL) {
|
if (FEATURETYPE_IS_NIL) {
|
||||||
feature->type_ = (!strcmp(argv[i], "icc")) ? FEATURE_ICCP :
|
feature->type_ = (!strcmp(argv[i], "icc")) ? FEATURE_ICCP :
|
||||||
FEATURE_XMP;
|
FEATURE_META;
|
||||||
} else {
|
} else {
|
||||||
ERROR_GOTO1("ERROR: Multiple features specified.\n", ErrParse);
|
ERROR_GOTO1("ERROR: Multiple features specified.\n", ErrParse);
|
||||||
}
|
}
|
||||||
@ -764,10 +764,10 @@ static int Process(const WebPMuxConfig* config) {
|
|||||||
}
|
}
|
||||||
ok = WriteData(config->output_, &color_profile);
|
ok = WriteData(config->output_, &color_profile);
|
||||||
break;
|
break;
|
||||||
case FEATURE_XMP:
|
case FEATURE_META:
|
||||||
err = WebPMuxGetChunk(mux, "META", &metadata);
|
err = WebPMuxGetChunk(mux, "META", &metadata);
|
||||||
if (err != WEBP_MUX_OK) {
|
if (err != WEBP_MUX_OK) {
|
||||||
ERROR_GOTO2("ERROR (%s): Could not get XMP metadata.\n",
|
ERROR_GOTO2("ERROR (%s): Could not get the metadata.\n",
|
||||||
ErrorString(err), Err2);
|
ErrorString(err), Err2);
|
||||||
}
|
}
|
||||||
ok = WriteData(config->output_, &metadata);
|
ok = WriteData(config->output_, &metadata);
|
||||||
@ -858,7 +858,7 @@ static int Process(const WebPMuxConfig* config) {
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case FEATURE_XMP:
|
case FEATURE_META:
|
||||||
ok = CreateMux(config->input_, &mux);
|
ok = CreateMux(config->input_, &mux);
|
||||||
if (!ok) goto Err2;
|
if (!ok) goto Err2;
|
||||||
ok = ReadFileToWebPData(feature->args_[0].filename_, &metadata);
|
ok = ReadFileToWebPData(feature->args_[0].filename_, &metadata);
|
||||||
@ -866,7 +866,7 @@ static int Process(const WebPMuxConfig* config) {
|
|||||||
err = WebPMuxSetChunk(mux, "META", &metadata, 1);
|
err = WebPMuxSetChunk(mux, "META", &metadata, 1);
|
||||||
free((void*)metadata.bytes_);
|
free((void*)metadata.bytes_);
|
||||||
if (err != WEBP_MUX_OK) {
|
if (err != WEBP_MUX_OK) {
|
||||||
ERROR_GOTO2("ERROR (%s): Could not set XMP metadata.\n",
|
ERROR_GOTO2("ERROR (%s): Could not set the metadata.\n",
|
||||||
ErrorString(err), Err2);
|
ErrorString(err), Err2);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -889,10 +889,10 @@ static int Process(const WebPMuxConfig* config) {
|
|||||||
ErrorString(err), Err2);
|
ErrorString(err), Err2);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case FEATURE_XMP:
|
case FEATURE_META:
|
||||||
err = WebPMuxDeleteChunk(mux, "META");
|
err = WebPMuxDeleteChunk(mux, "META");
|
||||||
if (err != WEBP_MUX_OK) {
|
if (err != WEBP_MUX_OK) {
|
||||||
ERROR_GOTO2("ERROR (%s): Could not delete XMP metadata.\n",
|
ERROR_GOTO2("ERROR (%s): Could not delete the metadata.\n",
|
||||||
ErrorString(err), Err2);
|
ErrorString(err), Err2);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -50,8 +50,8 @@ and extract/strip relevant data from the container file.
|
|||||||
.B icc
|
.B icc
|
||||||
Get ICC Color profile.
|
Get ICC Color profile.
|
||||||
.TP
|
.TP
|
||||||
.B xmp
|
.B meta
|
||||||
Get XMP metadata.
|
Get XMP/EXIF metadata.
|
||||||
.TP
|
.TP
|
||||||
.B tile n
|
.B tile n
|
||||||
Get nth tile.
|
Get nth tile.
|
||||||
@ -66,18 +66,18 @@ Set ICC Color profile.
|
|||||||
.P
|
.P
|
||||||
Where: 'file.icc' contains the color profile to be set.
|
Where: 'file.icc' contains the color profile to be set.
|
||||||
.TP
|
.TP
|
||||||
.B xmp file.xmp
|
.B meta file.meta
|
||||||
Set XMP metadata.
|
Set XMP/EXIF metadata.
|
||||||
.P
|
.P
|
||||||
Where: 'file.xmp' contains the metadata to be set.
|
Where: 'file.meta' contains the metadata to be set.
|
||||||
|
|
||||||
.SS STRIP_OPTIONS (\-strip)
|
.SS STRIP_OPTIONS (\-strip)
|
||||||
.TP
|
.TP
|
||||||
.B icc
|
.B icc
|
||||||
Strip ICC Color profile.
|
Strip ICC Color profile.
|
||||||
.TP
|
.TP
|
||||||
.B xmp
|
.B meta
|
||||||
Strip XMP metadata.
|
Strip XMP/EXIF metadata.
|
||||||
|
|
||||||
.SS TILE_OPTIONS (\-tile)
|
.SS TILE_OPTIONS (\-tile)
|
||||||
.TP
|
.TP
|
||||||
@ -114,9 +114,9 @@ webpmux \-set icc image_profile.icc in.webp \-o icc_container.webp
|
|||||||
.br
|
.br
|
||||||
webpmux \-get icc icc_container.webp \-o image_profile.icc
|
webpmux \-get icc icc_container.webp \-o image_profile.icc
|
||||||
.br
|
.br
|
||||||
webpmux \-set xmp image_metadata.xmp in.webp \-o xmp_container.webp
|
webpmux \-set meta image_metadata.meta in.webp \-o meta_container.webp
|
||||||
.br
|
.br
|
||||||
webpmux \-get xmp xmp_container.webp \-o image_metadata.xmp
|
webpmux \-get meta meta_container.webp \-o image_metadata.meta
|
||||||
.br
|
.br
|
||||||
webpmux \-frame anim_1.webp +0+0+0 \-frame anim_2.webp +50+50+0 \-loop 10
|
webpmux \-frame anim_1.webp +0+0+0 \-frame anim_2.webp +50+50+0 \-loop 10
|
||||||
\-o anim_container.webp
|
\-o anim_container.webp
|
||||||
|
Loading…
Reference in New Issue
Block a user