mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-27 22:28:22 +01:00
cwebp: centralize WebPCleanupTransparentArea()
this can be safely called whether the picture has alpha or not Change-Id: I0047fd4c110f1072f183f3d340682502bd6623d7
This commit is contained in:
parent
7381254e9a
commit
7c732e59f4
@ -876,6 +876,9 @@ int main(int argc, const char *argv[]) {
|
|||||||
goto Error;
|
goto Error;
|
||||||
}
|
}
|
||||||
picture.progress_hook = (show_progress && !quiet) ? ProgressReport : NULL;
|
picture.progress_hook = (show_progress && !quiet) ? ProgressReport : NULL;
|
||||||
|
if (keep_alpha == 2) {
|
||||||
|
WebPCleanupTransparentArea(&picture);
|
||||||
|
}
|
||||||
|
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
const double read_time = StopwatchReadAndReset(&stop_watch);
|
const double read_time = StopwatchReadAndReset(&stop_watch);
|
||||||
|
@ -274,9 +274,6 @@ int ReadPNG(FILE* in_file, WebPPicture* const pic, int keep_alpha,
|
|||||||
if (!ok) {
|
if (!ok) {
|
||||||
goto Error;
|
goto Error;
|
||||||
}
|
}
|
||||||
if (has_alpha && keep_alpha == 2) {
|
|
||||||
WebPCleanupTransparentArea(pic);
|
|
||||||
}
|
|
||||||
|
|
||||||
End:
|
End:
|
||||||
return ok;
|
return ok;
|
||||||
|
@ -108,9 +108,6 @@ int ReadTIFF(const char* const filename,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (ok) {
|
if (ok) {
|
||||||
if (keep_alpha == 2) {
|
|
||||||
WebPCleanupTransparentArea(pic);
|
|
||||||
}
|
|
||||||
if (metadata != NULL) {
|
if (metadata != NULL) {
|
||||||
ok = ExtractMetadataFromTIFF(tif, metadata);
|
ok = ExtractMetadataFromTIFF(tif, metadata);
|
||||||
if (!ok) {
|
if (!ok) {
|
||||||
|
@ -257,9 +257,6 @@ int ReadPictureWithWIC(const char* const filename,
|
|||||||
hr = E_FAIL;
|
hr = E_FAIL;
|
||||||
}
|
}
|
||||||
if (SUCCEEDED(hr)) {
|
if (SUCCEEDED(hr)) {
|
||||||
if (has_alpha && keep_alpha == 2) {
|
|
||||||
WebPCleanupTransparentArea(pic);
|
|
||||||
}
|
|
||||||
if (metadata != NULL) {
|
if (metadata != NULL) {
|
||||||
hr = ExtractMetadata(pFactory, pFrame, metadata);
|
hr = ExtractMetadata(pFactory, pFrame, metadata);
|
||||||
if (FAILED(hr)) {
|
if (FAILED(hr)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user