Table Of Contents

Previous topic

5.16.1. thumbnailers.base — Base classes for thumbnailers

Next topic

5.16.3. thumbnailers.magick — thumbnailer for image files (ImageMagick)

This Page

Languages

Previous versions

1.2
1.1

5.16.2. thumbnailers.jfif — Thumbnailer for files containing a JPEG thumbnail

New in version 1.1.

This module adds an optimist thumbnailer for some files which contain a JPEG thumbnails.

This formats are:

  • CATIA file (CATPart, CATProduct, CATDrawing)
  • Pro Engineer file (prt, asm)

5.16.2.1. How it works

Some files may contain a thumbnail. This thumbnail is stored somewhere in the file as a JPEG image. So the idea is to try to find a JPEG image in the original file and hope it is a valid image (and the thumbnail).

All JPEG file starts with a magic number (0xFFD8). This thumbnailer locates this magic number and tries to read the image with PIL. If it succeeds, it assumes it is the thumbnail. If it fails, it tries to find another magic number and retries.

plmapp.thumbnailers.jfifthumbnailer.jfif_thumbnailer(input_path, original_filename, output_path)[source]

Thumbnailer for files which contain a JPEG thumbnail.