All File in jni/tclepeg/
Not logged in

Files in directory jni/tclepeg in any check-in


TCLEPEG - README

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: 

	http://svn.enlightenment.org/svn/e/OLD/epeg/



COMPILE

Tclepeg depends on the existence of:

	libepeg 
	libjpeg

First complile the epeg source and create libepeg.so or libepeg.a

Then, to compile tclepeg use:

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

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.



USAGE:

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

	epeg ?options ...? jpegdata
	Options:
		-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 ./tclepeg.so
	# 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



LICENSE

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