NikitaIvanovV / ctpv

Image previews for lf file manager
https://www.nikitaivanov.com/man1/ctpv
MIT License
264 stars 23 forks source link

the album cover is in a terrible place #57

Open Goosegit11 opened 1 year ago

Goosegit11 commented 1 year ago

hello guys. saw some cool snippets in #20, but I have a problem with this one:

preview audio audio/* {{

audio() {
    ffmpegthumbnailer -i "$f" -s 256 -o "$cache_f" 2>/dev/null
}

if exists ffmpeg; then
    x="$(ffmpeg -hide_banner -i "$f" 2>&1)"
    printf '%s\n' "$x"
    y=$((y + $(printf '%s\n' "$x" | wc -l)))
fi

convert_and_show_image audio
}}

image psd

cover position is awful. and there's enough space for it under metadata, so I don't know why cover is not placed there. I drew the position where I want it to be (square with question mark inside it) also there's "At least one output file must be specified" in the end of metadata. maybe use ffprobe for metadata gathering?

NikitaIvanovV commented 1 year ago

What happens if you remove the if statement?

Goosegit11 commented 1 year ago

then there's no metadata, and cover is too small imo

image

ideally cover should be on the top, and metadata should be under it.

NikitaIvanovV commented 1 year ago

What if you replace it with this?

if exists ffmpeg; then
    meta="$(ffmpeg -hide_banner -i "$f" 2>&1)"
    printf '%s\n' "$meta"
    y=$((y + $(printf '%s\n' "$meta" | wc -l)))
fi
Goosegit11 commented 1 year ago

it works, but I would like the picture to be centered, and not so close to the metadata. in short, I need some padding.

there is also a problem, for some reason the two flac's covers have different sizes, although they use the same picture (?) - i attach a screenshot and links to both. first second

first flac: https://0x0.st/Hb8H.flac second flac: https://0x0.st/Hb8X.flac

Goosegit11 commented 1 year ago

I don't think my files are the problem. Can you check them on your system? As I understand, they both use the same Cover.jpg file for cover

also take a look at this video: https://github.com/NikitaIvanovV/ctpv/assets/89806596/f7561597-2ad3-43c8-928b-811a9d1ba15d

Goosegit11 commented 1 year ago

also what do if metadata is too big, where to place the cover? it's more of a UX issue

Goosegit11 commented 11 months ago

what do if metadata is too big?

I think lf-scrollingpreview could help with that. You could place the cover image at the top and the metadata below. If the metadata is too long, you can just scroll down to see all of it. I haven't tested this setup myself though.

https://github.com/slavistan/lf-gadgets/tree/master/lf-scrollingpreview