Store image hashes in the db - part 1

This commit is contained in:
Claudio Ortolina
2024-09-30 20:09:32 +01:00
parent 9cd24bad17
commit 180224d381
5 changed files with 60 additions and 3 deletions
@@ -25,7 +25,11 @@
>
<:col :let={{_id, record}} label="Image">
<span class="relative inline-block drop-shadow-xl">
<img class="max-w-16 rounded-lg" src={~p"/images/#{record.id}"} alt={record.title} />
<img
class="max-w-16 rounded-lg"
alt={record.title}
src={~p"/images/#{record.id}?vsn=#{record.image_data_hash || ""}"}
/>
<span class="absolute right-1 bottom-0 block text-white drop-shadow-md">
<%= Records.Record.format_short_label(record.format) %>
</span>
@@ -13,7 +13,11 @@
<div class="md:columns-2">
<span class="relative block md:inline-block drop-shadow">
<img class="w-full" src={~p"/images/#{@record.id}"} alt={@record.title} />
<img
class="w-full"
src={~p"/images/#{@record.id}?vsn=#{@record.image_data_hash}"}
alt={@record.title}
/>
<span class="absolute right-2 bottom-1 block text-white drop-shadow-md">
<%= Records.Record.format_short_label(@record.format) %>
</span>