Skip to content
Merged
Show file tree
Hide file tree
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
9 changes: 9 additions & 0 deletions IFComp/lib/IFComp/Schema/Result/Entry.pm
Original file line number Diff line number Diff line change
Expand Up @@ -930,6 +930,15 @@ sub cover_exists {
}
}

sub cover_image {
my $self = shift;

return 0 unless $self->cover_exists;

my $image = Imager->new( file => $self->web_cover_file );
return $image;
}

sub create_web_cover_file {
my $self = shift;

Expand Down
2 changes: 1 addition & 1 deletion IFComp/root/src/_current_entry_row.tt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
[% IF entry.cover_exists %]
<div class="col-sm-4">
<div itemprop="image" itemscope itemtype="https://schema.org/ImageObject">
<a itemprop="contentUrl" href="[% c.uri_for_action( '/play/full_cover', [ entry.id ] ) %]" target="_blank"><img itemprop="thumbnailUrl" class="img-fluid" src="[% c.uri_for_action( '/play/cover', [ entry.id ] ) %]" alt="Cover art for [% entry.title %]" loading="lazy"></a>
<a itemprop="contentUrl" href="[% c.uri_for_action( '/play/full_cover', [ entry.id ] ) %]" target="_blank"><img itemprop="thumbnailUrl" class="img-fluid" src="[% c.uri_for_action( '/play/cover', [ entry.id ] ) %]" alt="Cover art for [% entry.title %]" height="[% entry.cover_image.getheight %]" width="[% entry.cover_image.getwidth %]" loading="lazy"></a>
[% IF (entry.genai_state / 2) % 2 == 1 %]
<span style="font-size: smaller;" itemprop="genai_cover"><em>Generative artificial intelligence was used to make this cover art.</em></span>
[% END %]
Expand Down