Download

Support

Epeg Library Documentation

epeg.png
Version:
0.9.0
Author:
Carsten Haitzler <raster@rasterman.com>
Date:
2000-2003

What is Epeg?

An IMMENSELY FAST JPEG thumbnailer library API.

Why write this? It's a convenience library API to using libjpeg to load JPEG images destined to be turned into thumbnails of the original, saving information with these thumbnails, retreiving it and managing to load the image ready for scaling with the minimum of fuss and CPU overhead.

This means it's insanely fast at loading large JPEG images and scaling them down to tiny thumbnails. It's speedup will be proportional to the size difference between the source image and the output thumbnail size as a count of their pixels.

It makes use of libjpeg features of being able to load an image by only decoding the DCT coefficients needed to reconstruct an image of the size desired. This gives a massive speedup. If you do not try and access the pixels in a format other than YUV (or GRAY8 if the source is grascale) then it also avoids colorspace conversions as well.

Using the library is very easy, look at this example:

#include "Epeg.h"

int
main(int argc, char **argv)
{
   Epeg_Image *im;

   if (argc != 3)
     {
        printf("Usage: %s input.jpg thumb.jpg\n", argv[0]);
        exit(0);
     }
   im = epeg_file_open(argv[1]);
   if (!im)
     {
        printf("Cannot open %s\n", argv[1]);
        exit(-1);
     }
   
   epeg_decode_size_set           (im, 128, 96);
   epeg_quality_set               (im, 75);
   epeg_thumbnail_comments_enable (im, 1);
   epeg_file_output_set           (im, argv[2]);
   epeg_encode                    (im);
   epeg_close                     (im);
   
   return 0;
}

You can compile this program with as small a line as:

gcc epeg_test.c -o epeg_test `epeg-config --cflags --libs`

It is a very simple library that just makes life easier when tyring to generate lots of thumbnails for large JPEG images as quickly as possible. Your milage may vary, but it should save you lots of time and effort in using libjpeg in general.

Todo:
Check all input parameters for sanity.
Todo:
Actually report error conditions properly.

Copyright © Enlightenment.org

Epeg Documentation Generated: Sat May 17 15:10:01 2008