Commit e97bb01f authored by Sven Mueller's avatar Sven Mueller Committed by Mathieu Malaterre

Import Debian changes 1.2.2-8

jpegoptim (1.2.2-8) unstable; urgency=low

  * upstream homepage changed or the old one went offline (closes: #450313)
  * incorporate fixes from upstream CVS
  * incorporate upstream code for handling IPTC markers
parent f2447b43
jpegoptim (1.2.2-8) unstable; urgency=low
* upstream homepage changed or the old one went offline (closes: #450313)
* incorporate fixes from upstream CVS
* incorporate upstream code for handling IPTC markers
-- Sven Mueller <sven@debian.org> Thu, 8 Nov 2007 20:35:30 +0100
jpegoptim (1.2.2-7) unstable; urgency=low
* Fix a problem with DEB_BUILD_OPTIONS nostrip option (closes: #437242)
......
#! /bin/sh /usr/share/dpatch/dpatch-run
## 000-upstream-CVS.dpatch by Sven Mueller <sven@debian.org>
##
## All lines beginning with `## DP:' are a description of the patch.
## DP: No description.
@DPATCH@
diff -urNad jpegoptim-1.2.2~/jpegoptim.1 jpegoptim-1.2.2/jpegoptim.1
--- jpegoptim-1.2.2~/jpegoptim.1 2007-11-08 20:35:25.000000000 +0100
+++ jpegoptim-1.2.2/jpegoptim.1 2007-11-08 20:38:56.864004342 +0100
@@ -16,7 +16,7 @@
.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.
diff -urNad jpegoptim-1.2.2~/jpegoptim.c jpegoptim-1.2.2/jpegoptim.c
--- jpegoptim-1.2.2~/jpegoptim.c 2007-11-08 20:35:25.000000000 +0100
+++ jpegoptim-1.2.2/jpegoptim.c 2007-11-08 20:38:42.902400427 +0100
@@ -1,11 +1,11 @@
/*******************************************************************
* 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.13 2004/08/02 00:47:17 tjko Exp $
*/
#ifdef HAVE_CONFIG_H
@@ -36,16 +36,18 @@
#include <libgen.h>
#endif
-#define VERSIO "1.2.2"
+#define VERSIO "1.2.2+cvs"
#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
void fatal(const char *msg);
@@ -61,7 +63,7 @@
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.13 2004/08/02 00:47:17 tjko Exp $";
struct option long_options[] = {
{"verbose",0,0,'v'},
@@ -77,6 +79,7 @@
{"strip-all",0,0,'s'},
{"strip-com",0,0,'c'},
{"strip-exif",0,0,'e'},
+ {"strip-iptc",0,0,'i'},
{0,0,0,0}
};
@@ -92,6 +95,7 @@
int dest = 0;
int force = 0;
int save_exif = 1;
+int save_iptc = 1;
int save_com = 1;
char *outfname = NULL;
FILE *infile = NULL, *outfile = NULL;
@@ -99,6 +103,7 @@
JSAMPARRAY buf = NULL;
jvirt_barray_ptr *coef_arrays = NULL;
jpeg_saved_marker_ptr exif_marker = NULL;
+jpeg_saved_marker_ptr iptc_marker = NULL;
long average_count = 0;
double average_rate = 0.0, total_save = 0.0;
@@ -127,7 +132,7 @@
{
if (!quiet_mode) {
fprintf(stderr,"jpegoptim v" VERSIO
- " Copyright (c) Timo Kokkonen, 1996,2002.\n");
+ " Copyright (c) Timo Kokkonen, 1996,2002,2004.\n");
fprintf(stderr,
"Usage: jpegoptim [options] <filenames> \n\n"
@@ -149,6 +154,7 @@
" --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"
"\n\n");
}
@@ -173,7 +179,7 @@
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 +252,8 @@
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 +261,18 @@
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);
+ }
+ }
+
mrk=mrk->next;
}
}
@@ -351,8 +366,8 @@
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,2002,2004.\n");
exit(0);
break;
case 'o':
@@ -363,6 +378,7 @@
break;
case 's':
save_exif=0;
+ save_iptc=0;
save_com=0;
break;
case 'c':
@@ -371,6 +387,9 @@
case 'e':
save_exif=0;
break;
+ case 'i':
+ save_iptc=0;
+ break;
default:
if (!quiet_mode)
@@ -434,17 +453,23 @@
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);
+
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;
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;
}
cmarker=cmarker->next;
}
@@ -454,7 +479,9 @@
printf("%dx%d %dbit ",(int)dinfo.image_width,
(int)dinfo.image_height,(int)dinfo.num_components*8);
- if (exif_marker) printf("Exif ");
+ if (exif_marker && iptc_marker) printf("Exif/IPTC ");
+ else if (exif_marker) printf("Exif ");
+ else if (iptc_marker) printf("IPTC ");
else if (dinfo.saw_Adobe_marker) printf("Adobe ");
else if (dinfo.saw_JFIF_marker) printf("JFIF ");
else printf("Unknown ");
@@ -527,6 +554,8 @@
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 +568,7 @@
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 +578,15 @@
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);
}
This diff is collapsed.
000-upstream-CVS.dpatch
001-enable-warnings.dpatch
002-update-manpage.dpatch
003-update-config-guess-sub.dpatch
......@@ -8,7 +8,7 @@ version=2
# Uncomment to examine a Webpage
# <Webpage URL> <string match>
http://www.cc.jyu.fi/~tjko/projects.html src/jpegoptim-(.*)\.tar\.gz
http://www.kokkonen.net/tjko/projects.html src/jpegoptim-(.*)\.tar\.gz
# Uncomment to examine a Webserver directory
#http://www.example.com/pub/jpegoptim-(.*)\.tar\.gz
......
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