Skip to content

Commit 5a074c6

Browse files
committed
gpujpeg_image_get_properties: fix ret in main
+ updated the function documentation (ret val semantics)
1 parent a528b3b commit 5a074c6

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

libgpujpeg/gpujpeg_common.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -425,15 +425,11 @@ gpujpeg_image_save_to_file(char* filename, const uint8_t* image, size_t image_si
425425
/**
426426
* Reads/obtains properties from uncompressed file (PNM etc.)
427427
*
428-
* For raw files it obtains only pixel format deduced from file extension.
428+
* For files without header (.rgb, .yuv...) it obtains only color space pixel format deduced from file extension.
429429
*
430-
* gpujpeg_image_parameters::comp_size is not set by the function and should be deduced from pixel_format
431-
*
432-
* May also return some with a null value - eg. when the file doesn't exist
433-
* but color space may be deduced from extension.
434430
* @retval 0 on success; != 0 on error
435431
* @retval -1 on error
436-
* @retval 1 only pixel format was deduced from file extension
432+
* @retval 1 only color space and pixel format was deduced from file extension (see above)
437433
*/
438434
GPUJPEG_API int
439435
gpujpeg_image_get_properties(const char *filename, struct gpujpeg_image_parameters *param_image, int file_exists);

src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ static int print_image_info(const char *filename, int verbose) {
158158
return print_image_info_jpeg(filename, verbose);
159159
}
160160
struct gpujpeg_image_parameters param_image = { 0 };
161-
if (gpujpeg_image_get_properties(filename, &param_image, 1) != 0) {
161+
if ( gpujpeg_image_get_properties(filename, &param_image, 1) < 0 ) {
162162
fprintf(stderr, "Error getting raw image %s info!\n", filename);
163163
return 1;
164164
}

0 commit comments

Comments
 (0)