Skip to content

Commit bd2b002

Browse files
committed
Display: always print inches in integer
1 parent c936d17 commit bd2b002

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/modules/display/display.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ void ffPrintDisplay(FFDisplayOptions* options)
100100
}
101101

102102
FF_STRBUF_AUTO_DESTROY buffer = ffStrbufCreate();
103-
double inch = sqrt(result->physicalWidth * result->physicalWidth + result->physicalHeight * result->physicalHeight) / 25.4;
103+
uint32_t inch = (uint32_t) (sqrt(result->physicalWidth * result->physicalWidth + result->physicalHeight * result->physicalHeight) / 25.4 + 0.5);
104104

105105
if(options->moduleArgs.outputFormat.length == 0)
106106
{
@@ -121,8 +121,8 @@ void ffPrintDisplay(FFDisplayOptions* options)
121121
result->scaledHeight > 0 && result->scaledHeight != result->height)
122122
ffStrbufAppendF(&buffer, " (as %ix%i)", result->scaledWidth, result->scaledHeight);
123123

124-
if (inch > 0)
125-
ffStrbufAppendF(&buffer, " in %i″", (uint32_t) (inch + 0.5));
124+
if (inch > 1)
125+
ffStrbufAppendF(&buffer, " in %i″", inch);
126126

127127
if(result->type != FF_DISPLAY_TYPE_UNKNOWN)
128128
ffStrbufAppendS(&buffer, result->type == FF_DISPLAY_TYPE_BUILTIN ? " [Built-in]" : " [External]");

0 commit comments

Comments
 (0)