Commit e82afe27 authored by Mathieu Malaterre's avatar Mathieu Malaterre

Import Upstream version 1.2.3

parent 7c59d3d6
Jpegoptim v1.2.2 Copyright (c) Timo Kokkonen, 1996,2002.
Jpegoptim v1.2.3 Copyright (c) Timo Kokkonen, 1996,2002,2009.
REQUIREMENTS
......@@ -9,6 +9,7 @@ REQUIREMENTS
TESTED PLATFORMS
Linux
Solaris
Darwin/OSX (compiles fine as 64bit app on Snow Leopard)
INSTALLATION
......@@ -16,8 +17,8 @@ INSTALLATION
tar file, make nesessary changes to the Makefile, and then
compile the program. You may wanna do something like this:
zcat jpegoptim-1.2.2.tar.gz | tar xf -
cd jpegoptim-1.2.2
zcat jpegoptim-1.2.3.tar.gz | tar xf -
cd jpegoptim-1.2.3
./configure
make
make strip
......@@ -25,6 +26,9 @@ INSTALLATION
HISTORY
v1.2.3 - IPTC marker support by Dustin Ward,
ICC profile support by Dwight Kelly,
minor fixes
v1.2.2 - Now Exif and COM markers are not discarded
(all other markers are discarded as before).
New options --strip-all, --strip-exif, and --strip-com
......@@ -47,5 +51,5 @@ LATEST VERSION
Timo <tjko@iki.fi>
09-Dec-2002
30-Sep-2009
This diff is collapsed.
#! /bin/sh
# Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# Free Software Foundation, Inc.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
# 2000, 2001, 2002 Free Software Foundation, Inc.
timestamp='2001-09-07'
timestamp='2002-03-07'
# This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software
......@@ -29,7 +29,8 @@ timestamp='2001-09-07'
# configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program.
# Please send patches to <config-patches@gnu.org>.
# Please send patches to <config-patches@gnu.org>. Submit a context
# diff and a properly formatted ChangeLog entry.
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
......@@ -117,7 +118,7 @@ esac
# Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in
nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-*)
nto-qnx* | linux-gnu* | storm-chaos* | os2-emx* | windows32-* | rtmk-nova*)
os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;;
......@@ -226,6 +227,7 @@ case $basic_machine in
1750a | 580 \
| a29k \
| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr \
| c4x | clipper \
| d10v | d30v | dsp16xx \
......@@ -233,25 +235,24 @@ case $basic_machine in
| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
| i370 | i860 | i960 | ia64 \
| m32r | m68000 | m68k | m88k | mcore \
| mips16 | mips64 | mips64el | mips64orion | mips64orionel \
| mips | mips16 | mips64 | mips64el | mips64orion | mips64orionel \
| mips64vr4100 | mips64vr4100el | mips64vr4300 \
| mips64vr4300el | mips64vr5000 | mips64vr5000el \
| mipsbe | mipseb | mipsel | mipsle | mipstx39 | mipstx39el \
| mipsisa32 \
| mipsisa32 | mipsisa64 \
| mn10200 | mn10300 \
| ns16k | ns32k \
| openrisc \
| openrisc | or32 \
| pdp10 | pdp11 | pj | pjl \
| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
| pyramid \
| s390 | s390x \
| sh | sh[34] | sh[34]eb | shbe | shle \
| sparc | sparc64 | sparclet | sparclite | sparcv9 | sparcv9b \
| stormy16 | strongarm \
| sh | sh[34] | sh[34]eb | shbe | shle | sh64 \
| sparc | sparc64 | sparc86x | sparclet | sparclite | sparcv9 | sparcv9b \
| strongarm \
| tahoe | thumb | tic80 | tron \
| v850 \
| v850 | v850e \
| we32k \
| x86 | xscale \
| x86 | xscale | xstormy16 | xtensa \
| z8k)
basic_machine=$basic_machine-unknown
;;
......@@ -278,11 +279,13 @@ case $basic_machine in
580-* \
| a29k-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
| alphapca5[67]-* | arc-* \
| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
| arm-* | armbe-* | armle-* | armv*-* \
| avr-* \
| bs2000-* \
| c[123]* | c30-* | [cjt]90-* | c54x-* \
| clipper-* | cray2-* | cydra-* \
| clipper-* | cydra-* \
| d10v-* | d30v-* \
| elxsi-* \
| f30[01]-* | f700-* | fr30-* | fx80-* \
......@@ -290,7 +293,7 @@ case $basic_machine in
| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
| i*86-* | i860-* | i960-* | ia64-* \
| m32r-* \
| m68000-* | m680[01234]0-* | m68360-* | m683?2-* | m68k-* \
| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
| m88110-* | m88k-* | mcore-* \
| mips-* | mips16-* | mips64-* | mips64el-* | mips64orion-* \
| mips64orionel-* | mips64vr4100-* | mips64vr4100el-* \
......@@ -302,14 +305,14 @@ case $basic_machine in
| powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \
| pyramid-* \
| romp-* | rs6000-* \
| s390-* | s390x-* \
| sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* \
| sparc-* | sparc64-* | sparc86x-* | sparclite-* \
| sparcv9-* | sparcv9b-* | stormy16-* | strongarm-* | sv1-* \
| t3e-* | tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
| v850-* | vax-* \
| sh-* | sh[34]-* | sh[34]eb-* | shbe-* | shle-* | sh64-* \
| sparc-* | sparc64-* | sparc86x-* | sparclet-* | sparclite-* \
| sparcv9-* | sparcv9b-* | strongarm-* | sv1-* | sx?-* \
| tahoe-* | thumb-* | tic30-* | tic54x-* | tic80-* | tron-* \
| v850-* | v850e-* | vax-* \
| we32k-* \
| x86-* | x86_64-* | xmp-* | xps100-* | xscale-* \
| x86-* | x86_64-* | xps100-* | xscale-* | xstormy16-* \
| xtensa-* \
| ymp-* \
| z8k-*)
;;
......@@ -374,6 +377,10 @@ case $basic_machine in
basic_machine=ns32k-sequent
os=-dynix
;;
c90)
basic_machine=c90-cray
os=-unicos
;;
convex-c1)
basic_machine=c1-convex
os=-bsd
......@@ -394,16 +401,8 @@ case $basic_machine in
basic_machine=c38-convex
os=-bsd
;;
cray | ymp)
basic_machine=ymp-cray
os=-unicos
;;
cray2)
basic_machine=cray2-cray
os=-unicos
;;
[cjt]90)
basic_machine=${basic_machine}-cray
cray | j90)
basic_machine=j90-cray
os=-unicos
;;
crds | unos)
......@@ -418,6 +417,14 @@ case $basic_machine in
decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
basic_machine=mips-dec
;;
decsystem10* | dec10*)
basic_machine=pdp10-dec
os=-tops10
;;
decsystem20* | dec20*)
basic_machine=pdp10-dec
os=-tops20
;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
basic_machine=m68k-motorola
......@@ -598,14 +605,6 @@ case $basic_machine in
basic_machine=m68k-atari
os=-mint
;;
mipsel*-linux*)
basic_machine=mipsel-unknown
os=-linux-gnu
;;
mips*-linux*)
basic_machine=mips-unknown
os=-linux-gnu
;;
mips3*-*)
basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
;;
......@@ -620,6 +619,10 @@ case $basic_machine in
basic_machine=m68k-rom68k
os=-coff
;;
morphos)
basic_machine=powerpc-unknown
os=-morphos
;;
msdos)
basic_machine=i386-pc
os=-msdos
......@@ -699,6 +702,10 @@ case $basic_machine in
basic_machine=hppa1.1-oki
os=-proelf
;;
or32 | or32-*)
basic_machine=or32-unknown
os=-coff
;;
OSE68000 | ose68000)
basic_machine=m68000-ericsson
os=-ose
......@@ -724,7 +731,7 @@ case $basic_machine in
pc532 | pc532-*)
basic_machine=ns32k-pc532
;;
pentium | p5 | k5 | k6 | nexgen)
pentium | p5 | k5 | k6 | nexgen | viac3)
basic_machine=i586-pc
;;
pentiumpro | p6 | 6x86 | athlon)
......@@ -733,7 +740,7 @@ case $basic_machine in
pentiumii | pentium2)
basic_machine=i686-pc
;;
pentium-* | p5-* | k5-* | k6-* | nexgen-*)
pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;;
pentiumpro-* | p6-* | 6x86-* | athlon-*)
......@@ -784,6 +791,12 @@ case $basic_machine in
rtpc | rtpc-*)
basic_machine=romp-ibm
;;
s390 | s390-*)
basic_machine=s390-ibm
;;
s390x | s390x-*)
basic_machine=s390x-ibm
;;
sa29200)
basic_machine=a29k-amd
os=-udi
......@@ -795,7 +808,7 @@ case $basic_machine in
basic_machine=sh-hitachi
os=-hms
;;
sparclite-wrs)
sparclite-wrs | simso-wrs)
basic_machine=sparclite-wrs
os=-vxworks
;;
......@@ -853,7 +866,7 @@ case $basic_machine in
sun386 | sun386i | roadrunner)
basic_machine=i386-sun
;;
sv1)
sv1)
basic_machine=sv1-cray
os=-unicos
;;
......@@ -861,8 +874,16 @@ case $basic_machine in
basic_machine=i386-sequent
os=-dynix
;;
t3d)
basic_machine=alpha-cray
os=-unicos
;;
t3e)
basic_machine=t3e-cray
basic_machine=alphaev5-cray
os=-unicos
;;
t90)
basic_machine=t90-cray
os=-unicos
;;
tic54x | c54x*)
......@@ -875,6 +896,10 @@ case $basic_machine in
tx39el)
basic_machine=mipstx39el-unknown
;;
toad1)
basic_machine=pdp10-xkl
os=-tops20
;;
tower | tower-32)
basic_machine=m68k-ncr
;;
......@@ -925,13 +950,13 @@ case $basic_machine in
basic_machine=i386-pc
os=-windows32-msvcrt
;;
xmp)
basic_machine=xmp-cray
os=-unicos
;;
xps | xps100)
basic_machine=xps100-honeywell
;;
ymp)
basic_machine=ymp-cray
os=-unicos
;;
z8k-*-coff)
basic_machine=z8k-unknown
os=-sim
......@@ -952,13 +977,6 @@ case $basic_machine in
op60c)
basic_machine=hppa1.1-oki
;;
mips)
if [ x$os = x-linux-gnu ]; then
basic_machine=mips-unknown
else
basic_machine=mips-mips
fi
;;
romp)
basic_machine=romp-ibm
;;
......@@ -981,6 +999,9 @@ case $basic_machine in
sh3 | sh4 | sh3eb | sh4eb)
basic_machine=sh-unknown
;;
sh64)
basic_machine=sh64-unknown
;;
sparc | sparcv9 | sparcv9b)
basic_machine=sparc-sun
;;
......@@ -1068,7 +1089,8 @@ case $os in
| -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
| -os2* | -vos*)
| -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
| -morphos* | -superux* | -rtmk* | -rtmk-nova*)
# Remember, each alternative MUST END IN *, to match a version number.
;;
-qnx*)
......@@ -1120,12 +1142,18 @@ case $os in
-acis*)
os=-aos
;;
-atheos*)
os=-atheos
;;
-386bsd)
os=-bsd
;;
-ctix* | -uts*)
os=-sysv
;;
-nova*)
os=-rtmk-nova
;;
-ns2 )
os=-nextstep2
;;
......@@ -1200,6 +1228,7 @@ case $basic_machine in
arm*-semi)
os=-aout
;;
# This must come before the *-dec entry.
pdp10-*)
os=-tops20
;;
......@@ -1230,6 +1259,9 @@ case $basic_machine in
mips*-*)
os=-elf
;;
or32-*)
os=-coff
;;
*-tti) # must be before sparc entry or we get the wrong os.
os=-sysv3
;;
......
.TH JPEGOPTIM 1 "07 Dec 2002"
.TH JPEGOPTIM 1 "30 Sep 2009"
.UC 4
.SH NAME
jpegoptim \- utility to optimize/compress JPEG/JFIF files.
......@@ -16,7 +16,7 @@ jpegoptim \- utility to optimize/compress JPEG/JFIF files.
.I jpegoptim
is used to optimize/compress jpeg files. Program supports lossless
optimization, which is based on optimizing the Huffman tables. And
so called "lossy" optimization where in addtition to optimizing Huffman
so called "lossy" optimization where in addition to optimizing Huffman
tables user can specify upperlimit for image quality.
......@@ -77,6 +77,12 @@ Strip Comment (COM) markers from output file.
.TP 0.6i
.B --strip-exif
Strip EXIF markers from output file.
.TP 0.6i
.B --strip-iptc
Strip IPTC markers from output file.
.TP 0.6i
.B --strip-icc
Strip ICC profiles from output file.
......@@ -91,7 +97,7 @@ jpeginfo(1)
Timo Kokkonen <tjko@iki.fi>
.SH COPYING
Copyright (C) 1996,2002 Timo Kokkonen
Copyright (C) 1996,2002,2009 Timo Kokkonen
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
......
/*******************************************************************
* JPEGoptim
* Copyright (c) Timo Kokkonen, 1996,2002.
* Copyright (c) Timo Kokkonen, 1996,2002,2004.
*
* requires libjpeg.a (from JPEG Group's JPEG software
* release 6a or later...)
*
* $Id: jpegoptim.c,v 1.9 2002/12/09 01:57:43 tjko Exp $
* $Id: jpegoptim.c,v 1.14 2009/09/30 07:16:58 tjko Exp $
*/
#ifdef HAVE_CONFIG_H
......@@ -36,17 +36,22 @@
#include <libgen.h>
#endif
#define VERSIO "1.2.2"
#define VERSIO "1.2.3"
#ifdef BROKEN_METHODDEF
#undef METHODDEF
#define METHODDEF(x) static x
#endif
#define EXIF_JPEG_MARKER JPEG_APP0+1
#define EXIF_IDENT_STRING "Exif\000\000"
#define EXIF_IDENT_STRING_SIZE 6
#define IPTC_JPEG_MARKER JPEG_APP0+13
#define ICC_JPEG_MARKER JPEG_APP0+2
#define ICC_IDENT_STRING "ICC_PROFILE\0"
#define ICC_IDENT_STRING_SIZE 12
void fatal(const char *msg);
......@@ -61,7 +66,7 @@ struct jpeg_decompress_struct dinfo;
struct jpeg_compress_struct cinfo;
struct my_error_mgr jcerr,jderr;
const char *rcsid = "$Id: jpegoptim.c,v 1.9 2002/12/09 01:57:43 tjko Exp $";
const char *rcsid = "$Id: jpegoptim.c,v 1.14 2009/09/30 07:16:58 tjko Exp $";
struct option long_options[] = {
{"verbose",0,0,'v'},
......@@ -77,6 +82,8 @@ struct option long_options[] = {
{"strip-all",0,0,'s'},
{"strip-com",0,0,'c'},
{"strip-exif",0,0,'e'},
{"strip-iptc",0,0,'i'},
{"strip-icc",0,0,'P'},
{0,0,0,0}
};
......@@ -92,13 +99,17 @@ int retry = 0;
int dest = 0;
int force = 0;
int save_exif = 1;
int save_iptc = 1;
int save_com = 1;
int save_icc = 1;
char *outfname = NULL;
FILE *infile = NULL, *outfile = NULL;
JSAMPARRAY buf = NULL;
jvirt_barray_ptr *coef_arrays = NULL;
jpeg_saved_marker_ptr exif_marker = NULL;
jpeg_saved_marker_ptr iptc_marker = NULL;
jpeg_saved_marker_ptr icc_marker = NULL;
long average_count = 0;
double average_rate = 0.0, total_save = 0.0;
......@@ -127,7 +138,7 @@ void p_usage(void)
{
if (!quiet_mode) {
fprintf(stderr,"jpegoptim v" VERSIO
" Copyright (c) Timo Kokkonen, 1996,2002.\n");
" Copyright (c) Timo Kokkonen, 1996-2009.\n");
fprintf(stderr,
"Usage: jpegoptim [options] <filenames> \n\n"
......@@ -149,6 +160,8 @@ void p_usage(void)
" --strip-all strip all (Comment & Exif) markers from output file\n"
" --strip-com strip Comment markers from output file\n"
" --strip-exif strip Exif markers from output file\n"
" --strip-iptc strip IPTC markers from output file\n"
" --strip-icc strip ICC profile markers from output file\n"
"\n\n");
}
......@@ -173,7 +186,7 @@ long file_size(FILE *fp)
if (!fp) return -1;
if (fstat(fileno(fp),&buf)) return -2;
return buf.st_size;
return (long)buf.st_size;
}
int is_directory(const char *path)
......@@ -246,8 +259,8 @@ void fatal(const char *msg)
exit(3);
}
void write_comment_markers(struct jpeg_decompress_struct *dinfo,
struct jpeg_compress_struct *cinfo)
void write_markers(struct jpeg_decompress_struct *dinfo,
struct jpeg_compress_struct *cinfo)
{
jpeg_saved_marker_ptr mrk;
......@@ -255,9 +268,24 @@ void write_comment_markers(struct jpeg_decompress_struct *dinfo,
mrk=dinfo->marker_list;
while (mrk) {
if (mrk->marker == JPEG_COM)
if (save_com && mrk->marker == JPEG_COM)
jpeg_write_marker(cinfo,JPEG_COM,mrk->data,mrk->data_length);
if (save_iptc && mrk->marker == IPTC_JPEG_MARKER)
jpeg_write_marker(cinfo,IPTC_JPEG_MARKER,mrk->data,mrk->data_length);
if (save_exif && mrk->marker == EXIF_JPEG_MARKER) {
if (!memcmp(mrk->data,EXIF_IDENT_STRING,EXIF_IDENT_STRING_SIZE)) {
jpeg_write_marker(cinfo,EXIF_JPEG_MARKER,mrk->data,mrk->data_length);
}
}
if (save_icc && mrk->marker == ICC_JPEG_MARKER) {
if (!memcmp(mrk->data,ICC_IDENT_STRING,ICC_IDENT_STRING_SIZE)) {
jpeg_write_marker(cinfo,ICC_JPEG_MARKER,mrk->data,mrk->data_length);
}
}
mrk=mrk->next;
}
}
......@@ -351,8 +379,8 @@ int main(int argc, char **argv)
case '?':
break;
case 'V':
printf("jpeginfo v%s %s\n",VERSIO,HOST_TYPE);
printf("Copyright (c) Timo Kokkonen, 1996,2002.\n");
printf("jpegoptim v%s %s\n",VERSIO,HOST_TYPE);
printf("Copyright (c) Timo Kokkonen, 1996-2009.\n");
exit(0);
break;
case 'o':
......@@ -363,7 +391,9 @@ int main(int argc, char **argv)
break;
case 's':
save_exif=0;
save_iptc=0;
save_com=0;
save_icc=0;
break;
case 'c':
save_com=0;
......@@ -371,6 +401,12 @@ int main(int argc, char **argv)
case 'e':
save_exif=0;
break;
case 'i':
save_iptc=0;
break;
case 'P':
save_icc=0;
break;
default:
if (!quiet_mode)
......@@ -434,17 +470,29 @@ int main(int argc, char **argv)
global_error_counter=0;
err_count=jderr.pub.num_warnings;
if (save_com) jpeg_save_markers(&dinfo, JPEG_COM, 0xffff);
jpeg_save_markers(&dinfo, EXIF_JPEG_MARKER, 0xffff);
if (save_iptc) jpeg_save_markers(&dinfo, IPTC_JPEG_MARKER, 0xffff);
if (save_exif) jpeg_save_markers(&dinfo, EXIF_JPEG_MARKER, 0xffff);
if (save_icc) jpeg_save_markers(&dinfo, ICC_JPEG_MARKER, 0xffff);
jpeg_stdio_src(&dinfo, infile);
jpeg_read_header(&dinfo, TRUE);
/* check for Exif marker */
/* check for Exif/IPTC markers */
exif_marker=NULL;
iptc_marker=NULL;
icc_marker=NULL;
cmarker=dinfo.marker_list;
while (cmarker) {
/* printf("marker %x len=%d\n",cmarker->marker,cmarker->data_length); */
if (cmarker->marker == EXIF_JPEG_MARKER) {
if (!memcmp(cmarker->data,EXIF_IDENT_STRING,6)) exif_marker=cmarker;
if (!memcmp(cmarker->data,EXIF_IDENT_STRING,EXIF_IDENT_STRING_SIZE))
exif_marker=cmarker;
}
if (cmarker->marker == IPTC_JPEG_MARKER) {
iptc_marker=cmarker;
}
if (cmarker->marker == ICC_JPEG_MARKER) {
if (!memcmp(cmarker->data,ICC_IDENT_STRING,ICC_IDENT_STRING_SIZE))
icc_marker=cmarker;
}
cmarker=cmarker->next;
}
......@@ -455,9 +503,10 @@ int main(int argc, char **argv)
(int)dinfo.image_height,(int)dinfo.num_components*8);
if (exif_marker) printf("Exif ");
else if (dinfo.saw_Adobe_marker) printf("Adobe ");
else if (dinfo.saw_JFIF_marker) printf("JFIF ");
else printf("Unknown ");
if (iptc_marker) printf("IPTC ");
if (icc_marker) printf("ICC ");
if (dinfo.saw_Adobe_marker) printf("Adobe ");
if (dinfo.saw_JFIF_marker) printf("JFIF ");
fflush(stdout);
}
......@@ -527,6 +576,8 @@ int main(int argc, char **argv)
jpeg_stdio_dest(&cinfo, outfile);
if (quality>=0 && !retry) {
/* lossy "optimization" ... */
cinfo.in_color_space=dinfo.out_color_space;
cinfo.input_components=dinfo.output_components;
cinfo.image_width=dinfo.image_width;
......@@ -539,10 +590,7 @@ int main(int argc, char **argv)
jpeg_start_compress(&cinfo,TRUE);
/* write markers */
if (save_exif && exif_marker)
jpeg_write_marker(&cinfo, EXIF_JPEG_MARKER,
exif_marker->data, exif_marker->data_length);
if (save_com) write_comment_markers(&dinfo,&cinfo);
write_markers(&dinfo,&cinfo);
while (cinfo.next_scanline < cinfo.image_height) {
jpeg_write_scanlines(&cinfo,&buf[cinfo.next_scanline],
......@@ -552,16 +600,15 @@ int main(int argc, char **argv)
for (j=0;j<dinfo.output_height;j++) free(buf[j]);
free(buf); buf=NULL;
} else {
/* lossless "optimization" ... */
jpeg_copy_critical_parameters(&dinfo, &cinfo);
cinfo.optimize_coding = TRUE;
jpeg_write_coefficients(&cinfo, coef_arrays);
/* write markers */
if (save_exif && exif_marker)
jpeg_write_marker(&cinfo, EXIF_JPEG_MARKER,
exif_marker->data, exif_marker->data_length);
if (save_com) write_comment_markers(&dinfo,&cinfo);
write_markers(&dinfo,&cinfo);
}
......
Summary: Utility for optimizing/compressing JPEG files.
Name: jpegoptim
Version: 1.2.2
Version: 1.2.3
Release: 1
License: GPL
Group: Applications/Multimedia
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment