All Files in jni/tclepeg/
Not logged in

Files in directory jni/tclepeg in any check-in

  • epeg
  • tclconfig
  • aclocal.m4
  • configure
  • tclepeg.c
  • test_tclepeg.tcl


Epeg is a super-fast library for resizing JPEGs. It offers an improvement of 
at least an order of magnitude over other known image manipulation libraries. 

tclepeg brings Epeg's functionality to TCL by means of a binary 
Linux library that can be loaded into a TCL program. 

Epeg's source code can be found in the Enlightenment project:


Tclepeg depends on the existence of:


First complile the epeg source and create or libepeg.a

Then, to compile tclepeg use:

	gcc -shared tclepeg.c -lepeg -ljpeg -o

provided libepeg and libjpeg are installed on your system or are in a directory known to the compiler. You might need to change the path for libepeg and libjpeg accordingly.


The tclepeg library provides a TCL command, epeg, that takes as an argument 
JPEG image data and produces a JPEG thumbnail.

	epeg ?options ...? jpegdata
		-width image_width
		-height image_height
		-quality image_quality (1-100, default 50)
		-max max_dimension (default 64)
Example usage:
	epeg $img ; # produces thumbnail of max dimension 64 px
	epeg -width 320 -height 240 -quality 50 $img

The following example reads a JPEG file and produces a thumbnail JPEG file:

	load ./
	# read in a JPEG image
	set fd [open test.jpeg]
	fconfigure $fd -translation binary
	set img [read $fd]
	close $fd

	# write reduced image
	set fd [open out.jpeg w]
	fconfigure $fd -translation binary

	# let tclepeg do the work
	puts -nonewline $fd [epeg -width 320 -height 240 -quality 50 $img]

	close $fd


The tclepeg code is provided under the BSD license, the same as epeg and tcl.