Automatic import for version 1.1.1

This commit is contained in:
Rosa 2012-02-01 14:45:42 +04:00
commit a5b1a9768d
6 changed files with 598 additions and 0 deletions

2
.abf.yml Normal file
View file

@ -0,0 +1,2 @@
sources:
"libjpeg-turbo-1.1.1.tar.gz": 131cef514c34e0b3f6952000968796d5a87a59e9

31
exifautotran.txt Normal file
View file

@ -0,0 +1,31 @@
#!/bin/sh
# exifautotran [list of files]
#
# Transforms Exif files so that Orientation becomes 1
#
for i
do
case `jpegexiforient -n "$i"` in
1) transform="";;
2) transform="-flip horizontal";;
3) transform="-rotate 180";;
4) transform="-flip vertical";;
5) transform="-transpose";;
6) transform="-rotate 90";;
7) transform="-transverse";;
8) transform="-rotate 270";;
*) transform="";;
esac
if test -n "$transform"; then
echo Executing: jpegtran -copy all $transform $i
jpegtran -copy all $transform "$i" > tempfile
if test $? -ne 0; then
echo Error while transforming $i - skipped.
else
rm "$i"
mv tempfile "$i"
jpegexiforient -1 "$i" > /dev/null
fi
fi
done

22
jpeg-6b-c++fixes.patch Normal file
View file

@ -0,0 +1,22 @@
--- jpeglib.h 2009-04-30 18:16:10.000000000 +0200
+++ jpeglib.h.oden 2009-08-15 15:58:05.000000000 +0200
@@ -14,6 +14,10 @@
#ifndef JPEGLIB_H
#define JPEGLIB_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* First we include the configuration files that record how this
* installation of the JPEG library is set up. jconfig.h can be
@@ -1132,4 +1136,8 @@ struct jpeg_color_quantizer { long dummy
#endif
#endif
+#ifdef __cplusplus
+}
+#endif
+
#endif /* JPEGLIB_H */

292
jpegexiforient.c Normal file
View file

