mirror of
https://github.com/RGBCube/serenity
synced 2025-05-14 09:24:57 +00:00
Utilities: Make file
print more information for animated images
This commit is contained in:
parent
a83f4ec186
commit
5d5f9f52a0
1 changed files with 12 additions and 1 deletions
|
@ -37,7 +37,18 @@ static Optional<DeprecatedString> image_details(DeprecatedString const& descript
|
|||
if (!image_decoder)
|
||||
return {};
|
||||
|
||||
return DeprecatedString::formatted("{}, {} x {}", description, image_decoder->width(), image_decoder->height());
|
||||
StringBuilder builder;
|
||||
builder.appendff("{}, {} x {}", description, image_decoder->width(), image_decoder->height());
|
||||
if (image_decoder->is_animated()) {
|
||||
builder.appendff(", animated with {} frames that loop", image_decoder->frame_count());
|
||||
int loop_count = image_decoder->loop_count();
|
||||
if (loop_count == 0)
|
||||
builder.appendff(" indefinitely");
|
||||
else
|
||||
builder.appendff(" {} {}", loop_count, loop_count == 1 ? "time" : "times");
|
||||
}
|
||||
|
||||
return builder.to_deprecated_string();
|
||||
}
|
||||
|
||||
static Optional<DeprecatedString> gzip_details(DeprecatedString description, DeprecatedString const& path)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue