Skip to content

LibGfx/TGALoader: A couple of minor fixups (NFC) #25871

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 6, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Userland/Libraries/LibGfx/ImageFormats/TGALoader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class TGAImageIdentifier : public Gfx::Metadata {
protected:
virtual void fill_main_tags() const override
{
if (m_identifier.byte_count() != 0)
if (!m_identifier.is_empty())
m_main_tags.set("Identifier"sv, m_identifier);
}

Expand Down Expand Up @@ -109,6 +109,8 @@ ErrorOr<void> TGAImageDecoderPlugin::decode_tga_header()
auto identifier = String::from_stream(m_context->stream, m_context->header.id_length);
if (!identifier.is_error())
m_context->identifier_metadata = make<TGAImageIdentifier>(identifier.release_value());
else
dbgln("FIXME: Handle non-utf8 identifiers in TGALoader");
}
TRY(ensure_header_validity(m_context->header, m_context->bytes.size()));
return {};
Expand Down
Loading