-## Process this file with automake to produce Makefile.in
-#
-# Automake Makefile for the JPEG library
-#
-# This file is written by Bob Friesenhahn, Guido Vollbeding
-#
-
-# Sources to build library
-LIBSOURCES = jaricom.c jcapimin.c jcapistd.c jcarith.c jccoefct.c jccolor.c \
- jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \
- jcomapi.c jcparam.c jcprepct.c jcsample.c jctrans.c jdapimin.c \
- jdapistd.c jdarith.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \
- jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \
- jdmerge.c jdpostct.c jdsample.c jdtrans.c jerror.c jfdctflt.c \
- jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c jquant1.c \
- jquant2.c jutils.c jmemmgr.c @MEMORYMGR@.c
-
-# System dependent sources
-SYSDEPSOURCES = jmemansi.c jmemname.c jmemnobs.c jmemdos.c jmemmac.c
-
-# Headers which are installed to support the library
-INSTINCLUDES = jerror.h jmorecfg.h jpeglib.h
-
-# Headers which are not installed
-OTHERINCLUDES = cderror.h cdjpeg.h jdct.h jinclude.h jmemsys.h jpegint.h \
- jversion.h transupp.h
-
-# Manual pages (Automake uses 'MANS' for itself)
-DISTMANS= cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1
-
-# Other documentation files
-DOCS= README install.txt usage.txt wizard.txt example.c libjpeg.txt \
- structure.txt coderules.txt filelist.txt change.log
-
-# Makefiles for various systems
-MKFILES= configure Makefile.in makefile.ansi makefile.unix makefile.bcc \
- makefile.mc6 makefile.dj makefile.wat makefile.vc makejdsw.vc6 \
- makeadsw.vc6 makejdep.vc6 makejdsp.vc6 makejmak.vc6 makecdep.vc6 \
- makecdsp.vc6 makecmak.vc6 makeddep.vc6 makeddsp.vc6 makedmak.vc6 \
- maketdep.vc6 maketdsp.vc6 maketmak.vc6 makerdep.vc6 makerdsp.vc6 \
- makermak.vc6 makewdep.vc6 makewdsp.vc6 makewmak.vc6 makejsln.v10 \
- makeasln.v10 makejvcx.v10 makejfil.v10 makecvcx.v10 makecfil.v10 \
- makedvcx.v10 makedfil.v10 maketvcx.v10 maketfil.v10 makervcx.v10 \
- makerfil.v10 makewvcx.v10 makewfil.v10 makeproj.mac makcjpeg.st \
- makdjpeg.st makljpeg.st maktjpeg.st makefile.manx makefile.sas \
- makefile.mms makefile.vms makvms.opt
-
-# Configuration files
-CONFIGFILES= jconfig.cfg jconfig.bcc jconfig.mc6 jconfig.dj jconfig.wat \
- jconfig.vc jconfig.mac jconfig.st jconfig.manx jconfig.sas \
- jconfig.vms
-
-# Support scripts for configure
-CONFIGUREFILES= config.guess config.sub install-sh ltmain.sh depcomp missing
-
-# Miscellaneous support files
-OTHERFILES= jconfig.txt ckconfig.c ansi2knr.c ansi2knr.1 jmemdosa.asm \
- libjpeg.map
-
-# Test support files
-TESTFILES= testorig.jpg testimg.ppm testimg.bmp testimg.jpg testprog.jpg \
- testimgp.jpg
-
-# libtool libraries to build
-lib_LTLIBRARIES = libjpeg.la
-
-# Library sources for libjpeg.la
-libjpeg_la_SOURCES = $(LIBSOURCES)
-
-# LDFLAGS for libjpeg.la
-libjpeg_la_LDFLAGS = -no-undefined \
- -version-info $(JPEG_LIB_VERSION)
-
-if HAVE_LD_VERSION_SCRIPT
- libjpeg_la_LDFLAGS += -Wl,--version-script=$(srcdir)/libjpeg.map
+lib_LTLIBRARIES = libjpeg.la libturbojpeg.la
+libjpeg_la_LDFLAGS = -version-info ${JPEG_LIB_VERSION} -no-undefined
+libturbojpeg_la_LDFLAGS = -avoid-version -no-undefined
+include_HEADERS = jerror.h jmorecfg.h jpeglib.h turbojpeg.h
+nodist_include_HEADERS = jconfig.h
+
+HDRS = jchuff.h jdct.h jdhuff.h jerror.h jinclude.h jmemsys.h jmorecfg.h \
+ jpegint.h jpeglib.h jversion.h jsimd.h jsimddct.h
+
+libjpeg_la_SOURCES = $(HDRS) jcapimin.c jcapistd.c jccoefct.c jccolor.c \
+ jcdctmgr.c jchuff.c jcinit.c jcmainct.c jcmarker.c jcmaster.c \
+ jcomapi.c jcparam.c jcphuff.c jcprepct.c jcsample.c jctrans.c \
+ jdapimin.c jdapistd.c jdatadst.c jdatasrc.c jdcoefct.c jdcolor.c \
+ jddctmgr.c jdhuff.c jdinput.c jdmainct.c jdmarker.c jdmaster.c \
+ jdmerge.c jdphuff.c jdpostct.c jdsample.c jdtrans.c jerror.c \
+ jfdctflt.c jfdctfst.c jfdctint.c jidctflt.c jidctfst.c jidctint.c \
+ jidctred.c jquant1.c jquant2.c jutils.c jmemmgr.c jmemnobs.c
+
+libturbojpeg_la_SOURCES = $(libjpeg_la_SOURCES) turbojpegl.c turbojpeg.h \
+ turbojpeg-mapfile
+
+if VERSION_SCRIPT
+
+libturbojpeg_la_LDFLAGS += $(VERSION_SCRIPT_FLAG)$(srcdir)/turbojpeg-mapfile
+
+endif
+
+if WITH_SIMD
+
+SUBDIRS = simd
+libjpeg_la_LIBADD = simd/libsimd.la
+libturbojpeg_la_LIBADD = simd/libsimd.la
+
+else
+
+libjpeg_la_SOURCES += jsimd_none.c
+
endif
-# Executables to build
+TSTHDRS = rrutil.h rrtimer.h
+
bin_PROGRAMS = cjpeg djpeg jpegtran rdjpgcom wrjpgcom
+noinst_PROGRAMS = jpgtest jpegut
-# Executable sources & libs
-cjpeg_SOURCES = cjpeg.c rdppm.c rdgif.c rdtarga.c rdrle.c rdbmp.c \
- rdswitch.c cdjpeg.c
-cjpeg_LDADD = libjpeg.la
-djpeg_SOURCES = djpeg.c wrppm.c wrgif.c wrtarga.c wrrle.c wrbmp.c \
- rdcolmap.c cdjpeg.c
-djpeg_LDADD = libjpeg.la
-jpegtran_SOURCES = jpegtran.c rdswitch.c cdjpeg.c transupp.c
-jpegtran_LDADD = libjpeg.la
-rdjpgcom_SOURCES = rdjpgcom.c
-wrjpgcom_SOURCES = wrjpgcom.c
+jpgtest_SOURCES = $(TSTHDRS) jpgtest.cxx bmp.h bmp.c
-# Manual pages to install
-man_MANS = $(DISTMANS)
+jpgtest_LDADD = libturbojpeg.la
-# Headers to install
-include_HEADERS = $(INSTINCLUDES)
+jpegut_SOURCES = $(TSTHDRS) jpegut.c bmp.h bmp.c
-# Other distributed headers
-noinst_HEADERS = $(OTHERINCLUDES)
+jpegut_LDADD = libturbojpeg.la
-# Other distributed files
-EXTRA_DIST = $(DOCS) $(DISTMANS) $(MKFILES) $(CONFIGFILES) $(SYSDEPSOURCES) \
- $(OTHERFILES) $(TESTFILES)
+cjpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c cjpeg.c rdbmp.c rdgif.c \
+ rdppm.c rdswitch.c rdtarga.c
-# Files to be cleaned
-CLEANFILES = testout.ppm testout.bmp testout.jpg testoutp.ppm testoutp.jpg \
- testoutt.jpg
+cjpeg_LDADD = libjpeg.la
-# Install jconfig.h
-install-data-local:
- $(mkinstalldirs) $(DESTDIR)$(includedir)
- $(INSTALL_HEADER) jconfig.h $(DESTDIR)$(includedir)/jconfig.h
+cjpeg_CFLAGS = -DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED \
+ -DTARGA_SUPPORTED
-# Uninstall jconfig.h
-uninstall-local:
- rm -f $(DESTDIR)$(includedir)/jconfig.h
+djpeg_SOURCES = cdjpeg.h cderror.h cdjpeg.c djpeg.c rdcolmap.c rdswitch.c \
+ wrbmp.c wrgif.c wrppm.c wrtarga.c
-# Run tests
-test: check-local
-check-local:
- rm -f testout*
- ./djpeg -dct int -ppm -outfile testout.ppm $(srcdir)/testorig.jpg
+djpeg_LDADD = libjpeg.la
+
+djpeg_CFLAGS = -DBMP_SUPPORTED -DGIF_SUPPORTED -DPPM_SUPPORTED \
+ -DTARGA_SUPPORTED
+
+jpegtran_SOURCES = jpegtran.c rdswitch.c cdjpeg.c transupp.c transupp.h
+
+jpegtran_LDADD = libjpeg.la
+
+rdjpgcom_SOURCES = rdjpgcom.c
+
+rdjpgcom_LDADD = libjpeg.la
+
+wrjpgcom_SOURCES = wrjpgcom.c
+
+wrjpgcom_LDADD = libjpeg.la
+
+
+dist_man1_MANS = cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1
+
- DOCS= README install.doc usage.doc wizard.doc example.c libjpeg.doc \
- structure.doc coderules.doc filelist.doc jconfig.doc change.log \
++DOCS= README install.txt usage.txt wizard.txt example.c libjpeg.txt \
++ structure.txt coderules.txt filelist.txt jconfig.txt change.log \
+ README-turbo.txt rdrle.c wrrle.c LICENSE.txt LGPL.txt BUILDING.txt \
+ ChangeLog.txt
+
+TESTFILES= testorig.jpg testorig.ppm testimg.bmp testimgflt.jpg \
+ testimgfst.jpg testimgint.jpg testimgp.jpg testimgflt.ppm testimgfst.ppm \
+ testimgint.ppm testimgflt-nosimd.jpg
+
+EXTRA_DIST = win release $(DOCS) $(TESTFILES)
+
+dist-hook:
+ rm -rf `find $(distdir) -name .svn`
+
+
+if WITH_SIMD
+
+test: testclean all
+ ./jpegut
+ ./cjpeg -dct int -outfile testoutint.jpg $(srcdir)/testorig.ppm
+ ./cjpeg -dct fast -opt -outfile testoutfst.jpg $(srcdir)/testorig.ppm
+ ./cjpeg -dct float -outfile testoutflt.jpg $(srcdir)/testorig.ppm
+ cmp $(srcdir)/testimgint.jpg testoutint.jpg
+ cmp $(srcdir)/testimgfst.jpg testoutfst.jpg
+ cmp $(srcdir)/testimgflt.jpg testoutflt.jpg
+ ./djpeg -dct int -fast -ppm -outfile testoutint.ppm $(srcdir)/testorig.jpg
+ ./djpeg -dct fast -ppm -outfile testoutfst.ppm $(srcdir)/testorig.jpg
+ ./djpeg -dct float -ppm -outfile testoutflt.ppm $(srcdir)/testorig.jpg
+ cmp $(srcdir)/testimgint.ppm testoutint.ppm
+ cmp $(srcdir)/testimgfst.ppm testoutfst.ppm
+ cmp $(srcdir)/testimgflt.ppm testoutflt.ppm
+ ./djpeg -dct int -bmp -colors 256 -outfile testout.bmp $(srcdir)/testorig.jpg
+ cmp $(srcdir)/testimg.bmp testout.bmp
+ ./cjpeg -dct int -progressive -outfile testoutp.jpg $(srcdir)/testorig.ppm
+ cmp $(srcdir)/testimgp.jpg testoutp.jpg
+ ./jpegtran -outfile testoutt.jpg testoutp.jpg
+ cmp $(srcdir)/testimgint.jpg testoutt.jpg
+ ./jpegtran -crop 120x90+20+50 -transpose -perfect -outfile testoutcrop.jpg $(srcdir)/testorig.jpg
+ cmp $(srcdir)/testimgcrop.jpg testoutcrop.jpg
+
+else
+
+test: testclean all
+ ./jpegut
+ ./cjpeg -dct int -outfile testoutint.jpg $(srcdir)/testorig.ppm
+ ./cjpeg -dct fast -opt -outfile testoutfst.jpg $(srcdir)/testorig.ppm
+ ./cjpeg -dct float -outfile testoutflt.jpg $(srcdir)/testorig.ppm
+ cmp $(srcdir)/testimgint.jpg testoutint.jpg
+ cmp $(srcdir)/testimgfst.jpg testoutfst.jpg
+ cmp $(srcdir)/testimgflt-nosimd.jpg testoutflt.jpg
+ ./djpeg -dct int -fast -ppm -outfile testoutint.ppm $(srcdir)/testorig.jpg
+ ./djpeg -dct fast -ppm -outfile testoutfst.ppm $(srcdir)/testorig.jpg
+ ./djpeg -dct float -ppm -outfile testoutflt.ppm $(srcdir)/testorig.jpg
+ cmp $(srcdir)/testimgint.ppm testoutint.ppm
+ cmp $(srcdir)/testimgfst.ppm testoutfst.ppm
+ cmp $(srcdir)/testorig.ppm testoutflt.ppm
./djpeg -dct int -bmp -colors 256 -outfile testout.bmp $(srcdir)/testorig.jpg
- ./cjpeg -dct int -outfile testout.jpg $(srcdir)/testimg.ppm
- ./djpeg -dct int -ppm -outfile testoutp.ppm $(srcdir)/testprog.jpg
- ./cjpeg -dct int -progressive -opt -outfile testoutp.jpg $(srcdir)/testimg.ppm
- ./jpegtran -outfile testoutt.jpg $(srcdir)/testprog.jpg
- cmp $(srcdir)/testimg.ppm testout.ppm
cmp $(srcdir)/testimg.bmp testout.bmp
- cmp $(srcdir)/testimg.jpg testout.jpg
- cmp $(srcdir)/testimg.ppm testoutp.ppm
+ ./cjpeg -dct int -progressive -outfile testoutp.jpg $(srcdir)/testorig.ppm
cmp $(srcdir)/testimgp.jpg testoutp.jpg
- cmp $(srcdir)/testorig.jpg testoutt.jpg
+ ./jpegtran -outfile testoutt.jpg testoutp.jpg
+ cmp $(srcdir)/testimgint.jpg testoutt.jpg
+ ./jpegtran -crop 120x90+20+50 -transpose -perfect -outfile testoutcrop.jpg $(srcdir)/testorig.jpg
+ cmp $(srcdir)/testimgcrop.jpg testoutcrop.jpg
+
+endif
+
+testclean:
+ rm -f testout*
+ rm -f *_GRAYQ[0-9]*.bmp
+ rm -f *_GRAYQ[0-9]*.ppm
+ rm -f *_GRAYQ[0-9]*.jpg
+ rm -f *_420Q[0-9]*.bmp
+ rm -f *_420Q[0-9]*.ppm
+ rm -f *_420Q[0-9]*.jpg
+ rm -f *_422Q[0-9]*.bmp
+ rm -f *_422Q[0-9]*.ppm
+ rm -f *_422Q[0-9]*.jpg
+ rm -f *_444Q[0-9]*.bmp
+ rm -f *_444Q[0-9]*.ppm
+ rm -f *_444Q[0-9]*.jpg
+
+rpm: all
+ sh $(srcdir)/release/makerpm ${PACKAGE_NAME} ${VERSION} ${BUILD} \
+ ${RPMARCH} ${srcdir}
+
+srpm: dist-gzip
+ sh $(srcdir)/release/makesrpm ${PACKAGE_NAME} ${VERSION} ${BUILD} ${srcdir}
+
+deb: all
+ sh $(srcdir)/release/makedpkg ${PACKAGE_NAME} ${VERSION} ${BUILD} \
+ ${DEBARCH} ${srcdir}
+
+if X86_64
+
+udmg: all
+ sh $(srcdir)/release/makemacpkg ${PACKAGE_NAME} ${VERSION} ${BUILD} \
+ ${srcdir} universal
+
+endif
+
+dmg: all
+ sh $(srcdir)/release/makemacpkg ${PACKAGE_NAME} ${VERSION} ${BUILD} ${srcdir}
+
+if X86_64
+
+sunpkg: all
+ sh $(srcdir)/release/makesunpkg ${PACKAGE_NAME} ${VERSION} ${BUILD} \
+ ${DEBARCH} ${srcdir} $(CC) $(CXX) combined
+
+nsi: all
+ makensis -nocd -DVERSION=$(VERSION) -DAPPNAME=libjpeg-turbo-gcc64 \
+ -DWLIBDIR=.libs -DWSRCDIR=$(srcdir) -DWBLDDIR=. -DWHDRDIR=. -DWIN64 \
+ -DPLATFORM="GCC 64-bit" -DGCC $(srcdir)/release/libjpeg-turbo.nsi
+
+else
+
+sunpkg: all
+ sh $(srcdir)/release/makesunpkg ${PACKAGE_NAME} ${VERSION} ${BUILD} \
+ ${DEBARCH} ${srcdir} $(CC) $(CXX)
+
+nsi: all
+ makensis -nocd -DVERSION=$(VERSION) -DAPPNAME=libjpeg-turbo-gcc \
+ -DWLIBDIR=.libs -DWSRCDIR=$(srcdir) -DWBLDDIR=. -DWHDRDIR=. \
+ -DPLATFORM="GCC" -DGCC $(srcdir)/release/libjpeg-turbo.nsi
+
+endif
+
+cygwinpkg: all
+ sh $(srcdir)/release/makecygwinpkg ${PACKAGE_NAME} ${VERSION} ${srcdir}
- libjpeg-turbo note: This is the legacy document from the original libjpeg v6b
- release, which is included for reference. The Internet addresses given below
- are likely non-functional. For more information about the libjpeg project,
- please see http://www.ijg.org. For more information about libjpeg-turbo,
- please see http://libjpeg-turbo.virtualgl.org.
++libjpeg-turbo note: This file is mostly taken from the libjpeg v8b README
++file, and it is included only for reference. Some parts of it may not apply to
++libjpeg-turbo. Please see README-turbo.txt for information specific to the
++turbo version.
+
+
The Independent JPEG Group's JPEG software
==========================================
- README for release 6b of 27-Mar-1998
-README for release 8b of 16-May-2010
--====================================
-
-This distribution contains the eighth public release of the Independent JPEG
-Group's free JPEG software. You are welcome to redistribute this software and
-to use it for any purpose, subject to the conditions under LEGAL ISSUES, below.
++This distribution contains a release of the Independent JPEG Group's free JPEG
++software. You are welcome to redistribute this software and to use it for any
++purpose, subject to the conditions under LEGAL ISSUES, below.
- This distribution contains the sixth public release of the Independent JPEG
- Group's free JPEG software. You are welcome to redistribute this software and
- to use it for any purpose, subject to the conditions under LEGAL ISSUES, below.
-
- Serious users of this software (particularly those incorporating it into
- larger programs) should contact IJG at jpeg-info@uunet.uu.net to be added to
- our electronic mailing list. Mailing list members are notified of updates
- and have a chance to participate in technical discussions, etc.
-
- This software is the work of Tom Lane, Philip Gladstone, Jim Boucher,
- Lee Crocker, Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi,
- Guido Vollbeding, Ge' Weijers, and other members of the Independent JPEG
- Group.
+ This software is the work of Tom Lane, Guido Vollbeding, Philip Gladstone,
+ Bill Allombert, Jim Boucher, Lee Crocker, Bob Friesenhahn, Ben Jackson,
+ Julian Minguillon, Luis Ortiz, George Phillips, Davide Rossi, Ge' Weijers,
+ and other members of the Independent JPEG Group.
IJG is not affiliated with the official ISO JPEG standards committee.
LEGAL ISSUES Copyright, lack of warranty, terms of distribution.
REFERENCES Where to learn more about JPEG.
ARCHIVE LOCATIONS Where to find newer versions of this software.
- RELATED SOFTWARE Other stuff you should get.
-ACKNOWLEDGMENTS Special thanks.
FILE FORMAT WARS Software *not* to get.
TO DO Plans for future IJG releases.
OVERVIEW
========
- This package contains C software to implement JPEG image compression and
- decompression. JPEG (pronounced "jay-peg") is a standardized compression
- method for full-color and gray-scale images. JPEG is intended for compressing
- "real-world" scenes; line drawings, cartoons and other non-realistic images
- are not its strong suit. JPEG is lossy, meaning that the output image is not
- exactly identical to the input image. Hence you must not use JPEG if you
- have to have identical output bits. However, on typical photographic images,
- very good compression levels can be obtained with no visible change, and
- remarkably high compression levels are possible if you can tolerate a
- low-quality image. For more details, see the references, or just experiment
- with various compression settings.
+ This package contains C software to implement JPEG image encoding, decoding,
+ and transcoding. JPEG (pronounced "jay-peg") is a standardized compression
-method for full-color and gray-scale images.
++method for full-color and gray-scale images. JPEG's strong suit is compressing
++photographic images or other types of images which have smooth color and
++brightness transitions between neighboring pixels. Images with sharp lines or
++other abrupt features may not compress well with JPEG, and a higher JPEG
++quality may have to be used to avoid visible compression artifacts with such
++images.
++
++JPEG is lossy, meaning that the output pixels are not necessarily identical to
++the input pixels. However, on photographic content and other "smooth" images,
++very good compression ratios can be obtained with no visible compression
++artifacts, and extremely high compression ratios are possible if you are
++willing to sacrifice image quality (by reducing the "quality" setting in the
++compressor.)
This software implements JPEG baseline, extended-sequential, and progressive
compression processes. Provision is made for supporting all variants of these
The Unix configuration script "configure" was produced with GNU Autoconf.
It is copyright by the Free Software Foundation but is freely distributable.
The same holds for its supporting scripts (config.guess, config.sub,
- ltconfig, ltmain.sh). Another support script, install-sh, is copyright
- by M.I.T. but is also freely distributable.
+ ltmain.sh). Another support script, install-sh, is copyright by X Consortium
+ but is also freely distributable.
+It appears that the arithmetic coding option of the JPEG spec is covered by
+patents owned by IBM, AT&T, and Mitsubishi. Hence arithmetic coding cannot
+legally be used without obtaining one or more licenses. For this reason,
+support for arithmetic coding has been removed from the free JPEG software.
+(Since arithmetic coding provides only a marginal gain over the unpatented
+Huffman mode, it is unlikely that very many implementations will support it.)
+So far as we are aware, there are no patent restrictions on the remaining
+code.
+
The IJG distribution formerly included code to read and write GIF files.
To avoid entanglement with the Unisys LZW patent, GIF reading support has
been removed altogether, and the GIF writer has been simplified to produce
sample code is far from industrial-strength, but when you are ready to look
at a full implementation, you've got one here...
- The best full description of JPEG is the textbook "JPEG Still Image Data
- Compression Standard" by William B. Pennebaker and Joan L. Mitchell, published
- by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1. Price US$59.95, 638 pp.
- The book includes the complete text of the ISO JPEG standards (DIS 10918-1
- and draft DIS 10918-2). This is by far the most complete exposition of JPEG
- in existence, and we highly recommend it.
-
- The JPEG standard itself is not available electronically; you must order a
- paper copy through ISO or ITU. (Unless you feel a need to own a certified
- official copy, we recommend buying the Pennebaker and Mitchell book instead;
- it's much cheaper and includes a great deal of useful explanatory material.)
- In the USA, copies of the standard may be ordered from ANSI Sales at (212)
- 642-4900, or from Global Engineering Documents at (800) 854-7179. (ANSI
- doesn't take credit card orders, but Global does.) It's not cheap: as of
- 1992, ANSI was charging $95 for Part 1 and $47 for Part 2, plus 7%
- shipping/handling. The standard is divided into two parts, Part 1 being the
- actual specification, while Part 2 covers compliance testing methods. Part 1
- is titled "Digital Compression and Coding of Continuous-tone Still Images,
+ The best currently available description of JPEG is the textbook "JPEG Still
+ Image Data Compression Standard" by William B. Pennebaker and Joan L.
+ Mitchell, published by Van Nostrand Reinhold, 1993, ISBN 0-442-01272-1.
+ Price US$59.95, 638 pp. The book includes the complete text of the ISO JPEG
+ standards (DIS 10918-1 and draft DIS 10918-2).
+ Although this is by far the most detailed and comprehensive exposition of
+ JPEG publicly available, we point out that it is still missing an explanation
+ of the most essential properties and algorithms of the underlying DCT
+ technology.
-If you think that you know about DCT-based JPEG after reading this book,
-then you are in delusion. The real fundamentals and corresponding potential
-of DCT-based JPEG are not publicly known so far, and that is the reason for
-all the mistaken developments taking place in the image coding domain.
+
+ The original JPEG standard is divided into two parts, Part 1 being the actual
+ specification, while Part 2 covers compliance testing methods. Part 1 is
+ titled "Digital Compression and Coding of Continuous-tone Still Images,
Part 1: Requirements and guidelines" and has document numbers ISO/IEC IS
10918-1, ITU-T T.81. Part 2 is titled "Digital Compression and Coding of
Continuous-tone Still Images, Part 2: Compliance testing" and has document
numbers ISO/IEC IS 10918-2, ITU-T T.83.
-IJG JPEG 8 introduces an implementation of the JPEG SmartScale extension
-which is specified in a contributed document at ITU and ISO with title "ITU-T
-JPEG-Plus Proposal for Extending ITU-T T.81 for Advanced Image Coding", April
-2006, Geneva, Switzerland. The latest version of the document is Revision 3.
- Some extensions to the original JPEG standard are defined in JPEG Part 3,
- a newer ISO standard numbered ISO/IEC IS 10918-3 and ITU-T T.84. IJG
- currently does not support any Part 3 extensions.
-
The JPEG standard does not specify all details of an interchangeable file
format. For the omitted details we follow the "JFIF" conventions, revision
- 1.02. A copy of the JFIF spec is available from:
- Literature Department
- C-Cube Microsystems, Inc.
- 1778 McCarthy Blvd.
- Milpitas, CA 95035
- phone (408) 944-6300, fax (408) 944-6314
- A PostScript version of this document is available by FTP at
- ftp://ftp.uu.net/graphics/jpeg/jfif.ps.gz. There is also a plain text
- version at ftp://ftp.uu.net/graphics/jpeg/jfif.txt.gz, but it is missing
- the figures.
+ 1.02. JFIF 1.02 has been adopted as an Ecma International Technical Report
+ and thus received a formal publication status. It is available as a free
+ download in PDF format from
+ http://www.ecma-international.org/publications/techreports/E-TR-098.htm.
+ A PostScript version of the JFIF document is available at
+ http://www.ijg.org/files/jfif.ps.gz. There is also a plain text version at
+ http://www.ijg.org/files/jfif.txt.gz, but it is missing the figures.
The TIFF 6.0 file format specification can be obtained by FTP from
ftp://ftp.sgi.com/graphics/tiff/TIFF6.ps.gz. The JPEG incorporation scheme
send usenet/news.answers/jpeg-faq/part2
- RELATED SOFTWARE
- ================
-ACKNOWLEDGMENTS
-===============
--
- Numerous viewing and image manipulation programs now support JPEG. (Quite a
- few of them use this library to do so.) The JPEG FAQ described above lists
- some of the more popular free and shareware viewers, and tells where to
- obtain them on Internet.
-Thank to Juergen Bruder for providing me with a copy of the common DCT
-algorithm article, only to find out that I had come to the same result
-in a more direct and comprehensible way with a more generative approach.
--
- If you are on a Unix machine, we highly recommend Jef Poskanzer's free
- PBMPLUS software, which provides many useful operations on PPM-format image
- files. In particular, it can convert PPM images to and from a wide range of
- other formats, thus making cjpeg/djpeg considerably more useful. The latest
- version is distributed by the NetPBM group, and is available from numerous
- sites, notably ftp://wuarchive.wustl.edu/graphics/graphics/packages/NetPBM/.
- Unfortunately PBMPLUS/NETPBM is not nearly as portable as the IJG software is;
- you are likely to have difficulty making it work on any non-Unix machine.
-Thank to Istvan Sebestyen and Joan L. Mitchell for inviting me to the
-ITU JPEG (Study Group 16) meeting in Geneva, Switzerland.
--
- A different free JPEG implementation, written by the PVRG group at Stanford,
- is available from ftp://havefun.stanford.edu/pub/jpeg/. This program
- is designed for research and experimentation rather than production use;
- it is slower, harder to use, and less portable than the IJG code, but it
- is easier to read and modify. Also, the PVRG code supports lossless JPEG,
- which we do not. (On the other hand, it doesn't do progressive JPEG.)
-Thank to Thomas Wiegand and Gary Sullivan for inviting me to the
-Joint Video Team (MPEG & ITU) meeting in Geneva, Switzerland.
-
-Thank to John Korejwa and Massimo Ballerini for inviting me to
-fruitful consultations in Boston, MA and Milan, Italy.
-
-Thank to Hendrik Elstner, Roland Fassauer, Simone Zuck, Guenther
-Maier-Gerber, Walter Stoeber, and Fred Schmitz for corresponding
-business development.
-
-Thank to Nico Zschach and Dirk Stelling of the technical support team
-at the Digital Images company in Halle for providing me with extra
-equipment for configuration tests.
-
-Thank to Richard F. Lyon (then of Foveon Inc.) for fruitful
-communication about JPEG configuration in Sigma Photo Pro software.
-
-Thank to Andrew Finkenstadt for hosting the ijg.org site.
-
-Last but not least special thank to Thomas G. Lane for the original
-design and development of this singular software package.
--
--
FILE FORMAT WARS
================
- Some JPEG programs produce files that are not compatible with our library.
- The root of the problem is that the ISO JPEG committee failed to specify a
- concrete file format. Some vendors "filled in the blanks" on their own,
- creating proprietary formats that no one else could read. (For example, none
- of the early commercial JPEG implementations for the Macintosh were able to
- exchange compressed files.)
-
- The file format we have adopted is called JFIF (see REFERENCES). This format
- has been agreed to by a number of major commercial JPEG vendors, and it has
- become the de facto standard. JFIF is a minimal or "low end" representation.
- We recommend the use of TIFF/JPEG (TIFF revision 6.0 as modified by TIFF
- Technical Note #2) for "high end" applications that need to record a lot of
- additional data about an image. TIFF/JPEG is fairly new and not yet widely
- supported, unfortunately.
-
- The upcoming JPEG Part 3 standard defines a file format called SPIFF.
- SPIFF is interoperable with JFIF, in the sense that most JFIF decoders should
- be able to read the most common variant of SPIFF. SPIFF has some technical
- advantages over JFIF, but its major claim to fame is simply that it is an
- official standard rather than an informal one. At this point it is unclear
- whether SPIFF will supersede JFIF or whether JFIF will remain the de-facto
- standard. IJG intends to support SPIFF once the standard is frozen, but we
- have not decided whether it should become our default output format or not.
- (In any case, our decoder will remain capable of reading JFIF indefinitely.)
-
- Various proprietary file formats incorporating JPEG compression also exist.
- We have little or no sympathy for the existence of these formats. Indeed,
+ The ISO JPEG standards committee actually promotes different formats like
+ "JPEG 2000" or "JPEG XR" which are incompatible with original DCT-based
-JPEG and which are based on faulty technologies. IJG therefore does not
-and will not support such momentary mistakes (see REFERENCES).
-We have little or no sympathy for the promotion of these formats. Indeed,
++JPEG. IJG therefore does not support these formats (see REFERENCES). Indeed,
one of the original reasons for developing this free software was to help
- force convergence on common, open format standards for JPEG files. Don't
- use a proprietary file format!
+ force convergence on common, interoperable format standards for JPEG files.
+ Don't use an incompatible file format!
+ (In any case, our decoder will remain capable of reading existing JPEG
+ image files indefinitely.)
TO DO
=====
- The major thrust for v7 will probably be improvement of visual quality.
- The current method for scaling the quantization tables is known not to be
- very good at low Q values. We also intend to investigate block boundary
- smoothing, "poor man's variable quantization", and other means of improving
- quality-vs-file-size performance without sacrificing compatibility.
-
- In future versions, we are considering supporting some of the upcoming JPEG
- Part 3 extensions --- principally, variable quantization and the SPIFF file
- format.
-
- As always, speeding things up is of great interest.
-Version 8 is the first release of a new generation JPEG standard
-to overcome the limitations of the original JPEG specification.
-More features are being prepared for coming releases...
--
- Please send bug reports, offers of help, etc. to jpeg-info@uunet.uu.net.
+ Please send bug reports, offers of help, etc. to jpeg-info@uc.ag.
--.TH CJPEG 1 "30 December 2009"
++.TH CJPEG 1 "11 October 2010"
.SH NAME
cjpeg \- compress an image file to a JPEG file
.SH SYNOPSIS
.B \-baseline
if you need to ensure compatibility at low quality values.)
.PP
--The
--.B \-quality
--option has been extended in IJG version 7 for support of separate quality
--settings for luminance and chrominance (or in general, for every provided
--quantization table slot). This feature is useful for high-quality
--applications which cannot accept the damage of color data by coarse
--subsampling settings. You can now easily reduce the color data amount more
--smoothly with finer control without separate subsampling. The resulting file
--is fully compliant with standard JPEG decoders.
--Note that the
--.B \-quality
--ratings refer to the quantization table slots, and that the last value is
--replicated if there are more q-table slots than parameters. The default
--q-table slots are 0 for luminance and 1 for chrominance with default tables as
--given in the JPEG standard. This is compatible with the old behaviour in case
--that only one parameter is given, which is then used for both luminance and
--chrominance (slots 0 and 1). More or custom quantization tables can be set
--with
--.B \-qtables
--and assigned to components with
--.B \-qslots
--parameter (see the "wizard" switches below).
--.B Caution:
--You must explicitly add
--.BI \-sample " 1x1"
--for efficient separate color
--quality selection, since the default value used by library is 2x2!
++The \fB-quality\fR option has been extended in this version of \fBcjpeg\fR to
++support separate quality settings for luminance and chrominance (or, in
++general, separate settings for every quantization table slot.) The principle
++is the same as chrominance subsampling: since the human eye is more sensitive
++to spatial changes in brightness than spatial changes in color, the chrominance
++components can be quantized more than the luminance components without
++incurring any visible image quality loss. However, unlike subsampling, this
++feature reduces data in the frequency domain instead of the spatial domain,
++which allows for more fine-grained control. This option is useful in
++quality-sensitive applications, for which the artifacts generated by
++subsampling may be unacceptable.
++.PP
++The \fB-quality\fR option accepts a comma-separated list of parameters, which
++respectively refer to the quality levels which should be assigned to the
++quantization table slots. If there are more q-table slots than parameters,
++then the last parameter is replicated. Thus, if only one quality parameter is
++given, this is used for both luminance and chrominance (slots 0 and 1,
++respectively), preserving the legacy behavior of cjpeg v6b and prior.
++More (or customized) quantization tables can be set with the \fB-qtables\fR
++option and assigned to components with the \fB-qslots\fR option (see the
++"wizard" switches below.)
++.PP
++JPEG files generated with separate luminance and chrominance quality are fully
++compliant with standard JPEG decoders.
++.PP
++.BR CAUTION:
++For this setting to be useful, be sure to pass an argument of \fB-sample 1x1\fR
++to \fBcjpeg\fR to disable chrominance subsampling. Otherwise, the default
++subsampling level (2x2, AKA "4:2:0") will be used.
.PP
The
.B \-progressive
.SH AUTHOR
Independent JPEG Group
.SH BUGS
-GIF input files are no longer supported, to avoid the Unisys LZW patent.
-(Conversion of GIF files to JPEG is usually a bad idea anyway.)
+Arithmetic coding is not supported for legal reasons.
+.PP
- GIF input files are no longer supported, to avoid the Unisys LZW patent.
- (Conversion of GIF files to JPEG is usually a bad idea anyway.)
++Support for GIF input files was removed in cjpeg v6b due to concerns over
++the Unisys LZW patent. Although this patent expired in 2006, cjpeg still
++lacks GIF support, for these historical reasons. (Conversion of GIF files to
++JPEG is usually a bad idea anyway.)
.PP
Not all variants of BMP and Targa file formats are supported.
.PP
- .TH DJPEG 1 "22 August 1997"
-.TH DJPEG 1 "3 October 2009"
++.TH DJPEG 1 "11 October 2010"
.SH NAME
djpeg \- decompress a JPEG file to an image file
.SH SYNOPSIS
* APP12 is used by some digital camera makers for textual info,
* so we provide the ability to display it as text.
* If you like, additional APPn marker types can be selected for display,
-- * but don't try to override APP0 or APP14 this way (see libjpeg.doc).
++ * but don't try to override APP0 or APP14 this way (see libjpeg.txt).
*/
jpeg_set_marker_processor(&cinfo, JPEG_COM, print_text_marker);
jpeg_set_marker_processor(&cinfo, JPEG_APP0+12, print_text_marker);
IJG JPEG LIBRARY: FILE LIST
- Copyright (C) 1994-1998, Thomas G. Lane.
-Copyright (C) 1994-2009, Thomas G. Lane, Guido Vollbeding.
++Copyright (C) 1994-2010, Thomas G. Lane, Guido Vollbeding, D. R. Commander.
This file is part of the Independent JPEG Group's software.
For conditions of distribution and use, see the accompanying README file.
jfdctint.c Forward DCT using slow-but-accurate integer method.
jfdctfst.c Forward DCT using faster, less accurate integer method.
jfdctflt.c Forward DCT using floating-point arithmetic.
-jchuff.c Huffman entropy coding.
-jcarith.c Arithmetic entropy coding.
+jchuff.c Huffman entropy coding for sequential JPEG.
+jcphuff.c Huffman entropy coding for progressive JPEG.
jcmarker.c JPEG marker writing.
- jdatadst.c Data destination manager for stdio output.
+ jdatadst.c Data destination managers for memory and stdio output.
Decompression side of the library:
change.log Version-to-version change highlights.
example.c Sample code for calling JPEG library.
- Configuration/installation files and programs (see install.doc for more info):
+ Configuration/installation files and programs (see install.txt for more info):
configure Unix shell script to perform automatic configuration.
- ltconfig Support scripts for configure (from GNU libtool).
- ltmain.sh
+ configure.ac Source file for use with Autoconf to generate configure.
+ ltmain.sh Support scripts for configure (from GNU libtool).
config.guess
config.sub
+ depcomp
+ missing
install-sh Install shell script for those Unix systems lacking one.
- ckconfig.c Program to generate jconfig.h on non-Unix systems.
- jconfig.doc Template for making jconfig.h by hand.
- makefile.* Sample makefiles for particular systems.
- jconfig.* Sample jconfig.h for particular systems.
- ansi2knr.c De-ANSIfier for pre-ANSI C compilers (courtesy of
- L. Peter Deutsch and Aladdin Enterprises).
-
- Test files (see install.doc for test procedure):
+ Makefile.in Makefile input for configure.
+ Makefile.am Source file for use with Automake to generate Makefile.in.
-ckconfig.c Program to generate jconfig.h on non-Unix systems.
+ jconfig.txt Template for making jconfig.h by hand.
-mak*.* Sample makefiles for particular systems.
-jconfig.* Sample jconfig.h for particular systems.
-libjpeg.map Script to generate shared library with versioned symbols.
+ aclocal.m4 M4 macro definitions for use with Autoconf.
-ansi2knr.c De-ANSIfier for pre-ANSI C compilers (courtesy of
- L. Peter Deutsch and Aladdin Enterprises).
+
+ Test files (see install.txt for test procedure):
test*.* Source and comparison files for confidence test.
These are binary image files, NOT text files.
--.TH JPEGTRAN 1 "28 December 2009"
++.TH JPEGTRAN 1 "11 October 2010"
.SH NAME
jpegtran \- lossless transformation of JPEG files
.SH SYNOPSIS
.TP
.B \-transverse
Transverse transpose (across UR-to-LL axis).
--.IP
++.PP
The transpose transformation has no restrictions regarding image dimensions.
The other transformations operate rather oddly if the image dimensions are not
a multiple of the iMCU size (usually 8 or 16 pixels), because they can only
transform complete blocks of DCT coefficient data in the desired way.
--.IP
++.PP
.BR jpegtran 's
default behavior when transforming an odd-size image is designed
to preserve exact reversibility and mathematical consistency of the
of transpose and flip operations; for consistency, their actions on edge
pixels are defined to be the same as the end result of the corresponding
transpose-and-flip sequence.
--.IP
++.PP
For practical use, you may prefer to discard any untransformable edge pixels
rather than having a strange-looking strip along the right and/or bottom edges
of a transformed image. To do this, add the
followed by
.B \-rot 180 -trim
trims both edges.
--.IP
--If you are only interested in perfect transformation, add the
--.B \-perfect
--switch:
.TP
.B \-perfect
--Fails with an error if the transformation is not perfect.
++If you are only interested in perfect transformations, add the
++.B \-perfect
++switch. This causes
++.B jpegtran
++to fail with an error if the transformation is not perfect.
.IP
--For example you may want to do
++For example, you may want to do
.IP
.B (jpegtran \-rot 90 -perfect
.I foo.jpg
.I foo.jpg
.B | pnmflip \-r90 | cjpeg)
.IP
--to do a perfect rotation if available or an approximated one if not.
--.PP
--We also offer a lossless-crop option, which discards data outside a given
--image region but losslessly preserves what is inside. Like the rotate and
--flip transforms, lossless crop is restricted by the current JPEG format: the
--upper left corner of the selected region must fall on an iMCU boundary. If
--this does not hold for the given crop parameters, we silently move the upper
--left corner up and/or left to make it so, simultaneously increasing the region
--dimensions to keep the lower right crop corner unchanged. (Thus, the output
--image covers at least the requested region, but may cover more.)
--
--The image can be losslessly cropped by giving the switch:
++to do a perfect rotation, if available, or an approximated one if not.
.TP
.B \-crop WxH+X+Y
--Crop to a rectangular subarea of width W, height H starting at point X,Y.
++Crop the image to a rectangular region of width W and height H, starting at
++point X,Y. The lossless crop feature discards data outside of a given image
++region but losslessly preserves what is inside. Like the rotate and flip
++transforms, lossless crop is restricted by the current JPEG format; the upper
++left corner of the selected region must fall on an iMCU boundary. If it
++doesn't, then it is silently moved up and/or left to the nearest iMCU boundary
++(the lower right corner is unchanged.)
.PP
Other not-strictly-lossless transformation switches are:
.TP
comments and other excess baggage present in the source file.
.TP
.B \-copy comments
--Copy only comment markers. This setting copies comments from the source file,
--but discards any other inessential (for image display) data.
++Copy only comment markers. This setting copies comments from the source file
++but discards any other data which is inessential for image display.
.TP
.B \-copy all
Copy all extra markers. This setting preserves miscellaneous markers
found in the source file, such as JFIF thumbnails, Exif data, and Photoshop
--settings. In some files these extra markers can be sizable.
--.IP
--The default behavior is
--.BR "\-copy comments" .
--(Note: in IJG releases v6 and v6a,
--.B jpegtran
--always did the equivalent of
--.BR "\-copy none" .)
++settings. In some files, these extra markers can be sizable.
++.PP
++The default behavior is \fB-copy comments\fR. (Note: in IJG releases v6 and
++v6a, \fBjpegtran\fR always did the equivalent of \fB-copy none\fR.)
.PP
Additional switches recognized by jpegtran are:
.TP
USING THE IJG JPEG LIBRARY
- Copyright (C) 1994-1998, Thomas G. Lane.
-Copyright (C) 1994-2009, Thomas G. Lane, Guido Vollbeding.
++Copyright (C) 1994-2010, Thomas G. Lane, Guido Vollbeding, D. R. Commander.
This file is part of the Independent JPEG Group's software.
For conditions of distribution and use, see the accompanying README file.
can't be expressed as a simple scalar multiplier, in which case the
premise of this routine collapses. Caveat user.
- Set default quantization tables with linear q_scale_factor[] values
- (see below).
+ jpeg_default_qtables (j_compress_ptr cinfo, boolean force_baseline)
++ [libjpeg v7/v8 only] Set default quantization tables with linear
++ q_scale_factor[] values (see below).
+
jpeg_add_quant_table (j_compress_ptr cinfo, int which_tbl,
const unsigned int *basic_table,
int scale_factor, boolean force_baseline)
routines will set up table slot 0 for luminance quality and table
slot 1 for chrominance.
- Linear quantization scaling factors (percentage, initialized 100)
- for use with jpeg_default_qtables().
+ int q_scale_factor[NUM_QUANT_TBLS]
- Note that the q_scale_factor[] fields are the "linear" scales, so you
- have to convert from user-defined ratings via jpeg_quality_scaling().
- Here is an example code which corresponds to cjpeg -quality 90,70:
++ [libjpeg v7+ only] Linear quantization scaling factors (0-100, default
++ 100) for use with jpeg_default_qtables().
+ See rdswitch.c and cjpeg.c for an example of usage.
- CAUTION: You must also set 1x1 subsampling for efficient separate
- color quality selection, since the default value used by library
- is 2x2:
++ Note that the q_scale_factor[] values use "linear" scales, so JPEG
++ quality levels chosen by the user must be converted to these scales
++ using jpeg_quality_scaling(). Here is an example which corresponds to
++ cjpeg -quality 90,70:
+
+ jpeg_set_defaults(cinfo);
+
+ /* Set luminance quality 90. */
+ cinfo->q_scale_factor[0] = jpeg_quality_scaling(90);
+ /* Set chrominance quality 70. */
+ cinfo->q_scale_factor[1] = jpeg_quality_scaling(70);
+
+ jpeg_default_qtables(cinfo, force_baseline);
+
++ CAUTION: Setting separate quality levels for chrominance and luminance
++ is mainly only useful if chrominance subsampling is disabled. 2x2
++ chrominance subsampling (AKA "4:2:0") is the default, but you can
++ explicitly disable subsampling as follows:
+
+ cinfo->comp_info[0].v_samp_factor = 1;
+ cinfo->comp_info[0].h_samp_factor = 1;
+
JHUFF_TBL * dc_huff_tbl_ptrs[NUM_HUFF_TBLS]
JHUFF_TBL * ac_huff_tbl_ptrs[NUM_HUFF_TBLS]
Pointers to Huffman coding tables, one per table slot, or NULL if
by setting optimize_coding, as discussed above; there's seldom
any need to mess with providing your own Huffman tables.
-The actual dimensions of the JPEG image that will be written to the file are
-given by the following fields. These are computed from the input image
-dimensions and the compression parameters by jpeg_start_compress(). You can
-also call jpeg_calc_jpeg_dimensions() to obtain the values that will result
-from the current parameter settings. This can be useful if you are trying
-to pick a scaling ratio that will get close to a desired target size.
+
++[libjpeg v7+ only] The actual dimensions of the JPEG image that will be written
++to the file are given by the following fields. These are computed from the
++input image dimensions and the compression parameters by jpeg_start_compress().
++You can also call jpeg_calc_jpeg_dimensions() to obtain the values that will
++result from the current parameter settings.
+
+ JDIMENSION jpeg_width Actual dimensions of output image.
+ JDIMENSION jpeg_height
+
+
+There are some additional cinfo fields which are not documented here
+because you currently can't change them; for example, you can't set
+arith_code TRUE because arithmetic coding is unsupported.
+
+
Per-component parameters are stored in the struct cinfo.comp_info[i] for
component number i. Note that components here refer to components of the
JPEG color space, *not* the source image color space. A suitably large
--- /dev/null
- File "${WSRCDIR}\libjpeg.doc"
+!include x64.nsh
+Name "libjpeg-turbo SDK for ${PLATFORM}"
+OutFile ${WBLDDIR}\${APPNAME}.exe
+InstallDir c:\${APPNAME}
+
+SetCompressor bzip2
+
+Page directory
+Page instfiles
+
+UninstPage uninstConfirm
+UninstPage instfiles
+
+Section "libjpeg-turbo SDK for ${PLATFORM} (required)"
+!ifdef WIN64
+ ${If} ${RunningX64}
+ ${DisableX64FSRedirection}
+ ${Endif}
+!endif
+ SectionIn RO
+!ifdef GCC
+ IfFileExists $SYSDIR/libturbojpeg.dll exists 0
+!else
+ IfFileExists $SYSDIR/turbojpeg.dll exists 0
+!endif
+ goto notexists
+ exists:
+!ifdef GCC
+ MessageBox MB_OK "An existing version of the libjpeg-turbo SDK for ${PLATFORM} is already installed. Please uninstall it first."
+!else
+ MessageBox MB_OK "An existing version of the libjpeg-turbo SDK for ${PLATFORM} or the TurboJPEG SDK is already installed. Please uninstall it first."
+!endif
+ quit
+
+ notexists:
+ SetOutPath $SYSDIR
+!ifdef GCC
+ File "${WLIBDIR}\libturbojpeg.dll"
+!else
+ File "${WLIBDIR}\turbojpeg.dll"
+!endif
+ SetOutPath $INSTDIR\bin
+!ifdef GCC
+ File "/oname=libjpeg-62.dll" "${WLIBDIR}\libjpeg-*.dll"
+!else
+ File "${WLIBDIR}\jpeg62.dll"
+!endif
+ SetOutPath $INSTDIR\lib
+!ifdef GCC
+ File "${WLIBDIR}\libturbojpeg.dll.a"
+ File "${WLIBDIR}\libturbojpeg.a"
+ File "${WLIBDIR}\libjpeg.dll.a"
+ File "${WLIBDIR}\libjpeg.a"
+!else
+ File "${WLIBDIR}\turbojpeg.lib"
+ File "${WLIBDIR}\turbojpeg-static.lib"
+ File "${WLIBDIR}\jpeg.lib"
+ File "${WLIBDIR}\jpeg-static.lib"
+!endif
+ SetOutPath $INSTDIR\include
+ File "${WHDRDIR}\jconfig.h"
+ File "${WSRCDIR}\jerror.h"
+ File "${WSRCDIR}\jmorecfg.h"
+ File "${WSRCDIR}\jpeglib.h"
+ File "${WSRCDIR}\turbojpeg.h"
+ SetOutPath $INSTDIR
+ File "${WSRCDIR}\README"
+ File "${WSRCDIR}\README-turbo.txt"
- Delete $INSTDIR\libjpeg.doc
++ File "${WSRCDIR}\libjpeg.txt"
+ File "${WSRCDIR}\LGPL.txt"
+ File "${WSRCDIR}\LICENSE.txt"
+
+ WriteRegStr HKLM "SOFTWARE\${APPNAME} ${VERSION}" "Install_Dir" "$INSTDIR"
+
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME} ${VERSION}" "DisplayName" "libjpeg-turbo SDK v${VERSION} for ${PLATFORM}"
+ WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME} ${VERSION}" "UninstallString" '"$INSTDIR\uninstall_${VERSION}.exe"'
+ WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME} ${VERSION}" "NoModify" 1
+ WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME} ${VERSION}" "NoRepair" 1
+ WriteUninstaller "uninstall_${VERSION}.exe"
+SectionEnd
+
+Section "Uninstall"
+!ifdef WIN64
+ ${If} ${RunningX64}
+ ${DisableX64FSRedirection}
+ ${Endif}
+!endif
+
+ SetShellVarContext all
+
+ DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME} ${VERSION}"
+ DeleteRegKey HKLM "SOFTWARE\${APPNAME} ${VERSION}"
+
+!ifdef GCC
+ Delete $INSTDIR\bin\libjpeg-62.dll
+ Delete $SYSDIR\libturbojpeg.dll
+ Delete $INSTDIR\lib\libturbojpeg.dll.a"
+ Delete $INSTDIR\lib\libturbojpeg.a"
+ Delete $INSTDIR\lib\libjpeg.dll.a"
+ Delete $INSTDIR\lib\libjpeg.a"
+!else
+ Delete $INSTDIR\bin\jpeg62.dll
+ Delete $SYSDIR\turbojpeg.dll
+ Delete $INSTDIR\lib\jpeg.lib
+ Delete $INSTDIR\lib\jpeg-static.lib
+ Delete $INSTDIR\lib\turbojpeg.lib
+ Delete $INSTDIR\lib\turbojpeg-static.lib
+!endif
+ Delete $INSTDIR\include\jconfig.h"
+ Delete $INSTDIR\include\jerror.h"
+ Delete $INSTDIR\include\jmorecfg.h"
+ Delete $INSTDIR\include\jpeglib.h"
+ Delete $INSTDIR\include\turbojpeg.h"
+ Delete $INSTDIR\uninstall_${VERSION}.exe
+ Delete $INSTDIR\README
+ Delete $INSTDIR\README-turbo.txt
++ Delete $INSTDIR\libjpeg.txt
+ Delete $INSTDIR\LGPL.txt
+ Delete $INSTDIR\LICENSE.txt
+
+ RMDir "$INSTDIR\include"
+ RMDir "$INSTDIR\lib"
+ RMDir "$INSTDIR\bin"
+ RMDir "$INSTDIR"
+
+SectionEnd
--- /dev/null
- %doc %{_srcdir}/README-turbo.txt %{_srcdir}/README %{_srcdir}/libjpeg.doc %{_srcdir}/usage.doc %{_srcdir}/LICENSE.txt %{_srcdir}/LGPL.txt
+%ifarch x86_64
+%define __lib lib64
+%else
+%define __lib lib
+%endif
+
+Summary: A SIMD-accelerated JPEG codec which provides both the libjpeg and TurboJPEG APIs
+Name: %{_name}
+Version: %{_version}
+Vendor: The libjpeg-turbo Project
+URL: http://libjpeg-turbo.virtualgl.org
+Group: System Environment/Libraries
+#-->Source0: http://prdownloads.sourceforge.net/libjpeg-turbo/libjpeg-turbo-%{version}.tar.gz
+Release: %{_build}
+License: wxWindows Library License, v3.1
+BuildRoot: %{_blddir}/%{name}-buildroot-%{version}-%{release}
+Prereq: /sbin/ldconfig
+Provides: %{name} = %{version}-%{release}, turbojpeg = 2.00
+Obsoletes: turbojpeg
+
+%description
+libjpeg-turbo is a high-speed version of libjpeg for x86 and x86-64 processors
+which uses SIMD instructions (MMX, SSE2, etc.) to accelerate baseline JPEG
+compression and decompression. libjpeg-turbo is generally 2-4x as fast
+as the unmodified version of libjpeg, all else being equal. libjpeg-turbo also
+includes a wrapper library for the TurboJPEG API used by VirtualGL and
+TurboVNC.
+
+libjpeg-turbo was originally based on libjpeg/SIMD by Miyasaka Masaru, but
+the TigerVNC and VirtualGL projects made numerous enhancements to the codec,
+including improved support for Mac OS X, 64-bit support, support for 32-bit
+and big endian pixel formats, accelerated Huffman encoding/decoding, and
+various bug fixes. The goal was to produce a fully open source codec that
+could replace the partially closed source TurboJPEG/IPP codec used by VirtualGL
+and TurboVNC. libjpeg-turbo generally performs in the range of 80-120% of
+TurboJPEG/IPP. It is faster in some areas but slower in others.
+
+#-->%prep
+#-->%setup -q
+
+#-->%build
+#-->configure libdir=/opt/%{name}/%{__lib} mandir=/opt/%{name}/man --with-pic
+#-->make DESTDIR=$RPM_BUILD_ROOT libdir=/opt/%{name}/%{__lib} mandir=/opt/%{name}/man
+
+%install
+
+rm -rf $RPM_BUILD_ROOT
+make install DESTDIR=$RPM_BUILD_ROOT libdir=/opt/%{name}/%{__lib} mandir=/opt/%{name}/man
+rm -f $RPM_BUILD_ROOT/opt/%{name}/%{__lib}/*.la
+mkdir -p $RPM_BUILD_ROOT/usr/%{__lib}
+mv $RPM_BUILD_ROOT/opt/%{name}/%{__lib}/libturbojpeg.* $RPM_BUILD_ROOT/usr/%{__lib}
+/sbin/ldconfig -n $RPM_BUILD_ROOT/opt/%{name}/%{__lib}
+/sbin/ldconfig -n $RPM_BUILD_ROOT/usr/%{__lib}
+mkdir -p $RPM_BUILD_ROOT/usr/include
+mv $RPM_BUILD_ROOT/opt/%{name}/include/turbojpeg.h $RPM_BUILD_ROOT/usr/include
+ln -fs /usr/include/turbojpeg.h $RPM_BUILD_ROOT/opt/%{name}/include/
+ln -fs /usr/%{__lib}/libturbojpeg.a $RPM_BUILD_ROOT/opt/%{name}/%{__lib}/
+%ifarch x86_64
+%else
+ln -fs %{__lib} $RPM_BUILD_ROOT/opt/%{name}/lib32
+%endif
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root)
++%doc %{_srcdir}/README-turbo.txt %{_srcdir}/README %{_srcdir}/libjpeg.txt %{_srcdir}/usage.txt %{_srcdir}/LICENSE.txt %{_srcdir}/LGPL.txt
+%dir /opt/%{name}
+%dir /opt/%{name}/bin
+/opt/%{name}/bin/cjpeg
+/opt/%{name}/bin/djpeg
+/opt/%{name}/bin/jpegtran
+/opt/%{name}/bin/rdjpgcom
+/opt/%{name}/bin/wrjpgcom
+%dir /opt/%{name}/%{__lib}
+%ifarch x86_64
+%else
+/opt/%{name}/lib32
+%endif
+/opt/%{name}/%{__lib}/libjpeg.so.62.0.0
+/opt/%{name}/%{__lib}/libjpeg.so.62
+/opt/%{name}/%{__lib}/libjpeg.so
+/opt/%{name}/%{__lib}/libjpeg.a
+/opt/%{name}/%{__lib}/libturbojpeg.a
+/usr/%{__lib}/libturbojpeg.so
+/usr/%{__lib}/libturbojpeg.a
+/usr/include/turbojpeg.h
+%dir /opt/%{name}/include
+/opt/%{name}/include/jconfig.h
+/opt/%{name}/include/jerror.h
+/opt/%{name}/include/jmorecfg.h
+/opt/%{name}/include/jpeglib.h
+/opt/%{name}/include/turbojpeg.h
+%dir /opt/%{name}/man
+%dir /opt/%{name}/man/man1
+/opt/%{name}/man/man1/cjpeg.1*
+/opt/%{name}/man/man1/djpeg.1*
+/opt/%{name}/man/man1/jpegtran.1*
+/opt/%{name}/man/man1/rdjpgcom.1*
+/opt/%{name}/man/man1/wrjpgcom.1*
+
+%changelog
--- /dev/null
- install -m 644 $SRCDIR/libjpeg.doc $DOCDIR
- install -m 644 $SRCDIR/usage.doc $DOCDIR
+#!/bin/sh
+
+set -u
+set -e
+trap onexit INT
+trap onexit TERM
+trap onexit EXIT
+
+TMPDIR=
+
+onexit()
+{
+ if [ ! "$TMPDIR" = "" ]; then
+ rm -rf $TMPDIR
+ fi
+}
+
+usage()
+{
+ echo "$0 <package name> <version> <source dir.>"
+ exit 1
+}
+
+if [ $# -lt 3 ]; then usage $0; fi
+PACKAGE_NAME=$1
+VERSION=$2
+SRCDIR=$3
+
+umask 022
+rm -f $PACKAGE_NAME-$VERSION-cygwin.tar.bz2
+TMPDIR=`mktemp -d /tmp/ljtbuild.XXXXXX`
+__PWD=`pwd`
+make install DESTDIR=$TMPDIR/pkg mandir=/opt/$PACKAGE_NAME/man
+rm $TMPDIR/pkg/opt/$PACKAGE_NAME/lib/*.la
+DOCDIR=$TMPDIR/pkg/usr/share/doc/$PACKAGE_NAME-$VERSION
+mkdir -p $DOCDIR
+install -m 644 $SRCDIR/README-turbo.txt $DOCDIR
+install -m 644 $SRCDIR/README $DOCDIR
++install -m 644 $SRCDIR/libjpeg.txt $DOCDIR
++install -m 644 $SRCDIR/usage.txt $DOCDIR
+install -m 644 $SRCDIR/LICENSE.txt $DOCDIR
+install -m 644 $SRCDIR/LGPL.txt $DOCDIR
+ln -fs lib $TMPDIR/pkg/opt/$PACKAGE_NAME/lib32
+cd $TMPDIR/pkg
+tar cfj ../$PACKAGE_NAME-$VERSION-cygwin.tar.bz2 *
+cd $__PWD
+mv $TMPDIR/*.tar.bz2 .
+
+exit 0
--- /dev/null
- install -m 644 $SRCDIR/libjpeg.doc $TMPDIR/usr/share/doc/$DIRNAME-$VERSION
- install -m 644 $SRCDIR/usage.doc $TMPDIR/usr/share/doc/$DIRNAME-$VERSION
+#!/bin/sh
+
+set -u
+set -e
+trap onexit INT
+trap onexit TERM
+trap onexit EXIT
+
+TMPDIR=
+
+onexit()
+{
+ if [ ! "$TMPDIR" = "" ]; then
+ sudo rm -rf $TMPDIR
+ fi
+}
+
+usage()
+{
+ echo "$0 <package name> <version> <build> <DEB architecture> <source dir.>"
+ exit 1
+}
+
+makedeb()
+{
+ SUPPLEMENT=$1
+ DIRNAME=$PACKAGE_NAME
+
+ if [ $SUPPLEMENT = 1 ]; then
+ PACKAGE_NAME=$PACKAGE_NAME\32
+ DEBARCH=amd64
+ __LIB=lib32
+ else
+ __LIB=lib
+ fi
+
+ umask 022
+ rm -f $PACKAGE_NAME\_$DEBARCH.deb
+ TMPDIR=`mktemp -d /tmp/$PACKAGE_NAME-build.XXXXXX`
+ mkdir $TMPDIR/DEBIAN
+ (cat $SRCDIR/release/deb-control.tmpl | sed s/{__PKGNAME}/$PACKAGE_NAME/g \
+ | sed s/{__VERSION}/$VERSION/g | sed s/{__BUILD}/$BUILD/g \
+ | sed s/{__ARCH}/$DEBARCH/g > $TMPDIR/DEBIAN/control)
+
+ make install prefix=$TMPDIR/opt/$DIRNAME libdir=$TMPDIR/opt/$DIRNAME/$__LIB mandir=$TMPDIR/opt/$DIRNAME/man
+ rm -f $TMPDIR/opt/$DIRNAME/$__LIB/*.la
+
+ if [ $SUPPLEMENT = 1 ]; then
+ rm -rf $TMPDIR/opt/$DIRNAME/include
+ rm -rf $TMPDIR/opt/$DIRNAME/man
+ rm -rf $TMPDIR/opt/$DIRNAME/bin
+ fi
+
+ mkdir -p $TMPDIR/usr/$__LIB
+ mv $TMPDIR/opt/$DIRNAME/$__LIB/libturbojpeg.* $TMPDIR/usr/$__LIB
+ ln -fs /usr/$__LIB/libturbojpeg.a $TMPDIR/opt/$DIRNAME/$__LIB/
+ /sbin/ldconfig -n $TMPDIR/opt/$DIRNAME/$__LIB
+ /sbin/ldconfig -n $TMPDIR/usr/$__LIB
+
+ if [ ! $SUPPLEMENT = 1 ]; then
+ if [ "$DEBARCH" = "amd64" ]; then
+ ln -fs lib $TMPDIR/opt/$DIRNAME/lib64
+ else
+ if [ ! "$__LIB" = "lib32" ]; then
+ ln -fs lib $TMPDIR/opt/$DIRNAME/lib32
+ fi
+ fi
+ mkdir -p $TMPDIR/usr/include
+ mv $TMPDIR/opt/$DIRNAME/include/turbojpeg.h $TMPDIR/usr/include
+ ln -fs /usr/include/turbojpeg.h $TMPDIR/opt/$DIRNAME/include/
+ mkdir -p $TMPDIR/usr/share/doc/$DIRNAME-$VERSION
+ install -m 644 $SRCDIR/LICENSE.txt $TMPDIR/usr/share/doc/$DIRNAME-$VERSION
+ install -m 644 $SRCDIR/LGPL.txt $TMPDIR/usr/share/doc/$DIRNAME-$VERSION
+ install -m 644 $SRCDIR/README-turbo.txt $TMPDIR/usr/share/doc/$DIRNAME-$VERSION
+ install -m 644 $SRCDIR/README $TMPDIR/usr/share/doc/$DIRNAME-$VERSION
++ install -m 644 $SRCDIR/libjpeg.txt $TMPDIR/usr/share/doc/$DIRNAME-$VERSION
++ install -m 644 $SRCDIR/usage.txt $TMPDIR/usr/share/doc/$DIRNAME-$VERSION
+ fi
+
+ sudo chown -Rh root:root $TMPDIR/*
+ dpkg -b $TMPDIR $PACKAGE_NAME\_$DEBARCH.deb
+}
+
+if [ $# -lt 5 ]; then usage $0; fi
+PACKAGE_NAME=$1
+VERSION=$2
+BUILD=$3
+DEBARCH=$4
+SRCDIR=$5
+
+makedeb 0
+if [ "$DEBARCH" = "i386" ]; then makedeb 1; fi
+
+exit
--- /dev/null
- install -m 644 $SRCDIR/libjpeg.doc $PKGROOT/Library/Documentation/$PACKAGE_NAME/libjpeg.doc
- install -m 644 $SRCDIR/usage.doc $PKGROOT/Library/Documentation/$PACKAGE_NAME/usage.doc
+#!/bin/sh
+
+set -u
+set -e
+trap onexit INT
+trap onexit TERM
+trap onexit EXIT
+
+TMPDIR=
+
+onexit()
+{
+ if [ ! "$TMPDIR" = "" ]; then
+ sudo rm -rf $TMPDIR
+ fi
+}
+
+usage()
+{
+ echo "$0 <package name> <version> <build> <source dir.> [universal]"
+ exit 1
+}
+
+UNIVERSAL=0
+
+if [ $# -lt 4 ]; then usage $0; fi
+PACKAGE_NAME=$1
+VERSION=$2
+BUILD=$3
+SRCDIR=$4
+if [ $# -gt 4 ]; then
+ if [ "$5" = "universal" ]; then UNIVERSAL=1; fi
+fi
+PACKAGEMAKER=/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker
+
+if [ -f $PACKAGE_NAME.dmg ]; then
+ rm -f $PACKAGE_NAME.dmg
+fi
+
+umask 022
+TMPDIR=`mktemp -d /tmp/$PACKAGE_NAME-build.XXXXXX`
+PKGROOT=$TMPDIR/pkg/Package_Root
+mkdir -p $PKGROOT
+mkdir -p $PKGROOT/opt/$PACKAGE_NAME/bin
+make install DESTDIR=$PKGROOT mandir=/opt/$PACKAGE_NAME/man
+rm -f $PKGROOT/opt/$PACKAGE_NAME/lib/*.la
+mkdir -p $PKGROOT/usr/lib
+mv $PKGROOT/opt/$PACKAGE_NAME/lib/libturbojpeg.* $PKGROOT/usr/lib
+mkdir -p $PKGROOT/usr/include
+mv $PKGROOT/opt/$PACKAGE_NAME/include/turbojpeg.h $PKGROOT/usr/include
+
+if [ $UNIVERSAL = 1 ]; then
+ if [ ! -d $SRCDIR/osxx86 ]; then
+ mkdir -p $SRCDIR/osxx86
+ fi
+ mkdir -p $TMPDIR/dist.x86
+ pushd $SRCDIR/osxx86
+ sh $SRCDIR/configure --with-pic \
+ CFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -O3 -m32' \
+ CXXFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -O3 -m32' \
+ LDFLAGS='-isysroot /Developer/SDKs/MacOSX10.4u.sdk -mmacosx-version-min=10.4 -m32'
+ make install DESTDIR=$TMPDIR/dist.x86
+ popd
+ if [ ! -h $TMPDIR/dist.x86/opt/$PACKAGE_NAME/lib/libjpeg.62.dylib -a \
+ ! -h $PKGROOT/opt/$PACKAGE_NAME/lib/libjpeg.62.dylib ]; then
+ lipo -create \
+ -arch i386 $TMPDIR/dist.x86/opt/$PACKAGE_NAME/lib/libjpeg.62.dylib \
+ -arch x86_64 $PKGROOT/opt/$PACKAGE_NAME/lib/libjpeg.62.dylib \
+ -output $PKGROOT/opt/$PACKAGE_NAME/lib/libjpeg.62.dylib
+ elif [ ! -h $TMPDIR/dist.x86/opt/$PACKAGE_NAME/lib/libjpeg.62.0.0.dylib -a \
+ ! -h $PKGROOT/opt/$PACKAGE_NAME/lib/libjpeg.62.0.0.dylib ]; then
+ lipo -create \
+ -arch i386 $TMPDIR/dist.x86/opt/$PACKAGE_NAME/lib/libjpeg.62.0.0.dylib \
+ -arch x86_64 $PKGROOT/opt/$PACKAGE_NAME/lib/libjpeg.62.0.0.dylib \
+ -output $PKGROOT/opt/$PACKAGE_NAME/lib/libjpeg.62.0.0.dylib
+ fi
+ lipo -create \
+ -arch i386 $TMPDIR/dist.x86/opt/$PACKAGE_NAME/lib/libjpeg.a \
+ -arch x86_64 $PKGROOT/opt/$PACKAGE_NAME/lib/libjpeg.a \
+ -output $PKGROOT/opt/$PACKAGE_NAME/lib/libjpeg.a
+ lipo -create \
+ -arch i386 $TMPDIR/dist.x86/opt/$PACKAGE_NAME/lib/libturbojpeg.dylib \
+ -arch x86_64 $PKGROOT/usr/lib/libturbojpeg.dylib \
+ -output $PKGROOT/usr/lib/libturbojpeg.dylib
+ lipo -create \
+ -arch i386 $TMPDIR/dist.x86/opt/$PACKAGE_NAME/lib/libturbojpeg.a \
+ -arch x86_64 $PKGROOT/usr/lib/libturbojpeg.a \
+ -output $PKGROOT/usr/lib/libturbojpeg.a
+ lipo -create \
+ -arch i386 $TMPDIR/dist.x86/opt/$PACKAGE_NAME/bin/cjpeg \
+ -arch x86_64 $PKGROOT/opt/$PACKAGE_NAME/bin/cjpeg \
+ -output $PKGROOT/opt/$PACKAGE_NAME/bin/cjpeg
+ lipo -create \
+ -arch i386 $TMPDIR/dist.x86/opt/$PACKAGE_NAME/bin/djpeg \
+ -arch x86_64 $PKGROOT/opt/$PACKAGE_NAME/bin/djpeg \
+ -output $PKGROOT/opt/$PACKAGE_NAME/bin/djpeg
+ lipo -create \
+ -arch i386 $TMPDIR/dist.x86/opt/$PACKAGE_NAME/bin/jpegtran \
+ -arch x86_64 $PKGROOT/opt/$PACKAGE_NAME/bin/jpegtran \
+ -output $PKGROOT/opt/$PACKAGE_NAME/bin/jpegtran
+ lipo -create \
+ -arch i386 $TMPDIR/dist.x86/opt/$PACKAGE_NAME/bin/rdjpgcom \
+ -arch x86_64 $PKGROOT/opt/$PACKAGE_NAME/bin/rdjpgcom \
+ -output $PKGROOT/opt/$PACKAGE_NAME/bin/rdjpgcom
+ lipo -create \
+ -arch i386 $TMPDIR/dist.x86/opt/$PACKAGE_NAME/bin/wrjpgcom \
+ -arch x86_64 $PKGROOT/opt/$PACKAGE_NAME/bin/wrjpgcom \
+ -output $PKGROOT/opt/$PACKAGE_NAME/bin/wrjpgcom
+
+fi
+
+install_name_tool -id /opt/$PACKAGE_NAME/lib/libjpeg.62.dylib $PKGROOT/opt/$PACKAGE_NAME/lib/libjpeg.62.dylib
+install_name_tool -id libturbojpeg.dylib $PKGROOT/usr/lib/libturbojpeg.dylib
+
+ln -fs /usr/include/turbojpeg.h $PKGROOT/opt/$PACKAGE_NAME/include/
+ln -fs /usr/lib/libturbojpeg.a $PKGROOT/opt/$PACKAGE_NAME/lib/
+ln -fs lib $PKGROOT/opt/$PACKAGE_NAME/lib32
+ln -fs lib $PKGROOT/opt/$PACKAGE_NAME/lib64
+
+mkdir -p $PKGROOT/Library/Documentation/$PACKAGE_NAME
+chmod 1775 $PKGROOT/Library
+chmod 775 $PKGROOT/Library/Documentation
+mkdir -p $TMPDIR/pkg/Resources
+
+(cat $SRCDIR/release/Description.plist.tmpl | sed s/{__VERSION}/$VERSION/g \
+ | sed s/{__APPNAME}/$PACKAGE_NAME/g \
+ > $TMPDIR/pkg/Description.plist)
+(cat $SRCDIR/release/Info.plist.tmpl | sed s/{__VERSION}/$VERSION/g \
+ | sed s/{__BUILD}/$BUILD/g > $TMPDIR/pkg/Info.plist)
+(cat $SRCDIR/release/uninstall.sh.tmpl \
+ | sed s/{__APPNAME}/$PACKAGE_NAME/g \
+ > $PKGROOT/opt/$PACKAGE_NAME/bin/uninstall)
+chmod 755 $PKGROOT/opt/$PACKAGE_NAME/bin/uninstall
+
+install -m 644 $SRCDIR/LICENSE.txt $PKGROOT/Library/Documentation/$PACKAGE_NAME/LICENSE.txt
+install -m 644 $SRCDIR/LGPL.txt $PKGROOT/Library/Documentation/$PACKAGE_NAME/LGPL.txt
+install -m 644 $SRCDIR/README-turbo.txt $PKGROOT/Library/Documentation/$PACKAGE_NAME/README-turbo.txt
+install -m 644 $SRCDIR/README $PKGROOT/Library/Documentation/$PACKAGE_NAME/README
++install -m 644 $SRCDIR/libjpeg.txt $PKGROOT/Library/Documentation/$PACKAGE_NAME/libjpeg.txt
++install -m 644 $SRCDIR/usage.txt $PKGROOT/Library/Documentation/$PACKAGE_NAME/usage.txt
+
+sudo chown -R root:admin $PKGROOT
+sudo chown -R root:0 $PKGROOT/usr
+cp $SRCDIR/release/License.rtf $SRCDIR/release/Welcome.rtf $SRCDIR/release/ReadMe.rtf $TMPDIR/pkg/Resources/
+
+mkdir $TMPDIR/dmg
+$PACKAGEMAKER -build -v -p $TMPDIR/dmg/$PACKAGE_NAME.pkg \
+ -f $PKGROOT -r $TMPDIR/pkg/Resources \
+ -i $TMPDIR/pkg/Info.plist -d $TMPDIR/pkg/Description.plist
+install -m 644 $SRCDIR/release/uninstall.applescript $TMPDIR
+sudo osacompile -t APPL -o "$TMPDIR/dmg/Uninstall $PACKAGE_NAME.app" $TMPDIR/uninstall.applescript
+sudo chown -R $USER "$TMPDIR/dmg/Uninstall $PACKAGE_NAME.app"
+hdiutil create -fs HFS+ -volname $PACKAGE_NAME-$VERSION \
+ -srcfolder "$TMPDIR/dmg" \
+ $TMPDIR/$PACKAGE_NAME.dmg
+cp $TMPDIR/$PACKAGE_NAME.dmg .
+
+exit
--- /dev/null
- cp $SRCDIR/LICENSE.txt $SRCDIR/LGPL.txt $SRCDIR/README-turbo.txt $SRCDIR/README $SRCDIR/libjpeg.doc $SRCDIR/usage.doc $TMPDIR/opt/$PACKAGE_NAME/doc
+#!/bin/sh
+
+set -u
+set -e
+trap onexit INT
+trap onexit TERM
+trap onexit EXIT
+
+TMPDIR=
+
+onexit()
+{
+ if [ ! "$TMPDIR" = "" ]; then
+ rm -rf $TMPDIR
+ fi
+}
+
+usage()
+{
+ echo "$0 <package name> <version> <build> <package architecture> <source dir.> [combined]"
+ exit 1
+}
+
+COMBINED=0
+
+if [ $# -lt 4 ]; then usage $0; fi
+PACKAGE_NAME=$1
+VERSION=$2
+BUILD=$3
+PKGARCH=$4
+SRCDIR=$5
+CC=$6
+CXX=$7
+if [ $# -gt 7 ]; then
+ if [ "$8" = "combined" ]; then COMBINED=1; fi
+fi
+
+umask 022
+TMPDIR=`mktemp -d /tmp/$PACKAGE_NAME-build.XXXXXX`
+rm -f $PACKAGE_NAME.pkg.bz2
+cp $SRCDIR/release/copyright $TMPDIR
+touch $TMPDIR/depend
+cat $SRCDIR/release/pkginfo.tmpl | sed s/{__VERSION}/$VERSION/g \
+ | sed s/{__BUILD}/$BUILD/g | sed s/{__APPNAME}/$PACKAGE_NAME/g \
+ | sed s/{__PKGNAME}/$PACKAGE_NAME/g > $TMPDIR/pkginfo
+
+if [ "$PKGARCH" = "i386" ]; then
+ __LIB=lib
+else
+ __LIB=lib/$PKGARCH
+fi
+
+# This mess is to work around a bug in /usr/ccs/bin/make
+if [ $COMBINED = 1 ]; then
+ if [ ! -d $SRCDIR/solx86 ]; then
+ mkdir -p $SRCDIR/solx86
+ fi
+ PWD=`pwd`
+ cd $SRCDIR/solx86
+ sh $SRCDIR/configure --with-pic CC=$CC CXX=$CXX CFLAGS= CXXFLAGS= LDFLAGS= host_alias=
+ make install DESTDIR=$TMPDIR mandir=/opt/$PACKAGE_NAME/man AM_MAKEFLAGS="mandir=/opt/$PACKAGE_NAME/man"
+ cd $PWD
+fi
+make install DESTDIR=$TMPDIR libdir=/opt/$PACKAGE_NAME/$__LIB mandir=/opt/$PACKAGE_NAME/man AM_MAKEFLAGS="libdir=/opt/$PACKAGE_NAME/$__LIB mandir=/opt/$PACKAGE_NAME/man"
+rm -f $TMPDIR/opt/$PACKAGE_NAME/$__LIB/*.la
+mkdir -p $TMPDIR/opt/$PACKAGE_NAME/doc
- f none $PACKAGE_NAME/doc/libjpeg.doc 0644 root bin
++cp $SRCDIR/LICENSE.txt $SRCDIR/LGPL.txt $SRCDIR/README-turbo.txt $SRCDIR/README $SRCDIR/libjpeg.txt $SRCDIR/usage.txt $TMPDIR/opt/$PACKAGE_NAME/doc
+chmod 644 $TMPDIR/opt/$PACKAGE_NAME/doc/*
+
+cat >$TMPDIR/proto <<EOF
+i copyright
+i depend
+i pkginfo
+d none $PACKAGE_NAME 0755 root bin
+d none $PACKAGE_NAME/bin 0755 root bin
+f none $PACKAGE_NAME/bin/cjpeg 0755 root bin
+f none $PACKAGE_NAME/bin/djpeg 0755 root bin
+f none $PACKAGE_NAME/bin/jpegtran 0755 root bin
+f none $PACKAGE_NAME/bin/rdjpgcom 0755 root bin
+f none $PACKAGE_NAME/bin/wrjpgcom 0755 root bin
+d none $PACKAGE_NAME/lib 0755 root bin
+EOF
+if [ $COMBINED = 1 ]; then
+cat >>$TMPDIR/proto <<EOF
+f none $PACKAGE_NAME/lib/libjpeg.so.62.0.0 0755 root bin
+s none $PACKAGE_NAME/lib/libjpeg.so.62=libjpeg.so.62.0.0
+s none $PACKAGE_NAME/lib/libjpeg.so=libjpeg.so.62.0.0
+f none $PACKAGE_NAME/lib/libjpeg.a 0644 root bin
+f none $PACKAGE_NAME/lib/libturbojpeg.so 0755 root bin
+f none $PACKAGE_NAME/lib/libturbojpeg.a 0644 root bin
+EOF
+fi
+if [ "${__LIB}" != "lib" ]; then
+echo d none $PACKAGE_NAME/${__LIB} 0755 root bin >>$TMPDIR/proto
+echo s none $PACKAGE_NAME/lib64=${__LIB} >>$TMPDIR/proto
+echo s none $PACKAGE_NAME/lib/64=$PKGARCH >>$TMPDIR/proto
+fi
+cat >>$TMPDIR/proto <<EOF
+f none $PACKAGE_NAME/${__LIB}/libjpeg.so.62.0.0 0755 root bin
+s none $PACKAGE_NAME/${__LIB}/libjpeg.so.62=libjpeg.so.62.0.0
+s none $PACKAGE_NAME/${__LIB}/libjpeg.so=libjpeg.so.62.0.0
+f none $PACKAGE_NAME/${__LIB}/libjpeg.a 0644 root bin
+f none $PACKAGE_NAME/${__LIB}/libturbojpeg.so 0755 root bin
+f none $PACKAGE_NAME/${__LIB}/libturbojpeg.a 0644 root bin
+s none $PACKAGE_NAME/lib32=lib
+d none $PACKAGE_NAME/man 0755 root bin
+d none $PACKAGE_NAME/man/man1 0755 root bin
+d none $PACKAGE_NAME/man/man1/cjpeg.1 0644 root bin
+d none $PACKAGE_NAME/man/man1/djpeg.1 0644 root bin
+d none $PACKAGE_NAME/man/man1/jpegtran.1 0644 root bin
+d none $PACKAGE_NAME/man/man1/rdjpgcom.1 0644 root bin
+d none $PACKAGE_NAME/man/man1/wrjpgcom.1 0644 root bin
+d none $PACKAGE_NAME/include 0755 root bin
+f none $PACKAGE_NAME/include/jconfig.h 0644 root bin
+f none $PACKAGE_NAME/include/jerror.h 0644 root bin
+f none $PACKAGE_NAME/include/jmorecfg.h 0644 root bin
+f none $PACKAGE_NAME/include/jpeglib.h 0644 root bin
+f none $PACKAGE_NAME/include/turbojpeg.h 0644 root bin
+d none $PACKAGE_NAME/doc 0755 root bin
+f none $PACKAGE_NAME/doc/LGPL.txt 0644 root bin
- f none $PACKAGE_NAME/doc/usage.doc 0644 root bin
++f none $PACKAGE_NAME/doc/libjpeg.txt 0644 root bin
+f none $PACKAGE_NAME/doc/LICENSE.txt 0644 root bin
+f none $PACKAGE_NAME/doc/README 0644 root bin
+f none $PACKAGE_NAME/doc/README-turbo.txt 0644 root bin
++f none $PACKAGE_NAME/doc/usage.txt 0644 root bin
+EOF
+
+pkgmk -o -r $TMPDIR/opt -d $TMPDIR -a i386 -f $TMPDIR/proto
+pkgtrans -s $TMPDIR $TMPDIR/$PACKAGE_NAME.pkg $PACKAGE_NAME
+bzip2 $TMPDIR/$PACKAGE_NAME.pkg
+cp $TMPDIR/$PACKAGE_NAME.pkg.bz2 .
+
+exit
other JPEG programs may be unable to decode the resulting file. Use -baseline
if you need to ensure compatibility at low quality values.)
-The -quality option has been extended in IJG version 7 for support of separate
-quality settings for luminance and chrominance (or in general, for every
-provided quantization table slot). This feature is useful for high-quality
-applications which cannot accept the damage of color data by coarse
-subsampling settings. You can now easily reduce the color data amount more
-smoothly with finer control without separate subsampling. The resulting file
-is fully compliant with standard JPEG decoders.
-Note that the -quality ratings refer to the quantization table slots, and that
-the last value is replicated if there are more q-table slots than parameters.
-The default q-table slots are 0 for luminance and 1 for chrominance with
-default tables as given in the JPEG standard. This is compatible with the old
-behaviour in case that only one parameter is given, which is then used for
-both luminance and chrominance (slots 0 and 1). More or custom quantization
-tables can be set with -qtables and assigned to components with -qslots
-parameter (see the "wizard" switches below).
-CAUTION: You must explicitly add -sample 1x1 for efficient separate color
-quality selection, since the default value used by library is 2x2!
++The -quality option has been extended in this version of cjpeg to support
++separate quality settings for luminance and chrominance (or, in general,
++separate settings for every quantization table slot.) The principle is the
++same as chrominance subsampling: since the human eye is more sensitive to
++spatial changes in brightness than spatial changes in color, the chrominance
++components can be quantized more than the luminance components without
++incurring any visible image quality loss. However, unlike subsampling, this
++feature reduces data in the frequency domain instead of the spatial domain,
++which allows for more fine-grained control. This option is useful in
++quality-sensitive applications, for which the artifacts generated by
++subsampling may be unacceptable.
++
++The -quality option accepts a comma-separated list of parameters, which
++respectively refer to the quality levels which should be assigned to the
++quantization table slots. If there are more q-table slots than parameters,
++then the last parameter is replicated. Thus, if only one quality parameter is
++given, this is used for both luminance and chrominance (slots 0 and 1,
++respectively), preserving the legacy behavior of cjpeg v6b and prior. More (or
++customized) quantization tables can be set with the -qtables option and
++assigned to components with the -qslots option (see the "wizard" switches
++below.)
++
++JPEG files generated with separate luminance and chrominance quality are
++fully compliant with standard JPEG decoders.
++
++CAUTION: For this setting to be useful, be sure to pass an argument of
++-sample 1x1 to cjpeg to disable chrominance subsampling. Otherwise, the
++default subsampling level (2x2, AKA "4:2:0") will be used.
+
The -progressive switch creates a "progressive JPEG" file. In this type of
JPEG file, the data is stored in multiple scans of increasing quality. If the
file is being transmitted over a slow communications link, the decoder can use
is often a lot more than it is on larger files. (At present, -optimize
mode is always selected when generating progressive JPEG files.)
--GIF input files are no longer supported, to avoid the Unisys LZW patent.
- Use a Unisys-licensed program if you need to read a GIF file. (Conversion
- of GIF files to JPEG is usually a bad idea anyway.)
-(Conversion of GIF files to JPEG is usually a bad idea anyway.)
++Support for GIF input files was removed in cjpeg v6b due to concerns over
++the Unisys LZW patent. Although this patent expired in 2006, cjpeg still
++lacks GIF support, for these historical reasons. (Conversion of GIF files to
++JPEG is usually a bad idea anyway.)
HINTS FOR DJPEG
"-rot 270 -trim" trims only the bottom edge, but "-rot 90 -trim" followed by
"-rot 180 -trim" trims both edges.
- Another not-strictly-lossless transformation switch is:
-If you are only interested in perfect transformation, add the -perfect switch:
- -perfect Fails with an error if the transformation is not
++If you are only interested in perfect transformations, add the -perfect switch:
++ -perfect Fail with an error if the transformation is not
+ perfect.
-For example you may want to do
++For example, you may want to do
+ jpegtran -rot 90 -perfect foo.jpg || djpeg foo.jpg | pnmflip -r90 | cjpeg
-to do a perfect rotation if available or an approximated one if not.
++to do a perfect rotation, if available, or an approximated one if not.
+
-We also offer a lossless-crop option, which discards data outside a given
-image region but losslessly preserves what is inside. Like the rotate and
-flip transforms, lossless crop is restricted by the current JPEG format: the
-upper left corner of the selected region must fall on an iMCU boundary. If
-this does not hold for the given crop parameters, we silently move the upper
-left corner up and/or left to make it so, simultaneously increasing the region
-dimensions to keep the lower right crop corner unchanged. (Thus, the output
-image covers at least the requested region, but may cover more.)
++This version of jpegtran also offers a lossless crop option, which discards
++data outside of a given image region but losslessly preserves what is inside.
++Like the rotate and flip transforms, lossless crop is restricted by the current
++JPEG format; the upper left corner of the selected region must fall on an iMCU
++boundary. If it doesn't, then it is silently moved up and/or left to the
++nearest iMCU boundary (the lower right corner is unchanged.)
+
+ The image can be losslessly cropped by giving the switch:
- -crop WxH+X+Y Crop to a rectangular subarea of width W, height H
++ -crop WxH+X+Y Crop to a rectangular region of width W and height H,
+ starting at point X,Y.
+
+ Other not-strictly-lossless transformation switches are:
+
-grayscale Force grayscale output.
This option discards the chrominance channels if the input image is YCbCr
(ie, a standard color JPEG), resulting in a grayscale JPEG file. The
suppresses all comments and other excess baggage
present in the source file.
-copy comments Copy only comment markers. This setting copies
-- comments from the source file, but discards
- any other inessential data.
- any other inessential (for image display) data.
++ comments from the source file but discards
++ any other data which is inessential for image display.
-copy all Copy all extra markers. This setting preserves
miscellaneous markers found in the source file, such
- as JFIF thumbnails and Photoshop settings. In some
- files these extra markers can be sizable.
+ as JFIF thumbnails, Exif data, and Photoshop settings.
- In some files these extra markers can be sizable.
++ In some files, these extra markers can be sizable.
The default behavior is -copy comments. (Note: in IJG releases v6 and v6a,
jpegtran always did the equivalent of -copy none.)
rdjpgcom searches a JPEG file and prints the contents of any COM blocks on
standard output. The command line syntax is
- rdjpgcom [-verbose] [inputfilename]
+ rdjpgcom [-raw] [-verbose] [inputfilename]
-The switch "-raw" (or just "-r") causes rdjpgcom to also output non-printable
-characters in comments, which are normally escaped for security reasons.
++The switch "-raw" (or just "-r") causes rdjpgcom to output non-printable
++characters in JPEG comments. These characters are normally escaped for
++security reasons.
The switch "-verbose" (or just "-v") causes rdjpgcom to also display the JPEG
image dimensions. If you omit the input file name from the command line,
the JPEG file is read from standard input. (This may not work on some