Hello community,

here is the log from the commit of package libjpeg-turbo.1701 for 
openSUSE:12.3:Update checked in at 2013-06-03 10:55:13
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:12.3:Update/libjpeg-turbo.1701 (Old)
 and      /work/SRC/openSUSE:12.3:Update/.libjpeg-turbo.1701.new (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "libjpeg-turbo.1701"

Changes:
--------
New Changes file:

--- /dev/null   2013-05-23 01:40:31.032032505 +0200
+++ 
/work/SRC/openSUSE:12.3:Update/.libjpeg-turbo.1701.new/libjpeg-turbo.changes    
    2013-06-03 10:55:15.000000000 +0200
@@ -0,0 +1,102 @@
+-------------------------------------------------------------------
+Fri May 17 07:28:47 UTC 2013 - [email protected]
+
+- libjpeg62-turbo package created [bnc#807183]
+
+-------------------------------------------------------------------
+Mon Aug 13 17:05:35 UTC 2012 - [email protected]
+
+- selfconflicts are not possible, remove it
+
+-------------------------------------------------------------------
+Mon Jul 23 11:33:56 UTC 2012 - [email protected]
+
+- Update to version 1.2.1:
+    * fixed heap overflow [bnc#771791]
+
+-------------------------------------------------------------------
+Thu Mar 22 13:25:09 UTC 2012 - [email protected]
+
+- Update to version 1.2.0 
+    * Fixed out-of-bounds read in SSE2 SIMD code
+    * Added a compile-time macro (LIBJPEG_TURBO_VERSION) that can 
+      be used to check the version of libjpeg-turbo against which 
+      an application was compiled.
+    * Added new RGBA/BGRA/ABGR/ARGB colorspace extension constants
+    * libjpeg-turbo will now correctly decompress erroneous 
+      CMYK/YCCK JPEGs whose K component is assigned a component ID 
+      of 1 instead of 4.  
+    * Added SIMD routines for RGB-to-grayscale color conversion
+    * Improved the performance of the C color conversion routines
+    * Added a function to the TurboJPEG API that performs lossless 
+      transforms.
+    * Added support for 4:4:0 (transposed 4:2:2) subsampling
+
+-------------------------------------------------------------------
+Sat Nov 19 20:38:03 UTC 2011 - [email protected]
+
+- add libtool as buildrequire to avoid implicit dependency
+
+-------------------------------------------------------------------
+Sat Nov 12 22:54:58 UTC 2011 - [email protected]
+
+- Open all file descriptors with O_CLOEXEC, extended description
+  in the patch file.
+
+-------------------------------------------------------------------
+Thu May 19 14:44:56 CEST 2011 - [email protected]
+
+- updated to 1.1.1:
+  * Fixed a 1-pixel error in row 0, column 21 of the luminance 
+    plane generated by tjEncodeYUV().
+  * libjpeg-turbo's accelerated Huffman decoder previously 
+    ignored unexpected markers found in the middle of the 
+    JPEG data stream during decompression. It will now 
+    hand off decoding of a particular block to the unaccelerated 
+    Huffman decoder if an unexpected marker is found, so that 
+    the unaccelerated Huffman decoder can generate an appropriate 
+    warning.
+  * Fixed a bug in jpeg_read_coefficients() whereby it would 
+    not initialize cinfo->image_width and cinfo->image_height 
+    if libjpeg v7 or v8 emulation was enabled. This specifically 
+    caused the jpegoptim program to fail if it was linked against 
+    a version of libjpeg-turbo that was built with libjpeg v7 or 
+    v8 emulation.
+  * Eliminated excessive I/O overhead that occurred when reading 
+    BMP files in cjpeg.
+  * 
+
+-------------------------------------------------------------------
+Thu Mar  3 13:53:18 CET 2011 - [email protected]
+
+- updated to 1.1.0:
+  * Added further protections against invalid Huffman codes.
+  * Added an extended version of tjDecompressHeader().
+  * Added arithmetic encoding and decoding support.
+  * TurboJPEG/OSS can now compress from/decompress to 
+    grayscale bitmaps.
+  * Added emulation of the libjpeg v7 and v8 APIs and ABIs.
+  * Added two new TurboJPEG API functions, tjEncodeYUV() and
+    tjDecompressToYUV().
+  * The TurboJPEG dynamic library now uses versioned symbols.
+  * Fixed visual artifacts in grayscale JPEG compression 
+    caused by a typo in the RGB-to-chrominance lookup tables.
+- see ChangeLog.txt for details.
+- removed upstreamed jpegtran.patch and rh639672.patch
+
+-------------------------------------------------------------------
+Tue Dec 14 14:32:56 CET 2010 - [email protected]
+
+- spec file cleanup
+
+-------------------------------------------------------------------
+Fri Dec 10 13:02:58 UTC 2010 - [email protected]
+
+- this jpeg version will be the default to the prejudice of jpeg8
+  from now on
+
+-------------------------------------------------------------------
+Sun Nov  7 12:53:26 UTC 2010 - [email protected]
+
+- created package based on Fedora one (v 1.0.1)
+
New Changes file:

--- /dev/null   2013-05-23 01:40:31.032032505 +0200
+++ 
/work/SRC/openSUSE:12.3:Update/.libjpeg-turbo.1701.new/libjpeg62-turbo.changes  
    2013-06-03 10:55:15.000000000 +0200
@@ -0,0 +1,110 @@
+-------------------------------------------------------------------
+Wed Mar  6 11:19:02 UTC 2013 - [email protected]
+
+- remove
+   %{_bindir}/*
+   %doc %{_mandir}/man1/*
+  https://bugzilla.novell.com/show_bug.cgi?id=807183#c14
+
+-------------------------------------------------------------------
+Wed Mar  6 07:58:46 UTC 2013 - [email protected]
+
+- libjpeg62-turbo package created [bnc#807183]
+
+-------------------------------------------------------------------
+Mon Aug 13 17:05:35 UTC 2012 - [email protected]
+
+- selfconflicts are not possible, remove it
+
+-------------------------------------------------------------------
+Mon Jul 23 11:33:56 UTC 2012 - [email protected]
+
+- Update to version 1.2.1:
+    * fixed heap overflow [bnc#771791]
+
+-------------------------------------------------------------------
+Thu Mar 22 13:25:09 UTC 2012 - [email protected]
+
+- Update to version 1.2.0 
+    * Fixed out-of-bounds read in SSE2 SIMD code
+    * Added a compile-time macro (LIBJPEG_TURBO_VERSION) that can 
+      be used to check the version of libjpeg-turbo against which 
+      an application was compiled.
+    * Added new RGBA/BGRA/ABGR/ARGB colorspace extension constants
+    * libjpeg-turbo will now correctly decompress erroneous 
+      CMYK/YCCK JPEGs whose K component is assigned a component ID 
+      of 1 instead of 4.  
+    * Added SIMD routines for RGB-to-grayscale color conversion
+    * Improved the performance of the C color conversion routines
+    * Added a function to the TurboJPEG API that performs lossless 
+      transforms.
+    * Added support for 4:4:0 (transposed 4:2:2) subsampling
+
+-------------------------------------------------------------------
+Sat Nov 19 20:38:03 UTC 2011 - [email protected]
+
+- add libtool as buildrequire to avoid implicit dependency
+
+-------------------------------------------------------------------
+Sat Nov 12 22:54:58 UTC 2011 - [email protected]
+
+- Open all file descriptors with O_CLOEXEC, extended description
+  in the patch file.
+
+-------------------------------------------------------------------
+Thu May 19 14:44:56 CEST 2011 - [email protected]
+
+- updated to 1.1.1:
+  * Fixed a 1-pixel error in row 0, column 21 of the luminance 
+    plane generated by tjEncodeYUV().
+  * libjpeg-turbo's accelerated Huffman decoder previously 
+    ignored unexpected markers found in the middle of the 
+    JPEG data stream during decompression. It will now 
+    hand off decoding of a particular block to the unaccelerated 
+    Huffman decoder if an unexpected marker is found, so that 
+    the unaccelerated Huffman decoder can generate an appropriate 
+    warning.
+  * Fixed a bug in jpeg_read_coefficients() whereby it would 
+    not initialize cinfo->image_width and cinfo->image_height 
+    if libjpeg v7 or v8 emulation was enabled. This specifically 
+    caused the jpegoptim program to fail if it was linked against 
+    a version of libjpeg-turbo that was built with libjpeg v7 or 
+    v8 emulation.
+  * Eliminated excessive I/O overhead that occurred when reading 
+    BMP files in cjpeg.
+  * 
+
+-------------------------------------------------------------------
+Thu Mar  3 13:53:18 CET 2011 - [email protected]
+
+- updated to 1.1.0:
+  * Added further protections against invalid Huffman codes.
+  * Added an extended version of tjDecompressHeader().
+  * Added arithmetic encoding and decoding support.
+  * TurboJPEG/OSS can now compress from/decompress to 
+    grayscale bitmaps.
+  * Added emulation of the libjpeg v7 and v8 APIs and ABIs.
+  * Added two new TurboJPEG API functions, tjEncodeYUV() and
+    tjDecompressToYUV().
+  * The TurboJPEG dynamic library now uses versioned symbols.
+  * Fixed visual artifacts in grayscale JPEG compression 
+    caused by a typo in the RGB-to-chrominance lookup tables.
+- see ChangeLog.txt for details.
+- removed upstreamed jpegtran.patch and rh639672.patch
+
+-------------------------------------------------------------------
+Tue Dec 14 14:32:56 CET 2010 - [email protected]
+
+- spec file cleanup
+
+-------------------------------------------------------------------
+Fri Dec 10 13:02:58 UTC 2010 - [email protected]
+
+- this jpeg version will be the default to the prejudice of jpeg8
+  from now on
+
+-------------------------------------------------------------------
+Sun Nov  7 12:53:26 UTC 2010 - [email protected]
+
+- created package based on Fedora one (v 1.0.1)
+

New:
----
  baselibs.conf
  libjpeg-ocloexec.patch
  libjpeg-turbo-1.2.1-int32.patch
  libjpeg-turbo-1.2.1-tiff-ojpeg.patch
  libjpeg-turbo-1.2.1.tar.gz
  libjpeg-turbo.changes
  libjpeg-turbo.spec
  libjpeg62-turbo.changes
  libjpeg62-turbo.spec

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ libjpeg-turbo.spec ++++++
#
# spec file for package libjpeg-turbo
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define major   8
%define minor   0
%define micro   2
%define srcver  1.2.1
%define libver  %{major}.%{minor}.%{micro}
# major number of library from jpeg8

Name:           libjpeg-turbo
Version:        %{srcver}
Release:        0
Summary:        A MMX/SSE2 accelerated library for manipulating JPEG image files
License:        BSD-3-Clause
Group:          Productivity/Graphics/Convertors
Url:            http://sourceforge.net/projects/libjpeg-turbo
Source0:        
http://downloads.sourceforge.net/project/%{name}/%{version}/libjpeg-turbo-%{version}.tar.gz
Source1:        baselibs.conf
Patch0:         libjpeg-turbo-%{version}-int32.patch
Patch1:         libjpeg-turbo-%{version}-tiff-ojpeg.patch
Patch2:         libjpeg-ocloexec.patch
BuildRequires:  gcc-c++
BuildRequires:  libtool
BuildRequires:  yasm
Provides:       jpeg = %{version}
Obsoletes:      jpeg < %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Conflicts:      jpeg%{major}

%description
The libjpeg-turbo package contains a library of functions for manipulating
JPEG images.

%package -n libjpeg%{major}

Version:        %{libver}
Release:        0
Summary:        The MMX/SSE accelerated JPEG compression/decompression library
Group:          System/Libraries
Provides:       libjpeg%{major} = %{version}
Obsoletes:      libjpeg%{major} < %{version}
# bug437293
%ifarch ppc64
Obsoletes:      libjpeg-64bit < %{version}
%endif
#

%description -n libjpeg%{major}
This library contains MMX/SSE accelerated functions for manipulating
JPEG images.

%package -n libjpeg%{major}-devel
Version:        %{libver}
Release:        0
Summary:        Development Tools for applications which will use the Libjpeg 
Library
Group:          Development/Libraries/C and C++
Requires:       libjpeg%{major} = %{version}
Provides:       libjpeg-devel = %{version}
Obsoletes:      libjpeg-devel < %{version}
Conflicts:      otherproviders(libjpeg-devel)
# bug437293
%ifarch ppc64
Obsoletes:      libjpeg-devel-64bit < %{version}
%endif
#

%description -n libjpeg%{major}-devel
The libjpeg-devel package includes the header files and libraries
necessary for compiling and linking programs which will manipulate JPEG
files using the libjpeg library.

%prep
%setup -q 
%patch0
%patch1
%patch2

%build
autoreconf -fiv
%configure --disable-static \
           --with-jpeg8
make %{?_smp_mflags}

%check
make test libdir=%{_libdir}

%install
%makeinstall

# Fix perms
chmod -x README-turbo.txt release/copyright

# Remove unwanted files
rm -f %{buildroot}%{_libdir}/lib{,turbo}jpeg.la

# Don't distribute libjpegturbo because it is unversioned
rm %{buildroot}%{_includedir}/turbojpeg.h
rm %{buildroot}%{_libdir}/libturbojpeg.so
rm %{buildroot}%{_bindir}/tjbench

# Remove docs, we'll select docs manually
rm -rf %{buildroot}%{_datadir}/doc/

%post -n libjpeg%{major} -p /sbin/ldconfig

%postun -n libjpeg%{major} -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc README README-turbo.txt change.log ChangeLog.txt
%doc release/copyright usage.txt wizard.txt
%{_bindir}/*
%doc %{_mandir}/man1/*

%files -n libjpeg%{major}
%defattr(-,root,root)
%{_libdir}/libjpeg.so.%{libver}
%{_libdir}/libjpeg.so.%{major}

%files -n libjpeg%{major}-devel
%defattr(-,root,root)
%{_includedir}/*.h
%{_libdir}/libjpeg.so
%doc coderules.txt jconfig.txt libjpeg.txt structure.txt example.c

%changelog
++++++ libjpeg62-turbo.spec ++++++
#
# spec file for package libjpeg62-turbo
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#


%define major   62
%define minor   0
%define micro   0
%define srcver  1.2.1
%define libver  %{major}.%{minor}.%{micro}

Name:           libjpeg62-turbo
Version:        %{srcver}
Release:        0
Summary:        A MMX/SSE2 accelerated library for manipulating JPEG image files
License:        BSD-3-Clause
Group:          Productivity/Graphics/Convertors
Url:            http://sourceforge.net/projects/libjpeg-turbo
Source0:        
http://downloads.sourceforge.net/project/libjpeg-turbo/%{version}/libjpeg-turbo-%{version}.tar.gz
Source1:        baselibs.conf
Patch0:         libjpeg-turbo-%{version}-int32.patch
Patch1:         libjpeg-turbo-%{version}-tiff-ojpeg.patch
Patch2:         libjpeg-ocloexec.patch
BuildRequires:  gcc-c++
BuildRequires:  libtool
BuildRequires:  yasm
Provides:       jpeg = %{version}
Obsoletes:      jpeg < %{version}
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
Conflicts:      jpeg%{major}

%description
The libjpeg-turbo package contains a library of functions for manipulating
JPEG images.

%package -n libjpeg%{major}

Version:        %{libver}
Release:        0
Summary:        The MMX/SSE accelerated JPEG compression/decompression library
Group:          System/Libraries
Provides:       libjpeg%{major} = %{version}
Obsoletes:      libjpeg%{major} < %{version}
# bug437293
%ifarch ppc64
Obsoletes:      libjpeg-64bit < %{version}
%endif
#

%description -n libjpeg%{major}
This library contains MMX/SSE accelerated functions for manipulating
JPEG images.

%package -n libjpeg%{major}-devel
Version:        %{libver}
Release:        0
Summary:        Development Tools for applications which will use the Libjpeg 
Library
Group:          Development/Libraries/C and C++
Requires:       libjpeg%{major} = %{version}
Provides:       libjpeg-devel = %{version}
Obsoletes:      libjpeg-devel < %{version}
Conflicts:      otherproviders(libjpeg-devel)
# bug437293
%ifarch ppc64
Obsoletes:      libjpeg-devel-64bit < %{version}
%endif
#

%description -n libjpeg%{major}-devel
The libjpeg-devel package includes the header files and libraries
necessary for compiling and linking programs which will manipulate JPEG
files using the libjpeg library.

%prep
%setup -q -n libjpeg-turbo-%{srcver}
%patch0
%patch1
%patch2

%build
autoreconf -fiv
%configure --disable-static 
make %{?_smp_mflags}

%check
make test libdir=%{_libdir}

%install
%makeinstall

# Fix perms
chmod -x README-turbo.txt release/copyright

# Remove unwanted files
rm -f %{buildroot}%{_libdir}/lib{,turbo}jpeg.la
rm %{buildroot}%{_bindir}/*
rm %{buildroot}%{_mandir}/man1/*

# Don't distribute libjpegturbo because it is unversioned
rm %{buildroot}%{_includedir}/turbojpeg.h
rm %{buildroot}%{_libdir}/libturbojpeg.so

# Remove docs, we'll select docs manually
rm -rf %{buildroot}%{_datadir}/doc/

%post -n libjpeg%{major} -p /sbin/ldconfig

%postun -n libjpeg%{major} -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc README README-turbo.txt change.log ChangeLog.txt
%doc release/copyright usage.txt wizard.txt

%files -n libjpeg%{major}
%defattr(-,root,root)
%{_libdir}/libjpeg.so.%{libver}
%{_libdir}/libjpeg.so.%{major}

%files -n libjpeg%{major}-devel
%defattr(-,root,root)
%{_includedir}/*.h
%{_libdir}/libjpeg.so
%doc coderules.txt jconfig.txt libjpeg.txt structure.txt example.c

%changelog
++++++ baselibs.conf ++++++
libjpeg8
libjpeg8-devel
 conflicts "jpeg-devel-<targettype>"
 provides "jpeg-devel-<targettype>"
libjpeg62
libjpeg62-devel
 conflicts "jpeg-devel-<targettype>"
 provides "jpeg-devel-<targettype>"

++++++ libjpeg-ocloexec.patch ++++++
This patch causes libjpeg to open all files with O_CLOEXEC
the "e" fopen mode is a glibc/linux specific feature hence
not suitable for other OS.

Note that it is NOT HANDLED GRACEFULLY on kernels older than 
2.6.23 or glibc < 2.7.x and WILL segfault.

The other alternative, using fcntl with FD_CLOEXEC is NOT
enough to prevent race conditions.

--- wrjpgcom.c.orig
+++ wrjpgcom.c
@@ -35,15 +35,15 @@ extern void * malloc ();
 #endif
 
 #ifdef DONT_USE_B_MODE         /* define mode parameters for fopen() */
-#define READ_BINARY    "r"
-#define WRITE_BINARY   "w"
+#define READ_BINARY    "re"
+#define WRITE_BINARY   "we"
 #else
 #ifdef VMS                     /* VMS is very nonstandard */
 #define READ_BINARY    "rb", "ctx=stm"
 #define WRITE_BINARY   "wb", "ctx=stm"
 #else                          /* standard ANSI-compliant case */
-#define READ_BINARY    "rb"
-#define WRITE_BINARY   "wb"
+#define READ_BINARY    "rbe"
+#define WRITE_BINARY   "wbe"
 #endif
 #endif
 
@@ -439,7 +439,7 @@ main (int argc, char **argv)
       keep_COM = 0;
     } else if (keymatch(arg, "cfile", 2)) {
       if (++argn >= argc) usage();
-      if ((comment_file = fopen(argv[argn], "r")) == NULL) {
+      if ((comment_file = fopen(argv[argn], READ_BINARY)) == NULL) {
        fprintf(stderr, "%s: can't open %s\n", progname, argv[argn]);
        exit(EXIT_FAILURE);
       }
--- cdjpeg.h.orig
+++ cdjpeg.h
@@ -156,15 +156,15 @@ EXTERN(FILE *) write_stdout JPP((void));
 /* miscellaneous useful macros */
 
 #ifdef DONT_USE_B_MODE         /* define mode parameters for fopen() */
-#define READ_BINARY    "r"
-#define WRITE_BINARY   "w"
+#define READ_BINARY    "re"
+#define WRITE_BINARY   "we"
 #else
 #ifdef VMS                     /* VMS is very nonstandard */
 #define READ_BINARY    "rb", "ctx=stm"
 #define WRITE_BINARY   "wb", "ctx=stm"
 #else                          /* standard ANSI-compliant case */
-#define READ_BINARY    "rb"
-#define WRITE_BINARY   "wb"
+#define READ_BINARY    "rbe"
+#define WRITE_BINARY   "wbe"
 #endif
 #endif
 
--- rdswitch.c.orig
+++ rdswitch.c
@@ -92,7 +92,7 @@ read_quant_tables (j_compress_ptr cinfo,
   long val;
   unsigned int table[DCTSIZE2];
 
-  if ((fp = fopen(filename, "r")) == NULL) {
+  if ((fp = fopen(filename, READ_BINARY)) == NULL) {
     fprintf(stderr, "Can't open table file %s\n", filename);
     return FALSE;
   }
@@ -190,7 +190,7 @@ read_scan_script (j_compress_ptr cinfo,
 #define MAX_SCANS  100         /* quite arbitrary limit */
   jpeg_scan_info scans[MAX_SCANS];
 
-  if ((fp = fopen(filename, "r")) == NULL) {
+  if ((fp = fopen(filename, READ_BINARY)) == NULL) {
     fprintf(stderr, "Can't open scan definition file %s\n", filename);
     return FALSE;
   }
--- bmp.c.orig
+++ bmp.c
@@ -112,7 +112,7 @@ int loadbmp(char *filename, unsigned cha
        if(!filename || !buf || !w || !h || dstpf<0 || dstpf>=TJ_NUMPF)
                _throw("loadbmp(): Invalid argument");
 
-       if((file=fopen(filename, "rb"))==NULL)
+       if((file=fopen(filename, READ_BINARY))==NULL)
                _throwunix("loadbmp(): Cannot open input file");
 
        cinfo.err=jpeg_std_error(&jerr.pub);
@@ -196,7 +196,7 @@ int savebmp(char *filename, unsigned cha
        if(!filename || !buf || w<1 || h<1 || srcpf<0 || srcpf>=TJ_NUMPF)
                _throw("savebmp(): Invalid argument");
 
-       if((file=fopen(filename, "wb"))==NULL)
+       if((file=fopen(filename, WRITE_BINARY))==NULL)
                _throwunix("savebmp(): Cannot open output file");
 
        dinfo.err=jpeg_std_error(&jerr.pub);
++++++ libjpeg-turbo-1.2.1-int32.patch ++++++
--- jmorecfg.h
+++ jmorecfg.h
@@ -158,7 +158,7 @@
 /* INT32 must hold at least signed 32-bit values. */
 
 #ifndef XMD_H                  /* X11/xmd.h correctly defines INT32 */
-typedef long INT32;
+typedef int INT32;
 #endif
 
 /* Datatype used for image dimensions.  The JPEG standard only supports
++++++ libjpeg-turbo-1.2.1-tiff-ojpeg.patch ++++++
--- jdhuff.c
+++ jdhuff.c
@@ -649,3 +649,35 @@
     entropy->dc_derived_tbls[i] = entropy->ac_derived_tbls[i] = NULL;
   }
 }
+/*
+ * BEWARE OF KLUDGE:  This subroutine is a hack for decoding illegal JPEG-in-
+ *                    TIFF encapsulations produced by Microsoft's Wang Imaging
+ * for Windows application with the public-domain TIFF Library.  Based upon an
+ * examination of selected output files, this program apparently divides a JPEG
+ * bit-stream into consecutive horizontal TIFF "strips", such that the JPEG
+ * encoder's/decoder's DC coefficients for each image component are reset 
before
+ * each "strip".  Moreover, a "strip" is not necessarily encoded in a multiple
+ * of 8 bits, so one must sometimes discard 1-7 bits at the end of each "strip"
+ * for alignment to the next input-Byte storage boundary.  IJG JPEG Library
+ * decoder state is not normally exposed to client applications, so this sub-
+ * routine provides the TIFF Library with a "hook" to make these corrections.
+ * It should be called after "jpeg_start_decompress()" and before
+ * "jpeg_finish_decompress()", just before decoding each "strip" using
+ * "jpeg_read_raw_data()" or "jpeg_read_scanlines()".
+ *
+ * This kludge is not sanctioned or supported by the Independent JPEG Group, 
and
+ * future changes to the IJG JPEG Library might invalidate it.  Do not send bug
+ * reports about this code to IJG developers.  Instead, contact the author for
+ * advice: Scott B. Marovich <[email protected]>, Hewlett-Packard Labs, 6/01.
+ */
+GLOBAL(void)
+jpeg_reset_huff_decode (register j_decompress_ptr cinfo,register float *refbw)
+{ register huff_entropy_ptr entropy = (huff_entropy_ptr)cinfo->entropy;
+  register int ci = 0;
+
+  /* Re-initialize DC predictions */
+  do entropy->saved.last_dc_val[ci] = -refbw[ci << 1];
+  while (++ci < cinfo->comps_in_scan);
+  /* Discard encoded input bits, up to the next Byte boundary */
+  entropy->bitstate.bits_left &= ~7;
+}
-- 
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to