If the EXIF thumbnail is bad, you can create your own from JPEG itself without the need for full JPEG decoding.
Look for the source code for EPEG . This is part of the Enlightenment project at SourceForge, and it was part of the old EFL a year ago. You can still dig it from some old SVN commits or from the original tarball that can float around.
Basically, what EPEG does is it collects the DCT coefficients from the image and performs the scaling operation on them. The DCT coefficient is usually used as the base coefficient for an 8 × 8 pixel block. You can think of it as a single pixel. As a result, you have a (computationally free) thumbnail exactly 1/8 of the size of the original image. Scan it, like any image data, to the desired size.
greyfade
source share