[Xfce-bugs] [Bug 15706] Thunar 1.8 fails to show thumbnails for webm, txt, html and mardown files

bugzilla-daemon at xfce.org bugzilla-daemon at xfce.org
Thu Jul 18 23:13:25 CEST 2019


https://bugzilla.xfce.org/show_bug.cgi?id=15706

phil4000n at gmail.com changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                URL|                            |INVALID

--- Comment #2 from phil4000n at gmail.com ---
> tumbler that cannot generate a thumbnail for those files, because /usr/bin/convert only accepts image files.
It's not what I achieved, see below.

>You will have to use a different program or write your own one for this purpose.
Well, KDE Dolphin supports preview of text files


I'm a beginner, but I test some scripting concepts:
For text base files it could be something such as:

iFile=$(<"testSomeTextFile.md")
        iChopped="${iFile:0:1600}"
        unset iFile
        echo "${iChopped}" > "tmp.txt"
        unset iChopped
        convert -size 210x290 -background white -pointsize 5 -border 10x10
-bordercolor "#CCC" caption:@"tmp.txt" "testSomeTextFile.png"

This shows it's possible to create a thumbnail for any text base file, and one
could even have option to distinguish file types (md, txt, css, etc) by
changing either:
- font colour,
- background color or
- border colour.
- or having an image overlay (such as it's so nicely done currently).


Regarding html, depending on CPU ressources, one could go an extra step and
interpreter the html in such a way:
        iFile=$(<"test.htm")
        iChopped="${iFile:0:3200}"
        unset iFile
        echo "${iChopped}" > "test.htm"
        unset iChopped

        wkhtmltoimage "test.htm" --width 260 --height 260 test.png

-- 
You are receiving this mail because:
You are the assignee for the bug.


More information about the Xfce-bugs mailing list