mirror of
https://github.com/webmproject/libwebp.git
synced 2024-11-19 20:08:28 +01:00
jpegdec: add a hint for EOF/READ errors
`jpegtran -copy all` may be able to process the file into something libjpeg can read. Bug: webp:562 Change-Id: I27a8a7a841c1d8d54f47c7c52e289d9d8c549220
This commit is contained in:
parent
edc289092a
commit
79e7968ad0
@ -206,8 +206,12 @@ struct my_error_mgr {
|
||||
|
||||
static void my_error_exit(j_common_ptr dinfo) {
|
||||
struct my_error_mgr* myerr = (struct my_error_mgr*)dinfo->err;
|
||||
const int msg_code = myerr->pub.msg_code;
|
||||
fprintf(stderr, "libjpeg error: ");
|
||||
dinfo->err->output_message(dinfo);
|
||||
if (msg_code == JERR_INPUT_EOF || msg_code == JERR_FILE_READ) {
|
||||
fprintf(stderr, "`jpegtran -copy all` MAY be able to process this file.\n");
|
||||
}
|
||||
longjmp(myerr->setjmp_buffer, 1);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user