fix use of switch-case on a boolean
This commit is contained in:
10
tumble_png.c
10
tumble_png.c
@@ -177,20 +177,16 @@ static bool get_png_image_info (int image,
|
|||||||
image_info->width_samples = width;
|
image_info->width_samples = width;
|
||||||
image_info->height_samples = height;
|
image_info->height_samples = height;
|
||||||
|
|
||||||
switch (unit==1)
|
if (unit == 1) {
|
||||||
{
|
|
||||||
case 1:
|
|
||||||
image_info->width_points = ((image_info->width_samples * POINTS_PER_INCH) /
|
image_info->width_points = ((image_info->width_samples * POINTS_PER_INCH) /
|
||||||
(xppu * 0.0254));
|
(xppu * 0.0254));
|
||||||
image_info->height_points = ((image_info->height_samples * POINTS_PER_INCH) /
|
image_info->height_points = ((image_info->height_samples * POINTS_PER_INCH) /
|
||||||
(yppu * 0.0254));
|
(yppu * 0.0254));
|
||||||
break;
|
} else if (unit == 0) {
|
||||||
case 0:
|
|
||||||
/* assume 300 DPI - not great, but what else can we do? */
|
/* assume 300 DPI - not great, but what else can we do? */
|
||||||
image_info->width_points = (image_info->width_samples * POINTS_PER_INCH) / 300.0;
|
image_info->width_points = (image_info->width_samples * POINTS_PER_INCH) / 300.0;
|
||||||
image_info->height_points = ((double) yppu * image_info->height_samples * POINTS_PER_INCH) / ( 300.0 * xppu);
|
image_info->height_points = ((double) yppu * image_info->height_samples * POINTS_PER_INCH) / ( 300.0 * xppu);
|
||||||
break;
|
} else {
|
||||||
default:
|
|
||||||
fprintf (stderr, "PNG pHYs unit %d not supported\n", unit);
|
fprintf (stderr, "PNG pHYs unit %d not supported\n", unit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user