Updated to 0.0.9

- Dropped obsolete Group, Buildroot, %clean and %defattr
- Switched to .bz2 sources
- Dropped included patches
This commit is contained in:
Julian Sikorski 2012-10-02 18:30:29 +02:00
parent 2bb0f9fe28
commit ecdcbc79ec
6 changed files with 11 additions and 362 deletions

1
.gitignore vendored
View File

@ -1 +1,2 @@
libopenraw-0.0.8.tar.gz
/libopenraw-0.0.9.tar.bz2

View File

@ -1,60 +0,0 @@
From 22287584fbfa4657098ee997957a6c4fc972a53b Mon Sep 17 00:00:00 2001
From: Hubert Figuiere <hub@figuiere.net>
Date: Sat, 19 Jun 2010 13:53:39 -0700
Subject: [PATCH] - Properly decompress CFA from Canon 7D, 5DMkII, 500D, 1DMkIV (and any other
whose JPEG stream had 4 components)
diff --git a/lib/ljpegdecompressor.cpp b/lib/ljpegdecompressor.cpp
index b176853..704b346 100644
--- a/lib/ljpegdecompressor.cpp
+++ b/lib/ljpegdecompressor.cpp
@@ -564,31 +564,16 @@ LJpegDecompressor::PmPutRow(MCU* RowBuf, int32_t numComp, int32_t numCol, int32_
// TODO this might be wrong in 8 bits...
// original code was using putc which *i think* was a problem for
// 16bpp
+ int32_t comp;
int32_t col;
uint16_t v;
- if (numComp==1) { /*pgm*/
- for (col = 0; col < numCol; col++) {
- v=RowBuf[col][0]<<Pt;
+ for (col = 0; col < numCol; col++) {
+ for (comp = 0; comp < numComp; comp++) {
+ v = RowBuf[col][comp]<<Pt;
m_output->append(v);
}
- } else if (numComp==2) { /*pgm*/
- for (col = 0; col < numCol; col++) {
- v=RowBuf[col][0]<<Pt;
- m_output->append(v);
- v=RowBuf[col][1]<<Pt;
- m_output->append(v);
- }
- } else { /*ppm*/
- for (col = 0; col < numCol; col++) {
- v=RowBuf[col][0]<<Pt;
- m_output->append(v);
- v=RowBuf[col][1]<<Pt;
- m_output->append(v);
- v=RowBuf[col][2]<<Pt;
- m_output->append(v);
- }
- }
+ }
// m_output->nextRow();
}
@@ -1573,8 +1558,7 @@ RawData *LJpegDecompressor::decompress(RawData *bitmap)
* @todo check that this is valid with DNG too.
*/
uint32_t width = dcInfo.imageWidth * dcInfo.numComponents;
- bitmap->setDimensions(width,
- dcInfo.imageHeight);
+ bitmap->setDimensions(width, dcInfo.imageHeight);
bitmap->setSlices(m_slices);
DecoderStructInit(&dcInfo);
HuffDecoderInit(&dcInfo);
--
1.7.3.1

View File

@ -1,256 +0,0 @@
From 1b15acdcfdc4664bc6c0be473cb6e096071a4e62 Mon Sep 17 00:00:00 2001
From: Hubert Figuiere <hub@figuiere.net>
Date: Sat, 6 Mar 2010 11:41:43 -0800
Subject: [PATCH] - Support (partially) PEF from Pentax K20D.
- Detect that ORF file are compressed if they are. (Closes #26618)
- Skip compressed CFA when rendering the image. (Closes #25464)
---
README | 5 +++--
include/libopenraw/consts.h | 5 +++--
lib/orffile.cpp | 33 +++++++++++++++++++++++++++++----
lib/peffile.cpp | 20 ++++++++++----------
lib/rawfile.cpp | 7 ++++++-
testsuite/testsuite.xml | 36 ++++++++++++++++++++++++++++++++++++
6 files changed, 87 insertions(+), 19 deletions(-)
diff --git a/README b/README
index b4716ee..e373a22 100644
--- a/README
+++ b/README
@@ -114,9 +114,9 @@ Olympus ORF Y Y N Y Y Y
E-10 B B T
E-3 T T T
E-300 T T B T T T
- E-330 T T T
+ E-330 T T N T
E-400 T B T T
- E-410 B T T T
+ E-410 B T N T T
E-500 T T T T
E-510 B T T T
SP-350
@@ -143,6 +143,7 @@ Pentax PEF Y Y N Y Y Y
K10D T T N T T T
K100D T
K100D Super T T N T
+ K20D T T N T
Epson ERF Y Y Y Y Y Y
Epson RD1 T T T T T T
diff --git a/include/libopenraw/consts.h b/include/libopenraw/consts.h
index c2d6bf4..de49034 100644
--- a/include/libopenraw/consts.h
+++ b/include/libopenraw/consts.h
@@ -1,8 +1,8 @@
/*
* libopenraw - consts.h
*
- * Copyright (C) 2005-2009 Hubert Figuiere
* Copyright (c) 2008 Novell, Inc.
+ * Copyright (C) 2005-2010 Hubert Figuiere
*
* This library is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -204,7 +204,8 @@ extern "C" {
OR_TYPEID_PENTAX_IST_D,
OR_TYPEID_PENTAX_IST_DL,
OR_TYPEID_PENTAX_K100D_PEF,
- OR_TYPEID_PENTAX_K100D_SUPER_PEF
+ OR_TYPEID_PENTAX_K100D_SUPER_PEF,
+ OR_TYPEID_PENTAX_K20D_PEF
};
/** Epson type IDs */
diff --git a/lib/orffile.cpp b/lib/orffile.cpp
index c9f0181..28980f4 100644
--- a/lib/orffile.cpp
+++ b/lib/orffile.cpp
@@ -1,7 +1,7 @@
/*
* libopenraw - orffile.cpp
*
- * Copyright (C) 2006, 2008 Hubert Figuiere
+ * Copyright (C) 2006, 2008, 2010 Hubert Figuiere
*
* This library is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -77,7 +77,7 @@ namespace OpenRaw {
IFDDir::Ref ORFFile::_locateCfaIfd()
{
- // in PEF the CFA IFD is the main IFD
+ // in ORF the CFA IFD is the main IFD
if(!m_mainIfd) {
m_mainIfd = _locateMainIfd();
}
@@ -92,12 +92,37 @@ namespace OpenRaw {
- ::or_error ORFFile::_getRawData(RawData & data, uint32_t /*options*/)
+ ::or_error ORFFile::_getRawData(RawData & data, uint32_t options)
{
+ ::or_error err;
if(!m_cfaIfd) {
m_cfaIfd = _locateCfaIfd();
}
- return _getRawDataFromDir(data, m_cfaIfd);
+ err = _getRawDataFromDir(data, m_cfaIfd);
+ if(err == OR_ERROR_NONE) {
+ // ORF files seems to be marked as uncompressed even if they are.
+ uint32_t x = data.x();
+ uint32_t y = data.y();
+ uint16_t compression = 0;
+ if(data.size() < x * y * 2) {
+ compression = 65535;
+ data.setCompression(65535);
+ data.setDataType(OR_DATA_TYPE_COMPRESSED_CFA);
+ }
+ else {
+ compression = data.compression();
+ }
+ switch(compression) {
+ case 65535:
+ if((options & OR_OPTIONS_DONT_DECOMPRESS) == 0) {
+ // TODO decompress
+ }
+ break;
+ default:
+ break;
+ }
+ }
+ return err;
}
}
diff --git a/lib/peffile.cpp b/lib/peffile.cpp
index d8849fb..cef6b27 100644
--- a/lib/peffile.cpp
+++ b/lib/peffile.cpp
@@ -1,7 +1,7 @@
/*
* libopenraw - peffile.cpp
*
- * Copyright (C) 2006-2008 Hubert Figuiere
+ * Copyright (C) 2006-2008, 2010 Hubert Figuiere
*
* This library is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -48,6 +48,8 @@ namespace OpenRaw {
OR_TYPEID_PENTAX_K100D_PEF) },
{ "PENTAX K100D Super ", OR_MAKE_FILE_TYPEID(OR_TYPEID_VENDOR_PENTAX,
OR_TYPEID_PENTAX_K100D_PEF) },
+ { "PENTAX K20D ", OR_MAKE_FILE_TYPEID(OR_TYPEID_VENDOR_PENTAX,
+ OR_TYPEID_PENTAX_K20D_PEF) },
{ 0, 0 }
};
@@ -83,7 +85,7 @@ namespace OpenRaw {
return m_container->setDirectory(0);
}
- ::or_error PEFFile::_getRawData(RawData & data, uint32_t /*options*/)
+ ::or_error PEFFile::_getRawData(RawData & data, uint32_t options)
{
::or_error err;
if(!m_cfaIfd) {
@@ -91,14 +93,12 @@ namespace OpenRaw {
}
err = _getRawDataFromDir(data, m_cfaIfd);
if(err == OR_ERROR_NONE) {
- uint16_t compression = 0;
- m_cfaIfd->getValue(IFD::EXIF_TAG_COMPRESSION, compression);
- switch(compression) {
- case 1:
- data.setDataType(OR_DATA_TYPE_CFA);
- break;
- case 65535:
- // TODO decompress
+ uint16_t compression = data.compression();
+ switch(compression) {
+ case 65535:
+ if((options & OR_OPTIONS_DONT_DECOMPRESS) == 0) {
+ // TODO decompress
+ }
break;
default:
break;
diff --git a/lib/rawfile.cpp b/lib/rawfile.cpp
index 6b0821b..c1c11cb 100644
--- a/lib/rawfile.cpp
+++ b/lib/rawfile.cpp
@@ -1,8 +1,8 @@
/*
* libopenraw - rawfile.cpp
*
- * Copyright (C) 2006-2008 Hubert Figuiere
* Copyright (C) 2008 Novell, Inc.
+ * Copyright (C) 2006-2008, 2010 Hubert Figuiere
*
* This library is free software: you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
@@ -379,8 +379,13 @@ const std::vector<uint32_t> & RawFile::listThumbnailSizes(void)
::or_error RawFile::getRenderedImage(BitmapData & bitmapdata, uint32_t options)
{
RawData rawdata;
+ Trace(DEBUG1) << "options are " << options << "\n";
::or_error ret = getRawData(rawdata, options);
if(ret == OR_ERROR_NONE) {
+ if(rawdata.dataType() != OR_DATA_TYPE_CFA) {
+ Trace(DEBUG1) << "wrong data type\n";
+ return OR_ERROR_INVALID_FORMAT;
+ }
uint32_t x,y;
or_cfa_pattern pattern;
uint16_t *src;
diff --git a/testsuite/testsuite.xml b/testsuite/testsuite.xml
index 9f18dec..c5964b4 100644
--- a/testsuite/testsuite.xml
+++ b/testsuite/testsuite.xml
@@ -346,6 +346,42 @@
</results>
</test>
<test>
+ <name>ORF-test E330</name>
+ <file>/home/hub/samples/300mm_f5.6.ORF</file>
+ <source>http://raw.fotosite.pl/download-Olympus_E-330_Sigma_135-400_f4.5-5.6/300mm_f5.6.ORF</source>
+ <results>
+ <rawType>ORF</rawType>
+ <rawTypeId>458757</rawTypeId>
+ <thumbNum>1</thumbNum>
+ <thumbSizes>160</thumbSizes>
+ <thumbFormats>JPEG</thumbFormats>
+ <thumbDataSizes>11074</thumbDataSizes>
+ <rawDataType>COMP_CFA</rawDataType>
+ <rawDataSize>12857600</rawDataSize>
+ <rawDataDimensions>3280 2450</rawDataDimensions>
+ <rawCfaPattern>RGGB</rawCfaPattern>
+ <rawMinValue>0</rawMinValue>
+ <rawMaxValue>65535</rawMaxValue>
+ <metaOrientation>1</metaOrientation>
+ </results>
+ </test>
+ <test>
+ <name>ORF-test E-410</name>
+ <file>/home/hub/samples/p1013308.orf</file>
+ <results>
+ <rawType>ORF</rawType>
+ <rawTypeId>458759</rawTypeId>
+ <thumbNum>0</thumbNum>
+ <rawDataType>COMP_CFA</rawDataType>
+ <rawDataSize>8131436</rawDataSize>
+ <rawDataDimensions>3720 2800</rawDataDimensions>
+ <rawCfaPattern>RGGB</rawCfaPattern>
+ <rawMinValue>0</rawMinValue>
+ <rawMaxValue>65535</rawMaxValue>
+ <metaOrientation>1</metaOrientation>
+ </results>
+ </test>
+ <test>
<name>MRW-test Dimage5</name>
<file>/home/hub/samples/mrw/Dimage5/dimage5.mrw</file>
<source>http://libopenraw.freedesktop.org/samples/mrw/dimage5.mrw</source>
--
1.7.2.2

View File

@ -1,14 +0,0 @@
diff -uNr libopenraw-0.0.8.old/configure.in libopenraw-0.0.8/configure.in
--- libopenraw-0.0.8.old/configure.in 2009-05-15 22:21:53.000000000 +0200
+++ libopenraw-0.0.8/configure.in 2010-10-24 23:20:03.000000000 +0200
@@ -135,8 +135,8 @@
if test x$HAVE_LIBGLIB = xyes ; then
PKG_CHECK_MODULES(LIBGDKPIXBUF, gdk-pixbuf-2.0 >= $LIBGDKPIXBUF_REQUIRED,
[AC_DEFINE(HAVE_LIBGDKPIXBUF, 1, [Define to 1 to enable libgdkpixbuf support])
- GTK_VERSION=`$PKG_CONFIG --variable=gtk_binary_version gtk+-2.0`
- GDK_PIXBUF_DIR="gtk-2.0/$GTK_VERSION/loaders"
+ GDK_PIXBUF_VERSION=`$PKG_CONFIG --variable=gdk_pixbuf_binary_version gdk-pixbuf-2.0`
+ GDK_PIXBUF_DIR="gdk-pixbuf-2.0/$GDK_PIXBUF_VERSION/loaders"
AC_SUBST(GDK_PIXBUF_DIR)
HAVE_LIBGDKPIXBUF=yes],
[HAVE_LIBGDKPIXBUF=no])

View File

@ -1,22 +1,10 @@
Summary: Decode camera RAW files
Name: libopenraw
Version: 0.0.8
Release: 8%{?dist}
Version: 0.0.9
Release: 1%{?dist}
License: LGPLv3+
Group: System Environment/Libraries
URL: http://libopenraw.freedesktop.org/wiki
Source0: http://libopenraw.freedesktop.org/download/%{name}-%{version}.tar.gz
# upstream patch 1b15acdcfdc4664bc6c0be473cb6e096071a4e62 adds support
# for certain PEF files and fixes a crash when opening such files
Patch0: 0001-Support-partially-PEF-from-Pentax-K20D.patch
# upstream patch 22287584fbfa4657098ee997957a6c4fc972a53b to
# properly decompress CFA from certain cameras (patch slightly modified
# to omit patching README)
Patch1: 0001-Properly-decompress-CFA-from-Canon-7D-5DMkII-500D-1D.patch
# https://bugs.freedesktop.org/show_bug.cgi?id=31088
Patch2: libopenraw-0.0.8-pixbufloaderdir.patch
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
Source0: http://libopenraw.freedesktop.org/download/%{name}-%{version}.tar.bz2
BuildRequires: libtool autoconf automake
BuildRequires: boost-devel
@ -35,7 +23,6 @@ image processing application.
%package gnome
Summary: GUI components of %{name}
Group: System Environment/Libraries
Requires: %{name} = %{version}-%{release}
@ -44,7 +31,6 @@ The %{name}-gnome package contains gui components of %{name}.
%package devel
Summary: Development files for %{name}
Group: Development/Libraries
Requires: %{name} = %{version}-%{release}
Requires: pkgconfig
@ -55,7 +41,6 @@ developing applications that use %{name}.
%package gnome-devel
Summary: Development files for %{name}-gnome
Group: Development/Libraries
Requires: %{name}-gnome = %{version}-%{release}
Requires: %{name}-devel = %{version}-%{release}
@ -67,7 +52,6 @@ developing applications that use %{name}-gnome.
%package pixbuf-loader
Summary: RAW image loader for GTK+ applications
Group: System Environment/Libraries
Requires: gtk2
Requires: %{name} = %{version}-%{release}
@ -80,12 +64,8 @@ digital cameras, in GTK+ applications.
%prep
%setup -q
%patch1 -p1 -b CFA-decrompress-fix
%patch0 -p1 -b pef-crash-fix
%patch2 -p1 -b pixbufloaderdir
%build
autoreconf -i -f
%configure --disable-static --enable-gnome
# Omit unused direct shared library dependencies.
@ -102,9 +82,6 @@ rm -rf $RPM_BUILD_ROOT
make install DESTDIR=$RPM_BUILD_ROOT
find $RPM_BUILD_ROOT -type f -name "*.la" -delete
%clean
rm -rf $RPM_BUILD_ROOT
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
@ -121,7 +98,6 @@ gdk-pixbuf-query-loaders-%{__isa_bits} --update-cache || :
gdk-pixbuf-query-loaders-%{__isa_bits} --update-cache || :
%files
%defattr(-,root,root,-)
%doc AUTHORS
%doc ChangeLog
%doc COPYING
@ -131,11 +107,9 @@ gdk-pixbuf-query-loaders-%{__isa_bits} --update-cache || :
%{_libdir}/%{name}.so.*
%files gnome
%defattr(-,root,root,-)
%{_libdir}/%{name}gnome.so.*
%files devel
%defattr(-,root,root,-)
%{_libdir}/%{name}.so
%{_libdir}/pkgconfig/%{name}-1.0.pc
@ -143,7 +117,6 @@ gdk-pixbuf-query-loaders-%{__isa_bits} --update-cache || :
%{_includedir}/%{name}-1.0/%{name}/*.h
%files gnome-devel
%defattr(-,root,root,-)
%{_libdir}/%{name}gnome.so
%{_libdir}/pkgconfig/%{name}-gnome-1.0.pc
@ -151,10 +124,15 @@ gdk-pixbuf-query-loaders-%{__isa_bits} --update-cache || :
%{_includedir}/%{name}-1.0/%{name}-gnome/gdkpixbuf.h
%files pixbuf-loader
%defattr(-,root,root,-)
%{_libdir}/gdk-pixbuf-2.0/*/loaders/*.so
%changelog
* Sun Sep 30 2012 Julian Sikorski <belegdol@fedoraproject.org> - 0.0.9-1
- Updated to 0.0.9
- Dropped obsolete Group, Buildroot, %%clean and %%defattr
- Switched to .bz2 sources
- Dropped included patches
* Thu Jul 19 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.0.8-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

View File

@ -1 +1 @@
fc26f146586a4b601326130bce6ffd88 libopenraw-0.0.8.tar.gz
3611d8aea870d25314665ef53093288e libopenraw-0.0.9.tar.bz2