Skip to content

Commit 09c7ec8

Browse files
committed
gpujpegtool: use gpujpeg_image_parameters initializer
Instead of zero-initialization, initialize with gpujpeg_default_image_parameters(). This allows running with "incorrect" extension like '.bla', eg.: ``` gpujpegtool -e 1920x1080.tst out.jpg # prepare input gpujpegtool -d out.jpg out.bla ``` Not sure if this is actually better behavior but it was written so intentional by the commit 3313aa0. It ceased to work with further updates. (Now produces additional warning inside the library: `[GPUJPEG] [Error] GPUJPEG_IMAGE_FILE_UNKNOWN should not be passed!`).
1 parent 42c1876 commit 09c7ec8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ adjust_params(struct gpujpeg_parameters* param, struct gpujpeg_image_parameters*
179179
const char* out, bool encode, const struct options* opts)
180180
{
181181
// if possible, read properties from file
182-
struct gpujpeg_image_parameters file_param_image = { 0, 0, GPUJPEG_NONE, GPUJPEG_PIXFMT_NONE, 0 };
182+
struct gpujpeg_image_parameters file_param_image = gpujpeg_default_image_parameters();
183183
const char *raw_file = encode ? in : out;
184184
gpujpeg_image_get_properties(raw_file, &file_param_image, encode);
185185
param_image->width = USE_IF_NOT_NULL_ELSE(param_image->width, file_param_image.width);

0 commit comments

Comments
 (0)