add correct image dimensions

This commit is contained in:
towards-a-new-leftypol 2024-02-14 06:15:59 -05:00
parent 6d49618c54
commit d981c0b23f
1 changed files with 8 additions and 1 deletions

View File

@ -72,7 +72,7 @@ file media_root site multifile a = div_
, text " "
, span_
[ class_ "details" ]
[ text $ "(" `append` size `append` ", 1280x720, "
[ text $ "(" `append` size `append` res_str
, a_
[ download_ orig_file_name
, href_ file_url
@ -103,6 +103,13 @@ file media_root site multifile a = div_
size = toMisoString $
bytesToHumanReadable (Attachment.file_size_bytes a) True
res_str :: JSString
res_str = maybe "" show_dimension $ Attachment.resolution a
show_dimension :: Attachment.Dimension -> JSString
show_dimension Attachment.Dimension {..} = toMisoString $
", " ++ show width ++ "x" ++ show height ++ ", "
filename_text :: JSString
filename_text
| Text.length fname > max_original_filename_display_length =