don't think anyone is uploading hourlong animations

This commit is contained in:
byte[] 2020-09-16 13:50:19 -04:00
parent 9d0d622fbd
commit f98aa22bda

View file

@ -63,11 +63,12 @@
= @image.image_height
= if not is_nil(@image.image_duration) and @image.image_is_animated and @image.image_duration > 0 do
span.image-size
span.image-size title=@image.image_duration
|  
- dur = ceil(@image.image_duration)
- {hh, mm, ss} = {div(dur, 3600), div(rem(dur, 3600), 60), rem(dur, 60)}
= :io_lib.format("~2..0B:~2..0B:~2..0B", [hh, mm, ss])
- dur = trunc(@image.image_duration)
- ms = trunc((@image.image_duration - dur)*100)
- {mm, ss} = {div(dur, 60), rem(dur, 60)}
= :io_lib.format("~2..0B:~2..0B.~2..0B", [mm, ss, ms])
=<> String.upcase(to_string(@image.image_format))
- size_kb = div(@image.image_size, 1000)