kamiyaa / joshuto

ranger-like terminal file manager written in Rust
https://crates.io/crates/joshuto
GNU Lesser General Public License v3.0
3.37k stars 148 forks source link

Previews doesn't work with files over 2MB #417

Closed rasmus-kirk closed 11 months ago

rasmus-kirk commented 11 months ago

I can't seem to preview files when the file is more than 2MB in size. Is this intentional?

kamiyaa commented 11 months ago

This is configured here https://github.com/kamiyaa/joshuto/blob/main/docs/configuration/joshuto.toml.md

max_preview_size

DLFW commented 11 months ago

Hey @kamiyaa, another 2 cents from me:

I think it would be good to dismantle this option. It originates from a time before a preview was even implemented. For files where some meta-data is shown (like for most non-text files like videos, etc.), the file-size does not matter. Same holds for image-thumbs. And no matter if we display just the content of a text file or some meta-data, the preview-script can handle that decision. There is not need to share this preview-logic over an external script and hard-coded Joshuto config-options.

I have set this value to some insane high number since basically forever. Just to get that out of the way. I doubt that this has some actual use for somebody.

Different opinions?

kamiyaa commented 11 months ago

Hey @kamiyaa, another 2 cents from me:

I think it would be good to dismantle this option. It originates from a time before a preview was even implemented. For files where some meta-data is shown (like for most non-text files like videos, etc.), the file-size does not matter. Same holds for image-thumbs. And no matter if we display just the content of a text file or some meta-data, the preview-script can handle that decision. There is not need to share this preview-logic over an external script and hard-coded Joshuto config-options.

I have set this value to some insane high number since basically forever. Just to get that out of the way. I doubt that this has some actual use for somebody.

Different opinions?

True, you have a point. I believe this option was mostly carried over from ranger. But it does make sense to move the logic to the preview script side and let the preview scripts determine whether they want to output a preview or not.