We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent fd95654 commit dc49c80Copy full SHA for dc49c80
src/imagew-api.c
@@ -483,13 +483,20 @@ IW_IMPL(int) iw_get_input_density(struct iw_context *ctx,
483
{
484
*px = 1.0;
485
*py = 1.0;
486
- *pcode = ctx->img1.density_code;
487
- if(ctx->img1.density_code!=IW_DENSITY_UNKNOWN) {
488
- *px = ctx->img1.density_x;
489
- *py = ctx->img1.density_y;
490
- return 1;
+ *pcode = IW_DENSITY_UNKNOWN;
+
+ if(ctx->img1.density_code==IW_DENSITY_UNKNOWN) {
+ return 0;
491
}
492
- return 0;
+ if(!iw_is_valid_density(ctx->img1.density_x, ctx->img1.density_y,
+ ctx->img1.density_code))
493
+ {
494
495
+ }
496
+ *px = ctx->img1.density_x;
497
+ *py = ctx->img1.density_y;
498
+ *pcode = ctx->img1.density_code;
499
+ return 1;
500
501
502
IW_IMPL(void) iw_set_output_density(struct iw_context *ctx,
0 commit comments