/* * Copyright 2015 Google Inc. * * Use of this source code is governed by a BSD-style license that can be * found in the LICENSE file.
*/ #include"src/codec/SkJpegDecoderMgr.h"
/* * Reporting function for error and warning messages.
*/ staticvoid output_message(j_common_ptr info) {
print_message(info, "output_message");
}
staticvoid progress_monitor(j_common_ptr info) { int scan = ((j_decompress_ptr)info)->input_scan_number; // Progressive images with a very large number of scans can cause the // decoder to hang. Here we use the progress monitor to abort on // a very large number of scans. 100 is arbitrary, but much larger // than the number of scans we might expect in a normal image. if (scan >= 100) {
skjpeg_err_exit(info);
}
}
JpegDecoderMgr::JpegDecoderMgr(SkStream* stream)
: fSrcMgr(SkJpegSourceMgr::Make(stream)), fInit(false) { // An error manager must be set before any calls to libjpeg, in order to handle failures.
fDInfo.err = jpeg_std_error(&fErrorMgr);
fErrorMgr.error_exit = skjpeg_err_exit;
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.