Skip to content

Commit

Permalink
load/store_image: print errno
Browse files Browse the repository at this point in the history
refer to GH-93
  • Loading branch information
MartinPulec committed Sep 6, 2024
1 parent e4765fb commit 7b58a8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gpujpeg_common.c
Original file line number Diff line number Diff line change
Expand Up @@ -1118,7 +1118,7 @@ gpujpeg_image_load_from_file(const char* filename, uint8_t** image, size_t* imag
FILE* file;
file = fopen(filename, "rb");
if ( !file ) {
fprintf(stderr, "[GPUJPEG] [Error] Failed open %s for reading!\n", filename);
fprintf(stderr, "[GPUJPEG] [Error] Failed open %s for reading: %s\n", filename, strerror(errno));
return -1;
}

Expand Down Expand Up @@ -1180,7 +1180,7 @@ gpujpeg_image_save_to_file(char *filename, uint8_t *image, size_t image_size,
FILE* file;
file = fopen(filename, "wb");
if ( !file ) {
fprintf(stderr, "[GPUJPEG] [Error] Failed open %s for writing!\n", filename);
fprintf(stderr, "[GPUJPEG] [Error] Failed open %s for writing: %s\n", filename, strerror(errno));
return -1;
}

Expand Down

0 comments on commit 7b58a8b

Please sign in to comment.