libextractor  1.11
About: GNU libextractor is a library used to extract meta-data from files of arbitrary type.
  Fossies Dox: libextractor-1.11.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

thumbnailgtk_extractor.c File Reference

this extractor produces a binary (!) encoded thumbnail of images (using gdk pixbuf). The bottom of the file includes a decoder method that can be used to reproduce the 128x128 PNG thumbnails. We use libmagic to test if the input data is actually an image before trying to give it to gdk-pixbuf. More...

#include "platform.h"
#include "extractor.h"
#include <magic.h>
#include <glib.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
Include dependency graph for thumbnailgtk_extractor.c:

Go to the source code of this file.

Macros

#define THUMBSIZE   128
 
#define MAX_IMAGE_SIZE   (32 * 1024 * 1024)
 

Functions

void EXTRACTOR_thumbnailgtk_extract_method (struct EXTRACTOR_ExtractContext *ec)
 
void EXTRACTOR_thumbnail_extract_method (struct EXTRACTOR_ExtractContext *ec)
 
void thumbnailgtk_gobject_init ()
 
void thumbnailgtk_ltdl_fini ()
 

Variables

static magic_t magic
 

Detailed Description

this extractor produces a binary (!) encoded thumbnail of images (using gdk pixbuf). The bottom of the file includes a decoder method that can be used to reproduce the 128x128 PNG thumbnails. We use libmagic to test if the input data is actually an image before trying to give it to gdk-pixbuf.

Author
Christian Grothoff

Definition in file thumbnailgtk_extractor.c.

Macro Definition Documentation

◆ MAX_IMAGE_SIZE

#define MAX_IMAGE_SIZE   (32 * 1024 * 1024)

Maximum image size supported (to avoid unreasonable allocations)

Definition at line 45 of file thumbnailgtk_extractor.c.

◆ THUMBSIZE

#define THUMBSIZE   128

Target size for the thumbnails (width and height).

Definition at line 39 of file thumbnailgtk_extractor.c.

Function Documentation

◆ EXTRACTOR_thumbnail_extract_method()

void EXTRACTOR_thumbnail_extract_method ( struct EXTRACTOR_ExtractContext ec)

This plugin sometimes is installed under the alias 'thumbnail'. So we need to provide a second entry method.

Parameters
ecextraction context

Definition at line 201 of file thumbnailgtk_extractor.c.

References EXTRACTOR_thumbnailgtk_extract_method().

◆ EXTRACTOR_thumbnailgtk_extract_method()

◆ thumbnailgtk_gobject_init()

void thumbnailgtk_gobject_init ( )

Initialize glib and load magic file.

Definition at line 211 of file thumbnailgtk_extractor.c.

References magic, and NULL.

◆ thumbnailgtk_ltdl_fini()

void thumbnailgtk_ltdl_fini ( )

Destructor for the library, cleans up.

Definition at line 228 of file thumbnailgtk_extractor.c.

References magic, and NULL.

Variable Documentation

◆ magic

magic_t magic
static

Global handle to MAGIC data.

Definition at line 51 of file thumbnailgtk_extractor.c.

Referenced by EXTRACTOR_thumbnailgtk_extract_method(), thumbnailgtk_gobject_init(), and thumbnailgtk_ltdl_fini().