Skip to content

Commit

Permalink
Show more details when jpeg fails to read
Browse files Browse the repository at this point in the history
  • Loading branch information
Matthias-Wandel committed May 15, 2020
1 parent f247c45 commit 9302b6e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/jpeg2mem.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ MemImage_t * LoadJPEG(char* FileName, int scale_denom, int discard_colors, int P
if (setjmp(jerr.setjmp_buffer)) {
// If we get here, the JPEG code has signaled an error.
// We need to clean up the JPEG object, close the input file, and return.
fprintf(Log, "Error reading jpeg \"%s\" at %ld\n", FileName, ftell(file));
jpeg_destroy_decompress(&info);
fclose(file);
return NULL;
Expand Down
2 changes: 1 addition & 1 deletion src/jpgfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ static int FindExifInFile (FILE * infile)
lh = fgetc(infile);
ll = fgetc(infile);
if (lh == EOF || ll == EOF){
fprintf(Log, "Unexpected end of file");
fprintf(Log, "Unexpected end of file at %ld",ftell(infile));
return 0;
}

Expand Down

0 comments on commit 9302b6e

Please sign in to comment.