LFS image does not render in file view
Resources
PM @victorwu
Problem
- LFS image does not render in the file view.
- The same images do render correctly in the commit view.
- This is not observed in non-LFS images.
There seems to exist a small inconsistency in how LFS-tracked images are being previewed in the web interface. I created a small demo repo to show this.
After an image has been committed via LFS, its content is being shown on the commit page, as one would expect: alexander.kachkaev.wb/gitlab-lfs-preview-inconsistency@80f187cf
However, when a user locates the same file in a tree and clicks on it, the same image shows like this: https://gitlab.com/alexander.kachkaev.wb/gitlab-lfs-preview-inconsistency/blob/master/logo-lfs.png
Non-LFS images do show up in the web interface, even when navigated from the tree: https://gitlab.com/alexander.kachkaev.wb/gitlab-lfs-preview-inconsistency/blob/master/logo-no-lfs.png
It would be nice if this preview inconsistency was resolved and users could see their previewed files in all modes when this is technically possible.
Going further, it would be also good to even preview large LFS-controlled CSVs, JSONs, etc. The interface could show the first couple of kilobytes instead of only suggesting to download the whole text file. But this extra thought is probably worth a separate discussion.