@ -0,0 +1,292 @@
/*
* jpegexiforient.c
*
* This is a utility program to get and set the Exif Orientation Tag.
* It can be used together with jpegtran in scripts for automatic
* orientation correction of digital camera pictures.
*
* The Exif orientation value gives the orientation of the camera
* relative to the scene when the image was captured. The relation
* of the '0th row' and '0th column' to visual position is shown as
* below.
*
* Value | 0th Row | 0th Column
* ------+-------------+-----------
* 1 | top | left side
* 2 | top | rigth side
* 3 | bottom | rigth side
* 4 | bottom | left side
* 5 | left side | top
* 6 | right side | top
* 7 | right side | bottom
* 8 | left side | bottom
*
* For convenience, here is what the letter F would look like if it were
* tagged correctly and displayed by a program that ignores the orientation
* tag:
*
* 1 2 3 4 5 6 7 8
*
* 888888 888888 88 88 8888888888 88 88 8888888888
* 88 88 88 88 88 88 88 88 88 88 88 88
* 8888 8888 8888 8888 88 8888888888 8888888888 88
* 88 88 88 88
* 88 88 888888 888888
*
*/
#include <stdio.h>
#include <stdlib.h>
static FILE * myfile; /* My JPEG file */
static unsigned char exif_data[65536L];
/* Return next input byte, or EOF if no more */
#define NEXTBYTE() getc(myfile)
/* Error exit handler */
#define ERREXIT(msg) (exit(0))
/* Read one byte, testing for EOF */
static int
read_1_byte (void)
{
int c;
c = NEXTBYTE();
if (c == EOF)
ERREXIT("Premature EOF in JPEG file");
return c;
}
/* Read 2 bytes, convert to unsigned int */
/* All 2-byte quantities in JPEG markers are MSB first */
static unsigned int
read_2_bytes (void)
{
int c1, c2;
c1 = NEXTBYTE();
if (c1 == EOF)
ERREXIT("Premature EOF in JPEG file");
c2 = NEXTBYTE();
if (c2 == EOF)
ERREXIT("Premature EOF in JPEG file");
return (((unsigned int) c1) << 8) + ((unsigned int) c2);
}
static const char * progname; /* program name for error messages */
static void
usage (void)
/* complain about bad command line */
{
fprintf(stderr, "jpegexiforient reads or writes the Exif Orientation Tag ");
fprintf(stderr, "in a JPEG Exif file.\n");
fprintf(stderr, "Usage: %s [switches] jpegfile\n", progname);
fprintf(stderr, "Switches:\n");
fprintf(stderr, " -n Do not output the trailing newline\n");
fprintf(stderr, " -1 .. -8 Set orientation value 1 .. 8\n");
}
/*
* The main program.
*/
int
main (int argc, char **argv)
{
int n_flag, set_flag;
unsigned int length, i;
int is_motorola; /* Flag for byte order */
unsigned int offset, number_of_tags, tagnum;
progname = argv[0];
if (progname == NULL || progname[0] == 0)
progname = "jpegexiforient"; /* in case C library doesn't provide it */
if (argc < 2) { usage(); return 0; }
n_flag = 0; set_flag = 0;
i = 1;
while (argv[i][0] == '-') {
switch (argv[i][1]) {
case 'n':
n_flag = 1;
break;
case '1':
case '2':
case '3':
case '4':
case '5':
case '6':
case '7':
case '8':
set_flag = argv[i][1] - '0';
break;
default:
usage(); return 0;
}
if (++i >= argc) { usage(); return 0; }
}
if (set_flag) {
if ((myfile = fopen(argv[i], "rb+")) == NULL) {
fprintf(stderr, "%s: can't open %s\n", progname, argv[i]);
return 0;
}
} else {
if ((myfile = fopen(argv[i], "rb")) == NULL) {
fprintf(stderr, "%s: can't open %s\n", progname, argv[i]);
return 0;
}
}
/* Read File head, check for JPEG SOI + Exif APP1 */
for (i = 0; i < 4; i++)
exif_data[i] = (unsigned char) read_1_byte();
if (exif_data[0] != 0xFF ||
exif_data[1] != 0xD8 ||
exif_data[2] != 0xFF ||
exif_data[3] != 0xE1)
return 0;
/* Get the marker parameter length count */
length = read_2_bytes();
/* Length includes itself, so must be at least 2 */
/* Following Exif data length must be at least 6 */
if (length < 8)
return 0;
length -= 8;
/* Read Exif head, check for "Exif" */
for (i = 0; i < 6; i++)
exif_data[i] = (unsigned char) read_1_byte();
if (exif_data[0] != 0x45 ||
exif_data[1] != 0x78 ||
exif_data[2] != 0x69 ||
exif_data[3] != 0x66 ||
exif_data[4] != 0 ||
exif_data[5] != 0)
return 0;
/* Read Exif body */
for (i = 0; i < length; i++)
exif_data[i] = (unsigned char) read_1_byte();
if (length < 12) return 0; /* Length of an IFD entry */
/* Discover byte order */
if (exif_data[0] == 0x49 && exif_data[1] == 0x49)
is_motorola = 0;
else if (exif_data[0] == 0x4D && exif_data[1] == 0x4D)
is_motorola = 1;
else
return 0;
/* Check Tag Mark */
if (is_motorola) {
if (exif_data[2] != 0) return 0;
if (exif_data[3] != 0x2A) return 0;
} else {
if (exif_data[3] != 0) return 0;
if (exif_data[2] != 0x2A) return 0;
}
/* Get first IFD offset (offset to IFD0) */
if (is_motorola) {
if (exif_data[4] != 0) return 0;
if (exif_data[5] != 0) return 0;
offset = exif_data[6];
offset <<= 8;
offset += exif_data[7];
} else {
if (exif_data[7] != 0) return 0;
if (exif_data[6] != 0) return 0;
offset = exif_data[5];
offset <<= 8;
offset += exif_data[4];
}
if (offset > length - 2) return 0; /* check end of data segment */
/* Get the number of directory entries contained in this IFD */
if (is_motorola) {
number_of_tags = exif_data[offset];
number_of_tags <<= 8;
number_of_tags += exif_data[offset+1];
} else {
number_of_tags = exif_data[offset+1];
number_of_tags <<= 8;
number_of_tags += exif_data[offset];
}
if (number_of_tags == 0) return 0;
offset += 2;
/* Search for Orientation Tag in IFD0 */
for (;;) {
if (offset > length - 12) return 0; /* check end of data segment */
/* Get Tag number */
if (is_motorola) {
tagnum = exif_data[offset];
tagnum <<= 8;
tagnum += exif_data[offset+1];
} else {
tagnum = exif_data[offset+1];
tagnum <<= 8;
tagnum += exif_data[offset];
}
if (tagnum == 0x0112) break; /* found Orientation Tag */
if (--number_of_tags == 0) return 0;
offset += 12;
}
if (set_flag) {
/* Set the Orientation value */
if (is_motorola) {
exif_data[offset+2] = 0; /* Format = unsigned short (2 octets) */
exif_data[offset+3] = 3;
exif_data[offset+4] = 0; /* Number Of Components = 1 */
exif_data[offset+5] = 0;
exif_data[offset+6] = 0;
exif_data[offset+7] = 1;
exif_data[offset+8] = 0;
exif_data[offset+9] = (unsigned char)set_flag;
exif_data[offset+10] = 0;
exif_data[offset+11] = 0;
} else {
exif_data[offset+2] = 3; /* Format = unsigned short (2 octets) */
exif_data[offset+3] = 0;
exif_data[offset+4] = 1; /* Number Of Components = 1 */
exif_data[offset+5] = 0;
exif_data[offset+6] = 0;
exif_data[offset+7] = 0;
exif_data[offset+8] = (unsigned char)set_flag;
exif_data[offset+9] = 0;
exif_data[offset+10] = 0;
exif_data[offset+11] = 0;
}
fseek(myfile, (4 + 2 + 6 + 2) + offset, SEEK_SET);
fwrite(exif_data + 2 + offset, 1, 10, myfile);
} else {
/* Get the Orientation value */
if (is_motorola) {
if (exif_data[offset+8] != 0) return 0;
set_flag = exif_data[offset+9];
} else {
if (exif_data[offset+9] != 0) return 0;
set_flag = exif_data[offset+8];
}
if (set_flag > 8) return 0;
}
/* Write out Orientation value */
if (n_flag)
printf("%c", '0' + set_flag);
else
printf("%c\n", '0' + set_flag);
/* All done. */
return 0;
}

