aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore7
-rw-r--r--cmake/treedata/common/externals.txt1
-rw-r--r--lib/libexif/CMakeLists.txt14
-rw-r--r--lib/libexif/libexif.sln24
-rw-r--r--lib/libexif/libexif.vcxproj128
-rw-r--r--lib/libexif/libexif.vcxproj.filters45
-rw-r--r--xbmc/DllPaths_generated.h.in1
-rw-r--r--xbmc/DllPaths_generated_android.h.in1
-rw-r--r--xbmc/DllPaths_win32.h1
-rw-r--r--xbmc/pictures/CMakeLists.txt9
-rw-r--r--xbmc/pictures/DllLibExif.h40
-rw-r--r--[-rwxr-xr-x]xbmc/pictures/ExifParse.cpp (renamed from lib/libexif/ExifParse.cpp)9
-rw-r--r--xbmc/pictures/ExifParse.h (renamed from lib/libexif/ExifParse.h)0
-rw-r--r--xbmc/pictures/IptcParse.cpp (renamed from lib/libexif/IptcParse.cpp)5
-rw-r--r--xbmc/pictures/IptcParse.h (renamed from lib/libexif/IptcParse.h)0
-rw-r--r--xbmc/pictures/JpegParse.cpp (renamed from lib/libexif/JpegParse.cpp)27
-rw-r--r--xbmc/pictures/JpegParse.h (renamed from lib/libexif/JpegParse.h)9
-rw-r--r--xbmc/pictures/PictureInfoTag.cpp6
-rw-r--r--xbmc/pictures/PictureInfoTag.h2
-rw-r--r--xbmc/pictures/libexif.cpp (renamed from lib/libexif/libexif.cpp)0
-rw-r--r--xbmc/pictures/libexif.h (renamed from lib/libexif/libexif.h)0
21 files changed, 41 insertions, 288 deletions
diff --git a/.gitignore b/.gitignore
index bce1af0db8..d4e933666b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -255,7 +255,6 @@ lib/cpluff/stamp-h1
/system/EasyHook64.dll
/system/libcurl.dll
/system/libeay32.dll
-/system/libexif.dll
/system/ssh.dll
/system/sqlite3.dll
/system/libnfs.dll
@@ -509,12 +508,6 @@ lib/cpluff/stamp-h1
#/lib/win32/ffmpeg
/lib/win32/ffmpeg/
-# /lib/libexif
-/lib/libexif/Makefile
-/lib/libexif/Debug (DLL)
-/lib/libexif/Release (DLL)
-/lib/libexif/libexif.lib
-
/lib/libUPnP/Makefile
# /portable_data
diff --git a/cmake/treedata/common/externals.txt b/cmake/treedata/common/externals.txt
index e3b9ab4af5..812bebcccc 100644
--- a/cmake/treedata/common/externals.txt
+++ b/cmake/treedata/common/externals.txt
@@ -1,2 +1 @@
xbmc/contrib/kissfft kissfft
-lib/libexif exif
diff --git a/lib/libexif/CMakeLists.txt b/lib/libexif/CMakeLists.txt
deleted file mode 100644
index 80cee25734..0000000000
--- a/lib/libexif/CMakeLists.txt
+++ /dev/null
@@ -1,14 +0,0 @@
-set(SOURCES ExifParse.cpp
- IptcParse.cpp
- JpegParse.cpp
- libexif.cpp)
-
-set(HEADERS ExifParse.h
- IptcParse.h
- JpegParse.h
- libexif.h)
-
-core_add_shared_library(exif WRAPPED)
-target_compile_definitions(exif PRIVATE _LINUX _DLL)
-set_target_properties(exif PROPERTIES FOLDER lib)
-source_group_by_folder(exif)
diff --git a/lib/libexif/libexif.sln b/lib/libexif/libexif.sln
deleted file mode 100644
index 4c85df300a..0000000000
--- a/lib/libexif/libexif.sln
+++ /dev/null
@@ -1,24 +0,0 @@
-Microsoft Visual Studio Solution File, Format Version 8.00
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libexif", "libexif.vcproj", "{AD20A3E2-09CB-42DB-9A70-27F7CDC886CE}"
- ProjectSection(ProjectDependencies) = postProject
- EndProjectSection
-EndProject
-Global
- GlobalSection(SolutionConfiguration) = preSolution
- Debug = Debug
- Release = Release
- Release (DLL) = Release (DLL)
- EndGlobalSection
- GlobalSection(ProjectConfiguration) = postSolution
- {AD20A3E2-09CB-42DB-9A70-27F7CDC886CE}.Debug.ActiveCfg = Debug|Win32
- {AD20A3E2-09CB-42DB-9A70-27F7CDC886CE}.Debug.Build.0 = Debug|Win32
- {AD20A3E2-09CB-42DB-9A70-27F7CDC886CE}.Release.ActiveCfg = Release|Win32
- {AD20A3E2-09CB-42DB-9A70-27F7CDC886CE}.Release.Build.0 = Release|Win32
- {AD20A3E2-09CB-42DB-9A70-27F7CDC886CE}.Release (DLL).ActiveCfg = Release (DLL)|Win32
- {AD20A3E2-09CB-42DB-9A70-27F7CDC886CE}.Release (DLL).Build.0 = Release (DLL)|Win32
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- EndGlobalSection
- GlobalSection(ExtensibilityAddIns) = postSolution
- EndGlobalSection
-EndGlobal
diff --git a/lib/libexif/libexif.vcxproj b/lib/libexif/libexif.vcxproj
deleted file mode 100644
index de81b481ff..0000000000
--- a/lib/libexif/libexif.vcxproj
+++ /dev/null
@@ -1,128 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup Label="ProjectConfigurations">
- <ProjectConfiguration Include="Debug (DLL)|Win32">
- <Configuration>Debug (DLL)</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- <ProjectConfiguration Include="Release (DLL)|Win32">
- <Configuration>Release (DLL)</Configuration>
- <Platform>Win32</Platform>
- </ProjectConfiguration>
- </ItemGroup>
- <PropertyGroup Label="Globals">
- <ProjectName>libexif_dll</ProjectName>
- <ProjectGuid>{AD20A3E2-09CB-42DB-9A70-27F7CDC886CE}</ProjectGuid>
- <RootNamespace>libexif_dll</RootNamespace>
- <Keyword>Win32Proj</Keyword>
- <WindowsTargetPlatformVersion>10.0.10240.0</WindowsTargetPlatformVersion>
- </PropertyGroup>
- <Import Project="$(SolutionDir)\XBMC.core-defaults.props" />
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release (DLL)|Win32'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <UseDebugLibraries>false</UseDebugLibraries>
- <CharacterSet>MultiByte</CharacterSet>
- <PlatformToolset>v140</PlatformToolset>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug (DLL)|Win32'" Label="Configuration">
- <ConfigurationType>DynamicLibrary</ConfigurationType>
- <UseDebugLibraries>true</UseDebugLibraries>
- <CharacterSet>MultiByte</CharacterSet>
- <PlatformToolset>v140</PlatformToolset>
- </PropertyGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
- <ImportGroup Label="ExtensionSettings">
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Release (DLL)|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="$(SolutionDir)\XBMC.defaults.props" />
- </ImportGroup>
- <ImportGroup Condition="'$(Configuration)|$(Platform)'=='Debug (DLL)|Win32'" Label="PropertySheets">
- <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
- <Import Project="$(SolutionDir)\XBMC.defaults.props" />
- </ImportGroup>
- <PropertyGroup Label="UserMacros" />
- <PropertyGroup>
- <_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug (DLL)|Win32'">$(SolutionDir)libs\$(TargetName)\$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug (DLL)|Win32'">$(SolutionDir)objs\$(TargetName)\$(Configuration)\</IntDir>
- <OutDir Condition="'$(Configuration)|$(Platform)'=='Release (DLL)|Win32'">$(SolutionDir)libs\$(TargetName)\$(Configuration)\</OutDir>
- <IntDir Condition="'$(Configuration)|$(Platform)'=='Release (DLL)|Win32'">$(SolutionDir)objs\$(TargetName)\$(Configuration)\</IntDir>
- <TargetName Condition="'$(Configuration)|$(Platform)'=='Release (DLL)|Win32'">libexif</TargetName>
- <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug (DLL)|Win32'">libexif</TargetName>
- <CustomBuildAfterTargets Condition="'$(Configuration)|$(Platform)'=='Release (DLL)|Win32'">Build</CustomBuildAfterTargets>
- <TargetExt Condition="'$(Configuration)|$(Platform)'=='Debug (DLL)|Win32'">.dll</TargetExt>
- <TargetExt Condition="'$(Configuration)|$(Platform)'=='Release (DLL)|Win32'">.dll</TargetExt>
- </PropertyGroup>
- <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug (DLL)|Win32'">
- <CustomBuildAfterTargets>Build</CustomBuildAfterTargets>
- </PropertyGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug (DLL)|Win32'">
- <ClCompile>
- <PreprocessorDefinitions>_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PrecompiledHeader>
- </PrecompiledHeader>
- </ClCompile>
- <Link>
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
- <ProgramDatabaseFile>$(TargetName).pdb</ProgramDatabaseFile>
- <DataExecutionPrevention>
- </DataExecutionPrevention>
- <ImportLibrary>$(TargetName).lib</ImportLibrary>
- </Link>
- <CustomBuildStep>
- <Inputs>$(TargetPath)</Inputs>
- <Outputs>$(SolutionDir)..\..\system\$(TargetFileName)</Outputs>
- <Message>Copy output</Message>
- <Command>copy /B /Y "$(TargetPath)" "$(SolutionDir)..\..\system\$(TargetFileName)"</Command>
- </CustomBuildStep>
- </ItemDefinitionGroup>
- <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release (DLL)|Win32'">
- <ClCompile>
- <PreprocessorDefinitions>_DLL;_CRT_SECURE_NO_WARNINGS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
- <PrecompiledHeader>
- </PrecompiledHeader>
- </ClCompile>
- <Link>
- <OutputFile>$(OutDir)$(TargetName)$(TargetExt)</OutputFile>
- <ProgramDatabaseFile>$(TargetName).pdb</ProgramDatabaseFile>
- <ProfileGuidedDatabase>
- </ProfileGuidedDatabase>
- <DataExecutionPrevention>
- </DataExecutionPrevention>
- <ImportLibrary>$(TargetName).lib</ImportLibrary>
- </Link>
- <PostBuildEvent>
- <Command>
- </Command>
- </PostBuildEvent>
- <CustomBuildStep>
- <Command>copy /B /Y "$(TargetPath)" "$(SolutionDir)..\..\system\$(TargetFileName)"</Command>
- </CustomBuildStep>
- <CustomBuildStep>
- <Message>Copy output</Message>
- </CustomBuildStep>
- <CustomBuildStep>
- <Outputs>$(SolutionDir)..\..\system\$(TargetFileName)</Outputs>
- <Inputs>$(TargetPath)</Inputs>
- </CustomBuildStep>
- </ItemDefinitionGroup>
- <ItemGroup>
- <ClCompile Include="ExifParse.cpp" />
- <ClCompile Include="IptcParse.cpp" />
- <ClCompile Include="JpegParse.cpp" />
- <ClCompile Include="libexif.cpp" />
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="ExifParse.h" />
- <ClInclude Include="IptcParse.h" />
- <ClInclude Include="JpegParse.h" />
- </ItemGroup>
- <ItemGroup>
- <None Include="ReadMe.txt" />
- </ItemGroup>
- <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
- <ImportGroup Label="ExtensionTargets">
- </ImportGroup>
-</Project> \ No newline at end of file
diff --git a/lib/libexif/libexif.vcxproj.filters b/lib/libexif/libexif.vcxproj.filters
deleted file mode 100644
index 5ca80ed9aa..0000000000
--- a/lib/libexif/libexif.vcxproj.filters
+++ /dev/null
@@ -1,45 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
- <ItemGroup>
- <Filter Include="Source Files">
- <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
- <Extensions>cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
- </Filter>
- <Filter Include="Header Files">
- <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
- <Extensions>h;hpp;hxx;hm;inl;inc;xsd</Extensions>
- </Filter>
- <Filter Include="Resource Files">
- <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
- <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx</Extensions>
- </Filter>
- </ItemGroup>
- <ItemGroup>
- <ClCompile Include="ExifParse.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="IptcParse.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="JpegParse.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- <ClCompile Include="libexif.cpp">
- <Filter>Source Files</Filter>
- </ClCompile>
- </ItemGroup>
- <ItemGroup>
- <ClInclude Include="ExifParse.h">
- <Filter>Source Files</Filter>
- </ClInclude>
- <ClInclude Include="IptcParse.h">
- <Filter>Source Files</Filter>
- </ClInclude>
- <ClInclude Include="JpegParse.h">
- <Filter>Source Files</Filter>
- </ClInclude>
- </ItemGroup>
- <ItemGroup>
- <None Include="ReadMe.txt" />
- </ItemGroup>
-</Project> \ No newline at end of file
diff --git a/xbmc/DllPaths_generated.h.in b/xbmc/DllPaths_generated.h.in
index a4d4530703..758b182026 100644
--- a/xbmc/DllPaths_generated.h.in
+++ b/xbmc/DllPaths_generated.h.in
@@ -26,7 +26,6 @@
/* libraries */
#define DLL_PATH_CPLUFF "special://xbmcbin/system/libcpluff-@ARCH@.so"
-#define DLL_PATH_LIBEXIF "special://xbmcbin/system/libexif-@ARCH@.so"
#define DLL_PATH_LIBNFS "@NFS_SONAME@"
diff --git a/xbmc/DllPaths_generated_android.h.in b/xbmc/DllPaths_generated_android.h.in
index e05b984ac6..04a2918d6d 100644
--- a/xbmc/DllPaths_generated_android.h.in
+++ b/xbmc/DllPaths_generated_android.h.in
@@ -28,7 +28,6 @@
// * foo.so will be renamed libfoo.so in the packaging stage
#define DLL_PATH_CPLUFF "libcpluff-@ARCH@.so"
-#define DLL_PATH_LIBEXIF "libexif-@ARCH@.so"
#define DLL_PATH_LIBNFS "@NFS_SONAME@"
#define DLL_PATH_LIBPLIST "@PLIST_SONAME@"
diff --git a/xbmc/DllPaths_win32.h b/xbmc/DllPaths_win32.h
index 2cd8880072..117568b56e 100644
--- a/xbmc/DllPaths_win32.h
+++ b/xbmc/DllPaths_win32.h
@@ -23,7 +23,6 @@
/* libraries */
#define DLL_PATH_CPLUFF "special://xbmcbin/cpluff.dll"
-#define DLL_PATH_LIBEXIF "special://xbmcbin/libexif.dll"
#define DLL_PATH_LIBCURL "special://xbmcbin/libcurl.dll"
#define DLL_PATH_LIBNFS "special://xbmcbin/libnfs.dll"
#define DLL_PATH_LIBPLIST "special://xbmcbin/libplist.dll"
diff --git a/xbmc/pictures/CMakeLists.txt b/xbmc/pictures/CMakeLists.txt
index 56b7c051cd..9bbe6cda11 100644
--- a/xbmc/pictures/CMakeLists.txt
+++ b/xbmc/pictures/CMakeLists.txt
@@ -1,7 +1,11 @@
-set(SOURCES GUIDialogPictureInfo.cpp
+set(SOURCES ExifParse.cpp
+ GUIDialogPictureInfo.cpp
GUIViewStatePictures.cpp
GUIWindowPictures.cpp
GUIWindowSlideShow.cpp
+ IptcParse.cpp
+ JpegParse.cpp
+ libexif.cpp
Picture.cpp
PictureInfoLoader.cpp
PictureInfoTag.cpp
@@ -9,8 +13,7 @@ set(SOURCES GUIDialogPictureInfo.cpp
PictureThumbLoader.cpp
SlideShowPicture.cpp)
-set(HEADERS DllLibExif.h
- GUIDialogPictureInfo.h
+set(HEADERS GUIDialogPictureInfo.h
GUIViewStatePictures.h
GUIWindowPictures.h
GUIWindowSlideShow.h
diff --git a/xbmc/pictures/DllLibExif.h b/xbmc/pictures/DllLibExif.h
deleted file mode 100644
index cdec25a1a2..0000000000
--- a/xbmc/pictures/DllLibExif.h
+++ /dev/null
@@ -1,40 +0,0 @@
-#pragma once
-
-/*
- * Copyright (C) 2005-2013 Team XBMC
- * http://xbmc.org
- *
- * 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
- * the Free Software Foundation; either version 2, or (at your option)
- * any later version.
- *
- * This Program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with XBMC; see the file COPYING. If not, see
- * <http://www.gnu.org/licenses/>.
- *
- */
-
-#include "DynamicDll.h"
-#include "lib/libexif/libexif.h"
-
-class DllLibExifInterface
-{
-public:
- virtual bool process_jpeg(const char *, ExifInfo_t *, IPTCInfo_t *)=0;
- virtual ~DllLibExifInterface() {}
-};
-
-class DllLibExif : public DllDynamic, DllLibExifInterface
-{
- DECLARE_DLL_WRAPPER(DllLibExif, DLL_PATH_LIBEXIF)
- DEFINE_METHOD3(bool, process_jpeg, (const char *p1, ExifInfo_t *p2, IPTCInfo_t *p3))
- BEGIN_METHOD_RESOLVE()
- RESOLVE_METHOD(process_jpeg)
- END_METHOD_RESOLVE()
-};
diff --git a/lib/libexif/ExifParse.cpp b/xbmc/pictures/ExifParse.cpp
index 1b15745f15..bec4bf1d6a 100755..100644
--- a/lib/libexif/ExifParse.cpp
+++ b/xbmc/pictures/ExifParse.cpp
@@ -34,13 +34,18 @@
#else
#include <memory.h>
#include <cstring>
-#define min(a,b) (a)>(b)?(b):(a)
-#define max(a,b) (a)<(b)?(b):(a)
#endif
#include <math.h>
#include <stdio.h>
#include "ExifParse.h"
+#ifndef min
+#define min(a,b) (a)>(b)?(b):(a)
+#endif
+#ifndef max
+#define max(a,b) (a)<(b)?(b):(a)
+#endif
+
// Prototypes for exif utility functions.
static void ErrNonfatal(const char* const msg, int a1, int a2);
diff --git a/lib/libexif/ExifParse.h b/xbmc/pictures/ExifParse.h
index 94e6cd0fc2..94e6cd0fc2 100644
--- a/lib/libexif/ExifParse.h
+++ b/xbmc/pictures/ExifParse.h
diff --git a/lib/libexif/IptcParse.cpp b/xbmc/pictures/IptcParse.cpp
index a0bba1632e..51f3038f25 100644
--- a/lib/libexif/IptcParse.cpp
+++ b/xbmc/pictures/IptcParse.cpp
@@ -30,12 +30,15 @@
#include <windows.h>
#else
#include <string.h>
-#define min(a,b) (a)>(b)?(b):(a)
#endif
#include <stdio.h>
#include "IptcParse.h"
#include "ExifParse.h"
+#ifndef min
+#define min(a,b) (a)>(b)?(b):(a)
+#endif
+
// Supported IPTC entry types
#define IPTC_RECORD_VERSION 0x00
#define IPTC_SUPLEMENTAL_CATEGORIES 0x14
diff --git a/lib/libexif/IptcParse.h b/xbmc/pictures/IptcParse.h
index e175ef769f..e175ef769f 100644
--- a/lib/libexif/IptcParse.h
+++ b/xbmc/pictures/IptcParse.h
diff --git a/lib/libexif/JpegParse.cpp b/xbmc/pictures/JpegParse.cpp
index 6545525b89..041b2a8ece 100644
--- a/lib/libexif/JpegParse.cpp
+++ b/xbmc/pictures/JpegParse.cpp
@@ -30,17 +30,21 @@
// pairs (where both description and value fields are of CStdString types).
//--------------------------------------------------------------------------
+#include "filesystem/File.h"
#ifndef _LINUX
#include <windows.h>
#else
#include <memory.h>
#include <cstring>
-#define min(a,b) (a)>(b)?(b):(a)
typedef unsigned char BYTE;
#endif
#include "JpegParse.h"
+#ifndef min
+#define min(a,b) (a)>(b)?(b):(a)
+#endif
+using namespace XFILE;
//--------------------------------------------------------------------------
#define JPEG_PARSE_STRING_ID_BASE 21500
@@ -98,7 +102,7 @@ void CJpegParse::ProcessSOFn (void)
// Read a section from a JPEG file. Note that this function allocates memory.
// It must be called in pair with ReleaseSection
//--------------------------------------------------------------------------
-bool CJpegParse::GetSection (FILE *infile, const unsigned short sectionLength)
+bool CJpegParse::GetSection (CFile& infile, const unsigned short sectionLength)
{
if (sectionLength < 2)
{
@@ -118,7 +122,7 @@ bool CJpegParse::GetSection (FILE *infile, const unsigned short sectionLength)
unsigned int len = (unsigned int)sectionLength;
- size_t bytesRead = fread(m_SectionBuffer+sizeof(sectionLength), 1, len-sizeof(sectionLength), infile);
+ size_t bytesRead = infile.Read(m_SectionBuffer+sizeof(sectionLength), len-sizeof(sectionLength));
if (bytesRead != sectionLength-sizeof(sectionLength))
{
printf("JpgParse: premature end of file?");
@@ -142,16 +146,16 @@ void CJpegParse::ReleaseSection (void)
// Parse the marker stream until SOS or EOI is seen; infile has already been
// successfully open
//--------------------------------------------------------------------------
-bool CJpegParse::ExtractInfo (FILE *infile)
+bool CJpegParse::ExtractInfo (CFile& infile)
{
// Get file marker (two bytes - must be 0xFFD8 for JPEG files
BYTE a;
- size_t bytesRead = fread(&a, 1, sizeof(BYTE), infile);
+ size_t bytesRead = infile.Read(&a, sizeof(BYTE));
if ((bytesRead != sizeof(BYTE)) || (a != 0xFF))
{
return false;
}
- bytesRead = fread(&a, 1, sizeof(BYTE), infile);
+ bytesRead = infile.Read(&a, sizeof(BYTE));
if ((bytesRead != sizeof(BYTE)) || (a != M_SOI))
{
return false;
@@ -161,7 +165,7 @@ bool CJpegParse::ExtractInfo (FILE *infile)
{
BYTE marker = 0;
for (a=0; a<7; a++) {
- fread(&marker, 1, sizeof(BYTE), infile);
+ bytesRead = infile.Read(&marker, sizeof(BYTE));
if (marker != 0xFF)
break;
@@ -175,7 +179,7 @@ bool CJpegParse::ExtractInfo (FILE *infile)
// Read the length of the section.
unsigned short itemlen = 0;
- bytesRead = fread(&itemlen, 1, sizeof(itemlen), infile);
+ bytesRead = infile.Read(&itemlen, sizeof(itemlen));
itemlen = CExifParse::Get16(&itemlen);
if ((bytesRead != sizeof(itemlen)) || (itemlen < sizeof(itemlen)))
@@ -271,10 +275,9 @@ bool CJpegParse::ExtractInfo (FILE *infile)
//--------------------------------------------------------------------------
bool CJpegParse::Process (const char *picFileName)
{
- FILE *file;
+ CFile file;
- file = fopen(picFileName, "rb");
- if (!file)
+ if (!file.Open(picFileName))
return false;
// File exists and successfully opened. Start processing
@@ -318,7 +321,7 @@ bool CJpegParse::Process (const char *picFileName)
m_JpegInfo[SLIDE_FILE_DATE] = tmp;*/
bool result = ExtractInfo(file);
- fclose(file);
+ file.Close();
if (result == false)
printf("JpgParse: Not a JPEG file %s", picFileName);
return result;
diff --git a/lib/libexif/JpegParse.h b/xbmc/pictures/JpegParse.h
index 1e9eeeb764..823a0421c1 100644
--- a/lib/libexif/JpegParse.h
+++ b/xbmc/pictures/JpegParse.h
@@ -34,6 +34,11 @@
#define M_DRI 0xDD
#define M_IPTC 0xED // IPTC marker
+namespace XFILE
+{
+ class CFile;
+}
+
class CJpegParse
{
@@ -45,8 +50,8 @@ class CJpegParse
const IPTCInfo_t * GetIptcInfo() const { return &m_IPTCInfo; };
private:
- bool ExtractInfo (FILE *infile);
- bool GetSection (FILE *infile, const unsigned short sectionLength);
+ bool ExtractInfo (XFILE::CFile& infile);
+ bool GetSection (XFILE::CFile& infile, const unsigned short sectionLength);
void ReleaseSection (void);
void ProcessSOFn (void);
diff --git a/xbmc/pictures/PictureInfoTag.cpp b/xbmc/pictures/PictureInfoTag.cpp
index 789b907c1c..b1c0b53190 100644
--- a/xbmc/pictures/PictureInfoTag.cpp
+++ b/xbmc/pictures/PictureInfoTag.cpp
@@ -52,11 +52,7 @@ bool CPictureInfoTag::Load(const std::string &path)
{
m_isLoaded = false;
- DllLibExif exifDll;
- if (path.empty() || !exifDll.Load())
- return false;
-
- if (exifDll.process_jpeg(path.c_str(), &m_exifInfo, &m_iptcInfo))
+ if (process_jpeg(path.c_str(), &m_exifInfo, &m_iptcInfo))
m_isLoaded = true;
ConvertDateTime();
diff --git a/xbmc/pictures/PictureInfoTag.h b/xbmc/pictures/PictureInfoTag.h
index 4adfdcf7b9..92a7264b29 100644
--- a/xbmc/pictures/PictureInfoTag.h
+++ b/xbmc/pictures/PictureInfoTag.h
@@ -22,8 +22,8 @@
#include "utils/ISerializable.h"
#include "utils/ISortable.h"
#include "utils/IArchivable.h"
-#include "DllLibExif.h"
#include "XBDateTime.h"
+#include "libexif.h"
#define SLIDE_FILE_NAME 900 // Note that not all image tags will be present for each image
#define SLIDE_FILE_PATH 901
diff --git a/lib/libexif/libexif.cpp b/xbmc/pictures/libexif.cpp
index b2d29dbe2e..b2d29dbe2e 100644
--- a/lib/libexif/libexif.cpp
+++ b/xbmc/pictures/libexif.cpp
diff --git a/lib/libexif/libexif.h b/xbmc/pictures/libexif.h
index 519ac3044e..519ac3044e 100644
--- a/lib/libexif/libexif.h
+++ b/xbmc/pictures/libexif.h