mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-26 13:48:21 +01:00
Record & log the image pre-processing time.
Change-Id: If0ecec3046e87fe0021446a98f3e94c7e0576bb8
This commit is contained in:
parent
d2cc61b7dd
commit
e09e9ff6e5
@ -999,7 +999,7 @@ int main(int argc, const char *argv[]) {
|
||||
picture.user_data = (void*)in_file;
|
||||
}
|
||||
|
||||
// Compress
|
||||
// Crop & resize.
|
||||
if (verbose) {
|
||||
StopwatchReset(&stop_watch);
|
||||
}
|
||||
@ -1016,12 +1016,22 @@ int main(int argc, const char *argv[]) {
|
||||
goto Error;
|
||||
}
|
||||
}
|
||||
if (verbose && (crop != 0 || (resize_w | resize_h) > 0)) {
|
||||
const double preproc_time = StopwatchReadAndReset(&stop_watch);
|
||||
fprintf(stderr, "Time to crop/resize picture: %.3fs\n", preproc_time);
|
||||
}
|
||||
|
||||
if (picture.extra_info_type > 0) {
|
||||
AllocExtraInfo(&picture);
|
||||
}
|
||||
if (print_distortion >= 0) { // Save original picture for later comparison
|
||||
WebPPictureCopy(&picture, &original_picture);
|
||||
}
|
||||
|
||||
// Compress.
|
||||
if (verbose) {
|
||||
StopwatchReset(&stop_watch);
|
||||
}
|
||||
if (!WebPEncode(&config, &picture)) {
|
||||
fprintf(stderr, "Error! Cannot encode picture as WebP\n");
|
||||
fprintf(stderr, "Error code: %d (%s)\n",
|
||||
|
Loading…
Reference in New Issue
Block a user