237
libjpeg-turbo.spec Normal file
View file

@ -0,0 +1,237 @@
%define major 8
%define libname %mklibname jpeg %{major}
%define devname %mklibname -d jpeg
%define statname %mklibname -s -d jpeg
%define major62 62
%define libname62 %mklibname jpeg %{major62}
Summary: A MMX/SSE2 accelerated library for manipulating JPEG image files
Name: libjpeg-turbo
Version: 1.1.1
Release: 1
Epoch: 1
License: wxWidgets Library License
Group: System/Libraries
URL: http://sourceforge.net/projects/libjpeg-turbo
Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}.tar.gz
# These two allow automatic lossless rotation of JPEG images from a digital
# camera which have orientation markings in the EXIF data. After rotation
# the orientation markings are reset to avoid duplicate rotation when
# applying these programs again.
Source2: http://jpegclub.org/jpegexiforient.c
Source3: http://jpegclub.org/exifautotran.txt
Patch0: jpeg-6b-c++fixes.patch
Patch1: libjpeg-turbo11-noinst_jpgtest.patch
BuildRequires: libtool >= 1.4
%ifarch %{ix86} x86_64
BuildRequires: nasm
%endif
%description
This package contains a library of functions for manipulating JPEG images.
It is a high-speed, libjpeg-compatible version for x86 and x86-64
processors which uses SIMD instructions (MMX, SSE2, etc.) to accelerate
baseline JPEG compression and decompression. It is generally 2-4x as fast
as the unmodified version of libjpeg, all else being equal.
Install the libjpeg-turbo package if you need to manipulate JPEG files.
You should also install the jpeg-progs package.
%package -n %{libname}
Summary: A library for manipulating JPEG image format files
Group: System/Libraries
%description -n %{libname}
This package contains the library needed to run programs dynamically
linked with libjpeg-turbo.
%package -n %{libname62}
Summary: A library for manipulating JPEG image format files
Group: System/Libraries
%description -n %{libname62}
This package contains the library needed to run programs dynamically
linked with libjpeg-turbo.
%package -n %{devname}
Summary: Development tools for programs which will use the libjpeg-turbo library
Group: Development/C
Requires: %{libname} = %{EVRD}
Provides: jpeg-devel = %{EVRD}
Provides: libjpeg-devel = %{EVRD}
Provides: jpeg%{major}-devel = %{EVRD}
Conflicts: jpeg6-devel
Obsoletes: %{mklibname jpeg 62 -d} < 6b-45
%description -n %{devname}
The libjpeg-turbo devel package includes the header files necessary for
developing programs which will manipulate JPEG files using the
libjpeg-turbo library.
If you are going to develop programs which will manipulate JPEG images,
you should install this package. You'll also need to have the
libjpeg-turbo package installed.
%package -n %{statname}
Summary: Static libraries for programs which will use the libjpeg-turbo library
Group: Development/C
Requires: %{devname} = %{EVRD}
Provides: libjpeg-static-devel = %{EVRD}
Provides: jpeg-static-devel = %{EVRD}
Provides: jpeg%{major}-static-devel = %{EVRD}
Conflicts: jpeg6-static-devel
Obsoletes: %{mklibname jpeg 62 -d -s} < 6b-45
Obsoletes: %{mklibname jpeg 7 -d -s} < 7-3
%description -n %{statname}
The libjpeg-turbo static devel package includes the static libraries
necessary for developing programs which will manipulate JPEG files using
the libjpeg-turbo library.
If you are going to develop programs which will manipulate JPEG images,
you should install this package. You'll also need to have the
libjpeg-turbo package installed.
%package -n jpeg-progs
Summary: Programs for manipulating JPEG format image files
Group: Graphics
%rename libjpeg-progs
%rename jpeg6-progs
%description -n jpeg-progs
This package contains simple client programs for accessing the
libjpeg-turbo functions. The library client programs include cjpeg, djpeg,
jpegtran, rdjpgcom, wrjpgcom and jpegexiforient, coupled with the script
exifautotran. Cjpeg compresses an image file into JPEG format. Djpeg
decompresses a JPEG file into a regular image file. Jpegtran can perform
various useful transformations on JPEG files: it can make lossless
cropping of JPEG files and lossless pasting of one JPEG into another
(dropping). Rdjpgcom displays any text comments included in a JPEG file.
Wrjpgcom inserts text comments into a JPEG file. Jpegexiforient allow
automatic lossless rotation of JPEG images from a digital camera which
have orientation markings in the EXIF data.
%prep
%setup -q
%patch0 -p0
%patch1 -p1
cp %{SOURCE2} jpegexiforient.c
cp %{SOURCE3} exifautotran
%build
autoreconf -fi
mkdir -p jpeg8
pushd jpeg8
CONFIGURE_TOP=.. \
CFLAGS="%{optflags} -O3 -funroll-loops -ffast-math" \
%configure2_5x --disable-silent-rules \
--enable-shared \
--enable-static \
--with-jpeg8
%make
popd
mkdir -p jpeg62
pushd jpeg62
CONFIGURE_TOP=.. \
CFLAGS="%{optflags} -O3 -funroll-loops -ffast-math" \
%configure2_5x --disable-silent-rules \
--enable-shared \
--disable-static
%make
popd
gcc %{optflags} %{ldflags} -o jpegexiforient jpegexiforient.c
%check
make -C jpeg8 test
make -C jpeg62 test
%install
%makeinstall_std -C jpeg8
make install-libLTLIBRARIES DESTDIR=%{buildroot} -C jpeg62
install -m755 jpegexiforient -D %{buildroot}%{_bindir}/jpegexiforient
install -m755 exifautotran -D %{buildroot}%{_bindir}/exifautotran
#(neoclust) Provide jpegint.h because it is needed by certain software
install -m644 jpegint.h -D %{buildroot}%{_includedir}/jpegint.h
# Fix perms
chmod -x README-turbo.txt
# Remove unwanted files
rm -f %{buildroot}%{_libdir}/libturbojpeg.la
# keep libjpeg.la to allow using jpeg-turbo where jpeg-8c would have been
# and correct link of -devel .so to proper version, and not .so.62 one
pushd %{buildroot}%{_libdir}
ln -sf libjpeg.so.8.0.2 libjpeg.so
popd
# Don't distribute libjpegturbo because it is unversioned
rm -f %{buildroot}%{_includedir}/turbojpeg.h
rm -f %{buildroot}%{_libdir}/libturbojpeg.{so,a}
%clean
rm -rf %{buildroot}
%files -n %{libname}
%doc change.log ChangeLog.txt README README-turbo.txt
%{_libdir}/libjpeg.so.%{major}*
%files -n %{libname62}
%{_libdir}/libjpeg.so.%{major62}*
%files -n %{devname}
%doc coderules.txt example.c jconfig.txt libjpeg.txt LICENSE.txt structure.txt filelist.txt
%{_libdir}/*.la
%{_libdir}/*.so
%{_includedir}/*.h
%files -n %{statname}
%{_libdir}/*.a
%files -n jpeg-progs
%doc usage.txt wizard.txt
%{_bindir}/*
%{_mandir}/man1/*
%changelog
* Fri May 27 2011 Funda Wang <fwang@mandriva.org> 1:1.1.1-1
+ Revision: 679380
- update to new version 1.1.1
* Sun Mar 06 2011 Funda Wang <fwang@mandriva.org> 1:1.1.0-3
+ Revision: 642215
- provides libjpeg-devel
* Sat Mar 05 2011 Funda Wang <fwang@mandriva.org> 1:1.1.0-2
+ Revision: 642110
- there is no need renaming to itself
* Sat Mar 05 2011 Funda Wang <fwang@mandriva.org> 1:1.1.0-1
+ Revision: 642078
- do not install jpgtest
- new version 1.1.0
* Sat Mar 05 2011 Paulo Andrade <pcpa@mandriva.com.br> 1:1.0.90-3
+ Revision: 642056
- Correct devel package to be compatible with jpeg -8c
+ Per Øyvind Karlsen <peroyvind@mandriva.org>
- be more specific about license (Giovanni)
* Wed Mar 02 2011 Per Øyvind Karlsen <peroyvind@mandriva.org> 1:1.0.90-2
+ Revision: 641295
- apply misc package fixes from Giovanni Mariani <mc2374@mclink.it>
* Fri Feb 25 2011 Per Øyvind Karlsen <peroyvind@mandriva.org> 1:1.0.90-1
+ Revision: 639762
- imported package libjpeg-turbo

View file

@ -0,0 +1,14 @@
diff -up libjpeg-turbo-1.1.0/Makefile.am.noinst_jpgtest libjpeg-turbo-1.1.0/Makefile.am
--- libjpeg-turbo-1.1.0/Makefile.am.noinst_jpgtest 2011-03-01 14:40:04.291829489 +0100
+++ libjpeg-turbo-1.1.0/Makefile.am 2011-03-01 14:40:13.081814233 +0100
@@ -58,8 +58,8 @@ endif
TSTHDRS = rrutil.h rrtimer.h
-bin_PROGRAMS = cjpeg djpeg jpegtran rdjpgcom wrjpgcom jpgtest
-noinst_PROGRAMS = jpegut
+bin_PROGRAMS = cjpeg djpeg jpegtran rdjpgcom wrjpgcom
+noinst_PROGRAMS = jpegut jpgtest
jpgtest_SOURCES = $(TSTHDRS) jpgtest.c bmp.h bmp.c