PNG, JPEG, GIF, BMP and XPM are read with libpng, libjpeg and C99 -- GIF's LZW, BMP's rows and XPM's text are the module's own, so no library beyond what Motif already brings. A picture is scaled down with a box filter and kept in $HOME/.dt/thumbs/<64|128|256>/<sha1 of real path, mtime and size>.ppm; a cache over 50 MB is pruned by age when it is written to. A picture larger than 8192 x 8192 or 64 MB is refused from its header before a byte of pixel data is read, and a JPEG is decoded at 1/2, 1/4 or 1/8 when that still has the size the caller asks for. McdeThumbRequest reads one picture per Xt work proc, so a folder of photographs does not stop the window, and McdeThumbRead/Scale is the part without X (a test needs no display). Measured on the build host, "make mcde-linux MCDE_DIRS='check lib/DtSvc'": test_thumb PASS -- every format read back to its own pixels, the box filter's means and aspect, the 8192/64 MB limits, a damaged file, and the cache proved by its key (the source overwritten with rubbish of the same size and mtime, the picture still returned from the PPM). 100 800 x 600 JPEGs at 64 px: 1.2 ms per decode, 100 cache files, 0.0 ms per picture from the cache; an 11 MB 5000 x 3200 JPEG: 110 ms at 64 px.
38 lines
587 B
Makefile
38 lines
587 B
Makefile
MAINTAINERCLEANFILES = Makefile.in
|
|
|
|
# Install the header files
|
|
|
|
nobase_include_HEADERS = Mcde/GlobalMenu.h \
|
|
Mcde/Displays.h \
|
|
Mcde/Image.h \
|
|
Mcde/Thumb.h \
|
|
Mcde/McdeSys.h \
|
|
Mcde/Sound.h \
|
|
Dt/Editor.h \
|
|
Dt/TermPrim.h \
|
|
Dt/Term.h \
|
|
Dt/HelpDialog.h \
|
|
Dt/Help.h \
|
|
Dt/HelpQuickD.h \
|
|
Dt/Print.h \
|
|
Dt/Mrm.h \
|
|
Dt/Dt.h \
|
|
Dt/Action.h \
|
|
Dt/Dnd.h \
|
|
Dt/Dts.h \
|
|
Dt/Session.h \
|
|
Dt/Saver.h \
|
|
Dt/Wsm.h \
|
|
Dt/MsgLog.h \
|
|
Dt/ComboBox.h \
|
|
Dt/SpinBox.h \
|
|
Dt/MenuButton.h \
|
|
Tt/tt_c.h \
|
|
Tt/tttk.h \
|
|
csa/csa.h \
|
|
Dt/Info.h \
|
|
Dt/Search.h \
|
|
Dt/Mmdb.h \
|
|
Dt/DtXinerama.h \
|
|
Dt/SvcPam.h
|