Merged all changes from the unstable branch into the trunk.

v0.27.3
Andreas Huggel 16 years ago
parent f74c3bcca2
commit 370af5c8a3

@ -0,0 +1,102 @@
# CMake build system for exiv2 library and executables
# Copyright 2008 by Patrick Spendrin <ps_ml@gmx.de>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# 3. The name of the author may not be used to endorse or promote
# products derived from this software without specific prior
# written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
project( exiv2 )
cmake_minimum_required( VERSION 2.6 )
set( PACKAGE_BUGREPORT "ahuggel@gmx.net" )
set( PACKAGE "exiv2" )
set( PACKAGE_NAME "exiv2" )
set( PACKAGE_STRING "exiv2 0.18.2" )
set( PACKAGE_TARNAME "exiv2" )
set( PACKAGE_VERSION "0.18.2" )
set( GENERIC_LIB_VERSION "5.3.1" )
set( GENERIC_LIB_SOVERSION "5" )
# options and there default values
option( EXIV2_ENABLE_SHARED "Build exiv2 as a shared library (dll)" ON )
option( EXIV2_ENABLE_XMP "Build with XMP metadata support" ON )
option( EXIV2_ENABLE_LIBXMP "Build a static convenience Library for XMP" OFF )
option( EXIV2_ENABLE_PNG "Build with png support (requires libz)" ON )
option( EXIV2_ENABLE_NLS "Build native language support (requires gettext)" OFF )
option( EXIV2_ENABLE_PRINTUCS2 "Build with Printucs2" ON )
option( EXIV2_ENABLE_LENSDATA "include lens data" ON )
option( EXIV2_ENABLE_COMMERCIAL "compile with the EXV_COMMERCIAL_VERSION symbol set" OFF )
option( BUILD_samples "Build the unit tests" OFF )
if( MINGW OR UNIX )
add_definitions( -Wall -Wcast-align -Wpointer-arith -Wformat-security -Wmissing-format-attribute -Woverloaded-virtual -W )
endif( MINGW OR UNIX )
if( EXIV2_ENABLE_XMP )
set( HAVE_XMP_TOOLKIT ON )
set( XMPLIB "do" )
endif( EXIV2_ENABLE_XMP )
if( BUILD_samples )
EXIV2_ENABLE_TESTING()
endif( BUILD_samples )
include( config/ConfigureChecks.cmake )
set( INSTALL_TARGET_STANDARD_ARGS RUNTIME DESTINATION bin LIBRARY DESTINATION lib ARCHIVE DESTINATION lib )
# add sources from XMPSDK directory - this needs to be done here
set( XMPSRC ${CMAKE_SOURCE_DIR}/xmpsdk/src/ExpatAdapter.cpp
${CMAKE_SOURCE_DIR}/xmpsdk/src/MD5.cpp
${CMAKE_SOURCE_DIR}/xmpsdk/src/ParseRDF.cpp
${CMAKE_SOURCE_DIR}/xmpsdk/src/UnicodeConversions.cpp
${CMAKE_SOURCE_DIR}/xmpsdk/src/WXMPIterator.cpp
${CMAKE_SOURCE_DIR}/xmpsdk/src/WXMPMeta.cpp
${CMAKE_SOURCE_DIR}/xmpsdk/src/WXMPUtils.cpp
${CMAKE_SOURCE_DIR}/xmpsdk/src/XML_Node.cpp
${CMAKE_SOURCE_DIR}/xmpsdk/src/XMPCore_Impl.cpp
${CMAKE_SOURCE_DIR}/xmpsdk/src/XMPIterator.cpp
${CMAKE_SOURCE_DIR}/xmpsdk/src/XMPMeta-GetSet.cpp
${CMAKE_SOURCE_DIR}/xmpsdk/src/XMPMeta-Parse.cpp
${CMAKE_SOURCE_DIR}/xmpsdk/src/XMPMeta-Serialize.cpp
${CMAKE_SOURCE_DIR}/xmpsdk/src/XMPMeta.cpp
${CMAKE_SOURCE_DIR}/xmpsdk/src/XMPUtils-FileInfo.cpp
${CMAKE_SOURCE_DIR}/xmpsdk/src/XMPUtils.cpp )
# the following lines need to be added to circumvent the error in xmpsdk\src\MD5.h
if( ${EXV_HAVE_STDINT_H} )
add_definitions( -DEXV_HAVE_STDINT_H )
endif( ${EXV_HAVE_STDINT_H} )
add_subdirectory( xmpsdk )
add_subdirectory( src )
if( BUILD_samples )
add_subdirectory( samples )
endif( BUILD_samples )

@ -94,6 +94,7 @@ distclean: clean
# This removes almost everything, including the configure script!
maintainer-clean: distclean
rm -f configure
-cd test && $(MAKE) $(MAKECMDGOALS)
config/config.mk:
$(error File config/config.mk does not exist. Did you run ./configure?)

@ -0,0 +1,80 @@
Exiv2 uses cmake, a cross-platform build system, to control the
compilation process using simple platform and compiler independent
configuration files.
The old make and MSVC build files are currently still around but are
considered deprecated in the unstable branch. They will disappear once
the cmake build process is feature-complete, stable and documented. Or
maybe earlier to force me to get there.
Cmake resources
===============
Home: http://www.cmake.org/
Help: http://www.cmake.org/cmake/help/help.html
Doc: http://www.cmake.org/cmake/help/documentation.html
Wiki: http://www.cmake.org/Wiki/CMake
FAQ: http://www.cmake.org/Wiki/CMake_FAQ
Building and Installing
=======================
a) From the command line
Run the following commands from the top directory (containing this
file) to configure, build and install the library and utility:
$ mkdir build
$ cd build
$ cmake ..
$ make
$ make install
To modify the configuration
$ ccmake ..
Default install locations
...
To uninstall Exiv2, run:
$ make uninstall >>>>> TODO
in the meantime, on UNIX-like systems, use
$ xargs rm < install_manifest.txt
b) Using the cmake GUI
ccmake
Dependencies
============
cmake itself
migrate the rest here from README, test one by one
-----
Further TODOs:
* Rename configuration settings to EXIV2_*, e.g., EXIV2_ENABLE_SHARED
* Two cmake projects: 1) exiv2 2) samples, common config in config/
* Is it possible to not have CMakeLists.txt file in the top dir?
* --disable-visibility
* cross-compilation
* Release build and packaging scripts
* emacs M-c command to (re-)compile

@ -0,0 +1,59 @@
DONE * Need soname versioning for shared library
* Need g++ specific DONE compiler options (warnings) and settings (visibility)
* enable build types in cmake. In case required, add support for it
* The following options of the configure script should be supported
--without-zlib DONE - ENABLE_PNG
--disable-nls DONE - ENABLE_NLS ??? that doesn't work correctly here
--disable-printucs2 DONE - ENABLE_PRINTUCS2
--disable-xmp DONE - ENABLE_XMP
--enable-commercial DONE - ENABLE_COMMERCIAL
--disable-lensdata DONE - ENABLE_LENSDATA
--disable-shared DONE - ENABLE_SHARED_EXIV2
DONE * Add further messages to display option settings
------------------------------------------------------------------
-- Exiv2 0.18-pre1 feature configuration summary
--
-- Build a shared library......... NO
-- PNG image support.............. YES
-- Native language support........ NO
gettext is required for native language support. Make sure the
gettext header files are installed. You can get gettext from
http://www.gnu.org/software/gettext/
-- Conversion of Windows XP tags.. YES
-- Nikon lens database............ YES
-- XMP metadata support........... YES
------------------------------------------------------------------
* Need targets to build/install doc, DONE man page
DONE * add possibility to build xmp as a convenience library
DONE * Compilation fails if Expat (possibly also other dependencies?) is in a
non-standard place
WONTFIX * This is probably not necessary in src/CMakeLists.txt / can be removed:
set( LIBEXIV2_SRC ${LIBEXIV2_SRC} getopt_win32.c )
it is necessary as both windows compilers do not autoexport
DONE * Do we need to worry about MSVC warnings like this:
d:\home\ahuggel\msys\src\exiv2\src\exif.hpp(245) : warning C4251: 'Exiv2::Exifdatum::value_' : class 'std::auto_ptr<_Ty>' needs to have dll-interface to be used by clients of class 'Exiv2::Exifdatum'
with
[
_Ty=Exiv2::Value
]
* add information on how to cross-compile on Linux for Windows (MinGW) (some applications and
my own release-build process need this) to the README.cmake
INFO * check How does cmake handle RPATH? (I'll read up on this)
DONE * Is the pkgconfig file not installed in MinGW? - it is now
* Can the logic needed to build the doc be re-written using cmake?

@ -0,0 +1,253 @@
# CMake build system for exiv2 library and executables
# Copyright 2008 by Patrick Spendrin <ps_ml@gmx.de>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# 3. The name of the author may not be used to endorse or promote
# products derived from this software without specific prior
# written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# ConfigureChecks for exiv2
set( CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/config )
include( CheckIncludeFile )
include( CheckFunctionExists )
include( CheckSymbolExists )
include( CheckCSourceCompiles )
set( STDC_HEADERS ON )
set( HAVE_DECL_STRERROR_R 0 )
set( HAVE_PRINTUCS2 ${EXIV2_ENABLE_PRINTUCS2} )
set( HAVE_LENSDATA ${EXIV2_ENABLE_LENSDATA} )
include_directories( ${CMAKE_INCLUDE_PATH} ${CMAKE_BINARY_DIR} ${CMAKE_SOURCE_DIR}/xmpsdk/include )
link_directories( ${CMAKE_LIBRARY_PATH} )
set( CMAKE_REQUIRED_INCLUDES ${CMAKE_INCLUDE_PATH} )
if( EXIV2_ENABLE_PNG )
find_package( ZLIB )
include_directories( ${ZLIB_INCLUDE_DIR} )
set (HAVE_LIBZ ${ZLIB_FOUND})
endif( EXIV2_ENABLE_PNG )
if (EXIV2_ENABLE_XMP)
find_package(EXPAT)
include_directories(${EXPAT_INCLUDE_DIR})
# FindEXPAT.cmake doesn't check for REQUIRED flags - so we need to check ourselves
if (NOT EXPAT_FOUND)
message(FATAL_ERROR "missing library expat required for XMP")
endif( NOT EXPAT_FOUND )
endif (EXIV2_ENABLE_XMP)
if( EXIV2_ENABLE_SHARED )
add_definitions( -DEXV_HAVE_DLL )
set( STATIC_FLAG SHARED )
else( EXIV2_ENABLE_SHARED )
set( STATIC_FLAG STATIC )
endif( EXIV2_ENABLE_SHARED )
if( EXIV2_ENABLE_NLS )
if( NOT LOCALEDIR )
set( LOCALEDIR "\"${CMAKE_INSTALL_PREFIX}/share/locale\"" )
if( WIN32 )
string( REPLACE "/" "\\\\" LOCALEDIR ${LOCALEDIR} )
endif( WIN32 )
endif( NOT LOCALEDIR )
add_definitions( -DEXV_LOCALEDIR=${LOCALEDIR} )
endif( EXIV2_ENABLE_NLS )
if( EXIV2_ENABLE_COMMERCIAL )
add_definitions( -DEXV_COMMERCIAL_VERSION )
endif( EXIV2_ENABLE_COMMERCIAL )
find_package(Iconv)
if( ICONV_TEST )
set( HAVE_ICONV 1 )
message ( "================> ICONV_LIBRARIES : " ${ICONV_LIBRARIES} )
endif( ICONV_TEST )
if( ICONV_ACCEPTS_CONST_INPUT )
set( ICONV_CONST "const" )
endif( ICONV_ACCEPTS_CONST_INPUT )
# checking for Header files
check_include_file( "inttypes.h" HAVE_INTTYPES_H )
check_include_file( "libintl.h" HAVE_LIBINTL_H )
check_include_file( "malloc.h" HAVE_MALLOC_H )
check_include_file( "memory.h" HAVE_MEMORY_H )
check_include_file( "iconv.h" HAVE_ICONV_H )
check_include_file( "stdbool.h" HAVE_STDBOOL_H )
check_include_file( "stdint.h" HAVE_STDINT_H )
check_include_file( "stdlib.h" HAVE_STDLIB_H )
check_include_file( "string.h" HAVE_STRING_H )
check_include_file( "strings.h" HAVE_STRINGS_H )
check_include_file( "unistd.h" HAVE_UNISTD_H )
check_include_file( "wchar.h" HAVE_WCHAR_H )
check_include_file( "sys/stat.h" HAVE_SYS_STAT_H )
check_include_file( "sys/time.h" HAVE_SYS_TIME_H )
check_include_file( "sys/types.h" HAVE_SYS_TYPES_H )
check_include_file( "sys/mman.h" HAVE_SYS_MMAN_H )
check_include_file( "process.h" HAVE_PROCESS_H )
check_function_exists( alarm HAVE_ALARM )
check_function_exists( gmtime_r HAVE_GMTIME_R )
check_function_exists( malloc HAVE_MALLOC )
check_function_exists( memset HAVE_MEMSET )
check_function_exists( mmap HAVE_MMAP )
check_function_exists( munmap HAVE_MUNMAP )
check_function_exists( realloc HAVE_REALLOC )
check_function_exists( strchr HAVE_STRCHR )
check_function_exists( strchr_r HAVE_STRCHR_R )
check_function_exists( strerror HAVE_STRERROR )
check_function_exists( strerror_r HAVE_STRERROR_R )
check_function_exists( strtol HAVE_STRTOL )
check_function_exists( timegm HAVE_TIMEGM )
check_function_exists( vprintf HAVE_VPRINTF )
message( STATUS "None: ${CMAKE_CXX_FLAGS}" )
message( STATUS "Debug: ${CMAKE_CXX_FLAGS_DEBUG}" )
message( STATUS "Release: ${CMAKE_CXX_FLAGS_RELEASE}" )
message( STATUS "RelWithDebInfo: ${CMAKE_CXX_FLAGS_RELWITHDEBINFO}" )
message( STATUS "MinSizeRel: ${CMAKE_CXX_FLAGS_MINSIZEREL}" )
if( HAVE_STDBOOL_H )
check_symbol_exists( "_Bool" stdbool.h HAVE__BOOL )
endif( HAVE_STDBOOL_H )
# struct tm in sys/time.h
if( HAVE_SYS_TIME_H )
check_c_source_compiles( "#include <sys/time.h>
int main() {
struct tm t;
return 0;
}" TM_IN_SYS_TIME )
endif( HAVE_SYS_TIME_H )
# strerror_r returns char*
check_c_source_compiles( "#include <string.h>
int main() {
char * c;
c = strerror_r(0,c,0);
return 0;
}" STRERROR_R_CHAR_P )
#function is declared with the above
if( STRERROR_R_CHAR_P )
set( HAVE_DECL_STRERROR_R 1 )
endif( STRERROR_R_CHAR_P )
# time.h and sys/time.h can be included in the same file
check_c_source_compiles( "#include <time.h>
#include <sys/time.h>
int main() {
return 0;
}" TIME_WITH_SYS_TIME )
# for msvc define to int in exv_conf.h
if( NOT MSVC )
set( HAVE_PID_T TRUE )
endif( NOT MSVC )
set( EXV_SYMBOLS
ENABLE_NLS
HAVE_ALARM
HAVE_DECL_STRERROR_R
HAVE_GMTIME_R
HAVE_ICONV
HAVE_ICONV_H
HAVE_INTTYPES_H
HAVE_LENSDATA
HAVE_LIBINTL_H
HAVE_LIBZ
HAVE_MALLOC_H
HAVE_MEMORY_H
HAVE_MEMSET
HAVE_MMAP
HAVE_MUNMAP
HAVE_PRINTUCS2
HAVE_PROCESS_H
HAVE_REALLOC
HAVE_STDBOOL_H
HAVE_STDINT_H
HAVE_STDLIB_H
HAVE_STRCHR
HAVE_STRCHR_R
HAVE_STRERROR
HAVE_STRERROR_R
HAVE_STRINGS_H
HAVE_STRING_H
HAVE_STRTOL
HAVE_SYS_MMAN_H
HAVE_SYS_STAT_H
HAVE_SYS_TIME_H
HAVE_SYS_TYPES_H
HAVE_TIMEGM
HAVE_UNISTD_H
HAVE_VPRINTF
HAVE_WCHAR_H
HAVE_XMP_TOOLKIT
HAVE__BOOL
ICONV_CONST
PACKAGE
PACKAGE_BUGREPORT
PACKAGE_NAME
PACKAGE_STRING
PACKAGE_TARNAME
PACKAGE_VERSION
)
foreach( entry ${EXV_SYMBOLS} )
set( EXV_${entry} ${${entry}} )
endforeach( entry ${EXV_SYMBOLS} )
configure_file( config/config.h.cmake ${CMAKE_BINARY_DIR}/exv_conf.h )
configure_file( config/exv_msvc.h.cmake ${CMAKE_BINARY_DIR}/exv_msvc.h COPYONLY )
install( FILES ${CMAKE_BINARY_DIR}/exv_conf.h DESTINATION include/exiv2 )
install( FILES ${CMAKE_BINARY_DIR}/exv_msvc.h DESTINATION include/exiv2 )
if( NOT MSVC )
configure_file( config/exiv2.pc.cmake ${CMAKE_BINARY_DIR}/exiv2.pc )
install( FILES ${CMAKE_BINARY_DIR}/exiv2.pc DESTINATION lib/pkgconfig )
endif( NOT MSVC )
# ******************************************************************************
# output chosen build options
macro( OptionOutput _outputstring )
if( ${ARGN} )
set( _var "YES" )
else( ${ARGN} )
set( _var "NO" )
endif( ${ARGN} )
message( STATUS "${_outputstring}${_var}" )
endmacro( OptionOutput _outputstring )
message( STATUS "-------------------------------------------------------------" )
OptionOutput( "Building PNG support: " EXIV2_ENABLE_PNG AND ZLIB_FOUND )
OptionOutput( "Building shared library: " EXIV2_ENABLE_SHARED )
OptionOutput( "XMP metadata support: " EXIV2_ENABLE_XMP )
OptionOutput( "Building static libxmp: " ENABLE_LIBXMP )
OptionOutput( "Native language support: " EXIV2_ENABLE_NLS )
OptionOutput( "Conversion of Windows XP tags: " EXIV2_ENABLE_PRINTUCS2 )
OptionOutput( "Nikon lens database: " EXIV2_ENABLE_LENSDATA )
OptionOutput( "commercial build: " EXIV2_ENABLE_COMMERCIAL )
message( STATUS "-------------------------------------------------------------" )

@ -0,0 +1,28 @@
# - Find expat
# Find the native EXPAT headers and libraries.
#
# EXPAT_INCLUDE_DIRS - where to find expat.h, etc.
# EXPAT_LIBRARIES - List of libraries when using expat.
# EXPAT_FOUND - True if expat found.
# Look for the header file.
FIND_PATH(EXPAT_INCLUDE_DIR NAMES expat.h)
# Look for the library.
FIND_LIBRARY(EXPAT_LIBRARY NAMES expat libexpat)
# handle the QUIETLY and REQUIRED arguments and set EXPAT_FOUND to TRUE if
# all listed variables are TRUE
INCLUDE(FindPackageHandleStandardArgs)
FIND_PACKAGE_HANDLE_STANDARD_ARGS(EXPAT DEFAULT_MSG EXPAT_LIBRARY EXPAT_INCLUDE_DIR)
# Copy the results to the output variables.
IF(EXPAT_FOUND)
SET(EXPAT_LIBRARIES ${EXPAT_LIBRARY})
SET(EXPAT_INCLUDE_DIRS ${EXPAT_INCLUDE_DIR})
ELSE(EXPAT_FOUND)
SET(EXPAT_LIBRARIES)
SET(EXPAT_INCLUDE_DIRS)
ENDIF(EXPAT_FOUND)
MARK_AS_ADVANCED(EXPAT_INCLUDE_DIR EXPAT_LIBRARY)

@ -0,0 +1,87 @@
# vim:ts=4:sw=4:expandtab:autoindent:
#
# The MIT License
#
# Copyright (c) 2008, 2009 Aristid Breitkreuz, Ash Berlin, Ruediger Sonderfeld
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.
#
Include(CheckFunctionExists)
include(CheckCXXSourceCompiles)
if(ICONV_INCLUDE_DIR)
set(ICONV_FIND_QUIETLY TRUE)
endif()
find_path(ICONV_INCLUDE_DIR iconv.h)
if(NOT ICONV_INCLUDE_DIR STREQUAL "ICONV_INCLUDE_DIR-NOTFOUND")
set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
check_function_exists(iconv_open ICONV_IN_GLIBC)
endif()
if(NOT ICONV_IN_GLIBC)
find_library(ICONV_LIBRARY NAMES iconv)
set(ICONV_TEST ${ICONV_LIBRARY})
else()
set(ICONV_TEST "In glibc")
endif()
set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARY})
check_cxx_source_compiles(
"#include <iconv.h>
int main() {
iconv(iconv_t(-1), 0, 0, 0, 0);
}"
ICONV_COMPILES)
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(ICONV DEFAULT_MSG ICONV_TEST ICONV_INCLUDE_DIR ICONV_COMPILES)
if(ICONV_FOUND)
set(ICONV_LIBRARIES ${ICONV_LIBRARY})
else(ICONV_FOUND)
set(ICONV_LIBRARIES)
endif(ICONV_FOUND)
if(ICONV_FOUND)
set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES})
check_cxx_source_compiles(
"#include <iconv.h>
int main() {
char *p = 0;
iconv(iconv_t(-1), &p, 0, 0, 0);
}"
ICONV_ACCEPTS_NONCONST_INPUT)
set(CMAKE_REQUIRED_INCLUDES ${ICONV_INCLUDE_DIR})
set(CMAKE_REQUIRED_LIBRARIES ${ICONV_LIBRARIES})
check_cxx_source_compiles(
"#include <iconv.h>
int main() {
char const *p = 0;
iconv(iconv_t(-1), &p, 0, 0, 0);
}"
ICONV_ACCEPTS_CONST_INPUT)
endif()
mark_as_advanced(ICONV_LIBRARY ICONV_INCLUDE_DIR)

@ -94,6 +94,7 @@ distclean: clean
# This removes almost everything, including the configure script!
maintainer-clean: distclean
rm -f configure
-cd test && $(MAKE) $(MAKECMDGOALS)
config/config.mk:
$(error File config/config.mk does not exist. Did you run ./configure?)

@ -0,0 +1,243 @@
/**/
/* config.h. Generated by cmake from config.h.cmake. */
/* Define to 1 if you have the `alarm' function. */
#cmakedefine EXV_HAVE_ALARM
/* Define to 1 if you have the declaration of `strerror_r', and to 0 if you
don't. */
#cmakedefine EXV_HAVE_DECL_STRERROR_R 1
/* Define to 1 if you have the `gmtime_r' function. */
#cmakedefine EXV_HAVE_GMTIME_R 1
/* Define to 1 if you have the <inttypes.h> header file. */
#cmakedefine EXV_HAVE_INTTYPES_H 1
/* Define to 1 if you have the <libintl.h> header file. */
#cmakedefine EXV_HAVE_LIBINTL_H 1
#ifndef EXV_COMMERCIAL_VERSION
/* Define to 1 to enable translation of Exif.Nikon3.LensData. */
#cmakedefine EXV_HAVE_LENSDATA 1
/* Define to 1 if translation of program messages to the user's
native language is requested. */
#cmakedefine EXV_ENABLE_NLS 1
/* Define to 1 if you have the `iconv' function. */
#cmakedefine EXV_HAVE_ICONV 1
/* Define to 1 to enable conversion of UCS2 encoded Windows tags to UTF-8. */
#cmakedefine EXV_HAVE_PRINTUCS2 1
#endif /* !EXV_COMMERCIAL_VERSION */
/* Define to `const' or to empty, depending on the second argument of `iconv'. */
#define EXV_ICONV_CONST
/* Define to 1 if you have the <libintl.h> header file. */
#cmakedefine EXV_HAVE_LIBINTL_H 1
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */
#cmakedefine EXV_HAVE_MALLOC 1
/* Define to 1 if you have the <malloc.h> header file. */
#cmakedefine EXV_HAVE_MALLOC_H 1
/* Define to 1 if you have the <memory.h> header file. */
#cmakedefine EXV_HAVE_MEMORY_H 1
/* Define to 1 if you have the `memset' function. */
#cmakedefine EXV_HAVE_MEMSET 1
/* Define to 1 if your system has a GNU libc compatible `realloc' function,
and to 0 otherwise. */
#cmakedefine EXV_HAVE_REALLOC 1
/* Define to 1 if stdbool.h conforms to C99. */
#cmakedefine EXV_HAVE_STDBOOL_H 1
/* Define to 1 if you have the <stdint.h> header file. */
#cmakedefine EXV_HAVE_STDINT_H 1
/* Define to 1 if you have the <stdlib.h> header file. */
#cmakedefine EXV_HAVE_STDLIB_H 1
/* Define to 1 if you have the `strchr' function. */
#cmakedefine EXV_HAVE_STRCHR 1
/* Define to 1 if you have the `strerror' function. */
#cmakedefine EXV_HAVE_STRERROR 1
/* Define to 1 if you have the `strerror_r' function. */
#cmakedefine EXV_HAVE_STRERROR_R 1
/* Define to 1 if you have the <strings.h> header file. */
#cmakedefine EXV_HAVE_STRINGS_H 1
/* Define to 1 if you have the <string.h> header file. */
#cmakedefine EXV_HAVE_STRING_H 1
/* Define to 1 if you have the `strtol' function. */
#cmakedefine EXV_HAVE_STRTOL 1
/* Define to 1 if you have the `mmap' function. */
#cmakedefine EXV_HAVE_MMAP 1
/* Define to 1 if you have the `munmap' function. */
#cmakedefine EXV_HAVE_MUNMAP 1
/* Define to 1 if you have the <sys/stat.h> header file. */
#cmakedefine EXV_HAVE_SYS_STAT_H 1
/* Define to 1 if you have the <sys/time.h> header file. */
#cmakedefine EXV_HAVE_SYS_TIME_H 1
/* Define to 1 if you have the <sys/types.h> header file. */
#cmakedefine EXV_HAVE_SYS_TYPES_H 1
/* Define to 1 if you have the `timegm' function. */
#cmakedefine EXV_HAVE_TIMEGM 1
/* Define to 1 if you have the <unistd.h> header file. */
#cmakedefine EXV_HAVE_UNISTD_H 1
/* Define to 1 if you have the `vprintf' function. */
#cmakedefine EXV_HAVE_VPRINTF 1
/* Define to 1 if you have the <wchar.h> header file. */
#cmakedefine EXV_HAVE_WCHAR_H 1
/* Define to 1 if you have the <sys/mman.h> header file. */
#cmakedefine EXV_HAVE_SYS_MMAN_H 1
/* Define to 1 if you have the `zlib' library. */
#cmakedefine EXV_HAVE_LIBZ 1
/* Define to 1 if you have the <process.h> header file. */
#cmakedefine EXV_HAVE_PROCESS_H 1
/* Define to 1 if you have the Adobe XMP Toolkit. */
#cmakedefine EXV_HAVE_XMP_TOOLKIT 1
/* Define to 1 if the system has the type `_Bool'. */
#cmakedefine EXV_HAVE__BOOL 1
/* Define to 1 if `lstat' dereferences a symlink specified with a trailing
slash. */
#cmakedefine EXV_LSTAT_FOLLOWS_SLASHED_SYMLINK 1
/* Define to the address where bug reports for this package should be sent. */
#cmakedefine EXV_PACKAGE_BUGREPORT "@PACKAGE_BUGREPORT@"
/* Define to the name of this package. */
#cmakedefine EXV_PACKAGE "@PACKAGE@"
/* Define to the full name of this package. */
#cmakedefine EXV_PACKAGE_NAME "@PACKAGE_NAME@"
/* Define to the full name and version of this package. */
#cmakedefine EXV_PACKAGE_STRING "@PACKAGE_STRING@"
/* Define to the one symbol short name of this package. */
#cmakedefine EXV_PACKAGE_TARNAME "@PACKAGE_TARNAME@"
/* Define to the version of this package. */
#cmakedefine EXV_PACKAGE_VERSION "@PACKAGE_VERSION@"
/* Define to 1 if you have the ANSI C header files. */
#cmakedefine STDC_HEADERS 1
/* Define to 1 if strerror_r returns char *. */
#cmakedefine STRERROR_R_CHAR_P 1
/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
#define TIME_WITH_SYS_TIME 1
/* Define to 1 if your <sys/time.h> declares `struct tm'. */
#cmakedefine TM_IN_SYS_TIME 1
/* Define to empty if `const' does not conform to ANSI C. */
#cmakedefine const
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
#cmakedefine inline
#endif
/* Define to rpl_malloc if the replacement function should be used. */
#cmakedefine malloc
/* Define to `int' if <sys/types.h> does not define. */
#cmakedefine HAVE_PID_T 1
/* On Microsoft compilers pid_t has to be set to int. */
#ifndef HAVE_PID_T
typedef int pid_t;
#endif
/* Define to rpl_realloc if the replacement function should be used. */
#cmakedefine realloc
/* Define to `unsigned' if <sys/types.h> does not define. */
#cmakedefine size_t
#if defined __CYGWIN32__ && !defined __CYGWIN__
/* For backwards compatibility with Cygwin b19 and
earlier, we define __CYGWIN__ here, so that
we can rely on checking just for that macro. */
#define __CYGWIN__ __CYGWIN32__
#endif
/* File path seperator */
#if defined WIN32 && !defined __CYGWIN__
#define EXV_SEPERATOR_STR "\\"
#define EXV_SEPERATOR_CHR '\\'
#else
#define EXV_SEPERATOR_STR "/"
#define EXV_SEPERATOR_CHR '/'
#endif
/* Shared library support, see http://gcc.gnu.org/wiki/Visibility */
#ifdef WIN32
# define EXV_IMPORT __declspec(dllimport)
# define EXV_EXPORT __declspec(dllexport)
# define EXV_DLLLOCAL
# define EXV_DLLPUBLIC
#else
# ifdef EXV_HAVE_GXXCLASSVISIBILITY
# define EXV_IMPORT __attribute__ ((visibility("default")))
# define EXV_EXPORT __attribute__ ((visibility("default")))
# define EXV_DLLLOCAL __attribute__ ((visibility("hidden")))
# define EXV_DLLPUBLIC __attribute__ ((visibility("default")))
# else
# define EXV_IMPORT
# define EXV_EXPORT
# define EXV_DLLLOCAL
# define EXV_DLLPUBLIC
# endif /* ! EXV_HAVE_GXXCLASSVISIBILITY */
#endif /* ! WIN32 */
/* Define EXIV2API for DLL builds */
#ifdef EXV_HAVE_DLL
# ifdef EXV_BUILDING_LIB
# define EXIV2API EXV_EXPORT
# else
# define EXIV2API EXV_IMPORT
# endif /* ! EXV_BUILDING_LIB */
#else
# define EXIV2API
#endif /* ! EXV_HAVE_DLL */
/*
Visual Studio C++ 2005 (8.0)
Disable warnings about 'deprecated' standard functions
See, eg. http://www.informit.com/guides/content.asp?g=cplusplus&seqNum=259
*/
#if _MSC_VER >= 1400
# pragma warning(disable : 4996 4251)
#endif

@ -202,6 +202,11 @@
#define SEPERATOR_CHR '/'
#endif
/* Windows unicode path support */
#if defined WIN32 && !defined __CYGWIN__
# define EXV_UNICODE_PATH
#endif
/* Shared library support, see http://gcc.gnu.org/wiki/Visibility */
#ifdef WIN32
# define EXV_IMPORT __declspec(dllimport)

@ -264,6 +264,8 @@ case "$USE_PRINTUCS2" in
yes) echo "-- Conversion of Windows XP tags.. YES" ;;
*) echo "-- Conversion of Windows XP tags.. NO"
echo ""
echo "On Windows, NO here means that the Windows system function is used"
echo "to convert some UCS-2 encoded Windows XP tags. On other platforms,"
echo "libiconv is required for the conversion of Windows XP tags."
echo "Make sure that the libiconv header files are installed and use"
echo "--with-libiconv-prefix=DIR if it is in a non-standard location."

@ -0,0 +1,10 @@
prefix=@CMAKE_INSTALL_PREFIX@
exec_prefix=${prefix}
libdir=${prefix}/lib
includedir=${prefix}/include
Name: exiv2
Description: Exif and IPTC metadata library and tools
Version: @PACKAGE_VERSION@
Libs: -L${libdir} -lexiv2 @EXV_LIB_STATIC@
Cflags: -I${includedir}

@ -0,0 +1,5 @@
/*
This file redirects to the configuration header file generated by cmake.
*/
#include "exv_conf.h"

@ -74,7 +74,7 @@ How to build and test exiv2 (with/without organize.exe)
This will build all the necessary libraries and all the test programs.
At the end of building, you should see the beautiful output:
========== Build: 92 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Build: 104 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
The build takes 6 minutes on my iMac with a 2.8GHz Duo Core Intel Processor
and 4GBytes of Ram. (VS 2005 and VS 2008)
@ -89,7 +89,7 @@ How to build and test exiv2 (with/without organize.exe)
+--------------------------------------------+
The total build consumes 1.0GBytes of disk space.
There are 100 targets (4 expats, 4 zlibs and 92 exiv2 targets)
There are 112 targets (4 expats, 4 zlibs and 108 exiv2 targets)
The pdb (debugging) files consume 300MB.
The debug exiv2 static library alone (exiv2.lib) is 35MB
@ -112,7 +112,7 @@ How to build and test exiv2 (with/without organize.exe)
C:\gnu\exiv2\msvc>diff.exe runner.txt new.txt
--- no differences should be reported --
The test takes less than 1 minute and runs 200 different test programs.
The test takes less than 1 minute and runs 200+ different test programs.
How to build exiv2+organize
---------------------------
@ -235,7 +235,7 @@ OR (if you prefer to build from source)
This time when you should see:
========== Build: 96 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
========== Build: 108 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========
Congratulations.

@ -0,0 +1,399 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="convert-test"
ProjectGUID="{2F4235D0-B5F5-4C59-981D-BA006734B56E}"
RootNamespace="convert-test"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include;../include/exiv2;../../xmpsdk/include;../../xmpsdk/src;../../../expat-2.0.1/lib;../../../zlib-1.2.3;"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
BufferSecurityCheck="true"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
BrowseInformation="1"
WarningLevel="3"
WarnAsError="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkLibraryDependencies="true"
AdditionalOptions="/NODEFAULTLIB:MSVCRTD"
AdditionalDependencies="..\exiv2lib\$(ConfigurationName)\exiv2.lib ..\..\..\expat-2.0.1\win32\bin\debug\libexpatMT.lib ..\xmpsdk\$(ConfigurationName)\xmpsdk.lib ..\..\..\zlib-1.2.3\projects\visualc6\Win32_LIB_Debug\zlibd.lib"
OutputFile="$(OutDir)/convert-test.exe"
LinkIncremental="1"
AdditionalLibraryDirectories=""
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/convert-test.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="copy target to bin"
CommandLine="copy/y &quot;$(TargetPath)&quot; &quot;$(SolutionDir)\bin\$(ConfigurationName)&quot;"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include;../include/exiv2;../../xmpsdk/include;../../xmpsdk/src;../../../expat-2.0.1/lib;../../../zlib-1.2.3;"
PreprocessorDefinitions="WIN32;_NDEBUG;_CONSOLE"
RuntimeLibrary="0"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
BrowseInformation="1"
WarningLevel="3"
WarnAsError="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkLibraryDependencies="true"
AdditionalOptions="/NODEFAULTLIB:MSVCRT"
AdditionalDependencies="..\exiv2lib\$(ConfigurationName)\exiv2.lib ..\..\..\expat-2.0.1\win32\bin\release\libexpatMT.lib ..\xmpsdk\$(ConfigurationName)\xmpsdk.lib ..\..\..\zlib-1.2.3\projects\visualc6\Win32_LIB_Release\zlib.lib"
LinkIncremental="1"
GenerateDebugInformation="false"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="copy target to bin"
CommandLine="copy/y &quot;$(TargetPath)&quot; &quot;$(SolutionDir)\bin\$(ConfigurationName)&quot;"
/>
</Configuration>
<Configuration
Name="DebugDLL|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
Description="copy expat dll"
CommandLine="copy/y ..\..\..\expat-2.0.1\win32\bin\debug\*.dll &quot;$(TargetDir)&quot;"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include;../include/exiv2;../../xmpsdk/include;../../xmpsdk/src;../../../expat-2.0.1/lib;../../../zlib-1.2.3;"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;EXV_HAVE_DLL"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
BufferSecurityCheck="true"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
BrowseInformation="1"
WarningLevel="3"
WarnAsError="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
Description="copy the dlls"
CommandLine="copy/y ..\exiv2lib\$(ConfigurationName)\*.dll &quot;$(TargetDir)&quot;"
/>
<Tool
Name="VCLinkerTool"
LinkLibraryDependencies="true"
AdditionalOptions="/NODEFAULTLIB:LIBCMTD"
AdditionalDependencies="..\exiv2lib\$(ConfigurationName)\exiv2.lib ..\..\..\expat-2.0.1\win32\bin\release\libexpat.lib ..\xmpsdk\$(ConfigurationName)\xmpsdk.lib ..\..\..\zlib-1.2.3\projects\visualc6\Win32_DLL_Debug\zlib1d.lib"
OutputFile="$(OutDir)/convert-test.exe"
LinkIncremental="1"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/convert-test.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="copy target to bin"
CommandLine="copy/y &quot;$(TargetPath)&quot; &quot;$(SolutionDir)\bin\$(ConfigurationName)&quot;"
/>
</Configuration>
<Configuration
Name="ReleaseDLL|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
Description="copy expat dll"
CommandLine="copy/y ..\..\..\expat-2.0.1\win32\bin\release\*.dll &quot;$(TargetDir)&quot;"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include;../include/exiv2;../../xmpsdk/include;../../xmpsdk/src;../../../expat-2.0.1/lib;../../../zlib-1.2.3;"
PreprocessorDefinitions="WIN32;_NDEBUG;_CONSOLE;EXV_HAVE_DLL"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="2"
BufferSecurityCheck="true"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
BrowseInformation="1"
WarningLevel="3"
WarnAsError="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
Description="copy the dlls"
CommandLine="copy/y ..\exiv2lib\$(ConfigurationName)\*.dll &quot;$(TargetDir)&quot;"
/>
<Tool
Name="VCLinkerTool"
LinkLibraryDependencies="true"
AdditionalOptions="/NODEFAULTLIB:LIBCMT"
AdditionalDependencies="..\exiv2lib\$(ConfigurationName)\exiv2.lib ..\..\..\expat-2.0.1\win32\bin\debug\libexpat.lib ..\xmpsdk\$(ConfigurationName)\xmpsdk.lib ..\..\..\zlib-1.2.3\projects\visualc6\Win32_DLL_Release\zlib1.lib"
OutputFile="$(OutDir)/convert-test.exe"
LinkIncremental="1"
GenerateDebugInformation="false"
ProgramDatabaseFile="$(OutDir)/convert-test.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="copy target to bin"
CommandLine="copy/y &quot;$(TargetPath)&quot; &quot;$(SolutionDir)\bin\$(ConfigurationName)&quot;"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\samples\convert-test.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

@ -1,5 +1,4 @@
Microsoft Visual Studio Solution File, Format Version 8.00
# Visual Studio 2003
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "exifprint", "exifprint\exifprint.vcproj", "{8391174F-52D5-4111-A0FE-E87135301CFB}"
ProjectSection(ProjectDependencies) = postProject
{831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D}
@ -86,6 +85,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "largeiptc-test", "largeiptc
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xmpsdk", "xmpsdk\xmpsdk.vcproj", "{09877CF4-83B6-44FE-A2E2-629AA5C8093E}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xmpsample", "xmpsample\xmpsample.vcproj", "{948E8E86-7F47-46B0-95B2-ED24805F3C9F}"
ProjectSection(ProjectDependencies) = postProject
@ -120,7 +121,244 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "organize", "organize\organi
{831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mmap-test", "mmap-test\mmap-test.vcproj", "{2F4235D0-B5F5-4C59-981D-BA006734B56E}"
ProjectSection(ProjectDependencies) = postProject
{831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "convert-test", "convert-test\convert-test.vcproj", "{2F4235D0-B5F5-4C59-981D-BA006734B56E}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
ProjectSection(ProjectDependencies) = postProject
{831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tiff-test", "tiff-test\tiff-test.vcproj", "{2F4235D0-B5F5-4C59-981D-BA006734B56E}"
ProjectSection(ProjectDependencies) = postProject
{831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
DebugDLL = DebugDLL
Release = Release
ReleaseDLL = ReleaseDLL
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{8391174F-52D5-4111-A0FE-E87135301CFB}.Debug.ActiveCfg = Debug|Win32
{8391174F-52D5-4111-A0FE-E87135301CFB}.Debug.Build.0 = Debug|Win32
{8391174F-52D5-4111-A0FE-E87135301CFB}.DebugDLL.ActiveCfg = DebugDLL|Win32
{8391174F-52D5-4111-A0FE-E87135301CFB}.DebugDLL.Build.0 = DebugDLL|Win32
{8391174F-52D5-4111-A0FE-E87135301CFB}.Release.ActiveCfg = Release|Win32
{8391174F-52D5-4111-A0FE-E87135301CFB}.Release.Build.0 = Release|Win32
{8391174F-52D5-4111-A0FE-E87135301CFB}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{8391174F-52D5-4111-A0FE-E87135301CFB}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{831EF580-92C8-4CA8-B0CE-3D906280A54D}.Debug.ActiveCfg = Debug|Win32
{831EF580-92C8-4CA8-B0CE-3D906280A54D}.Debug.Build.0 = Debug|Win32
{831EF580-92C8-4CA8-B0CE-3D906280A54D}.DebugDLL.ActiveCfg = DebugDLL|Win32
{831EF580-92C8-4CA8-B0CE-3D906280A54D}.DebugDLL.Build.0 = DebugDLL|Win32
{831EF580-92C8-4CA8-B0CE-3D906280A54D}.Release.ActiveCfg = Release|Win32
{831EF580-92C8-4CA8-B0CE-3D906280A54D}.Release.Build.0 = Release|Win32
{831EF580-92C8-4CA8-B0CE-3D906280A54D}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{831EF580-92C8-4CA8-B0CE-3D906280A54D}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{07293CAC-00DA-493E-90C9-5D010C2B1B53}.Debug.ActiveCfg = Debug|Win32
{07293CAC-00DA-493E-90C9-5D010C2B1B53}.Debug.Build.0 = Debug|Win32
{07293CAC-00DA-493E-90C9-5D010C2B1B53}.DebugDLL.ActiveCfg = DebugDLL|Win32
{07293CAC-00DA-493E-90C9-5D010C2B1B53}.DebugDLL.Build.0 = DebugDLL|Win32
{07293CAC-00DA-493E-90C9-5D010C2B1B53}.Release.ActiveCfg = Release|Win32
{07293CAC-00DA-493E-90C9-5D010C2B1B53}.Release.Build.0 = Release|Win32
{07293CAC-00DA-493E-90C9-5D010C2B1B53}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{07293CAC-00DA-493E-90C9-5D010C2B1B53}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{0BDCE87F-A5FE-49AE-BE6D-A2A3E2BB69CE}.Debug.ActiveCfg = Debug|Win32
{0BDCE87F-A5FE-49AE-BE6D-A2A3E2BB69CE}.Debug.Build.0 = Debug|Win32
{0BDCE87F-A5FE-49AE-BE6D-A2A3E2BB69CE}.DebugDLL.ActiveCfg = DebugDLL|Win32
{0BDCE87F-A5FE-49AE-BE6D-A2A3E2BB69CE}.DebugDLL.Build.0 = DebugDLL|Win32
{0BDCE87F-A5FE-49AE-BE6D-A2A3E2BB69CE}.Release.ActiveCfg = Release|Win32
{0BDCE87F-A5FE-49AE-BE6D-A2A3E2BB69CE}.Release.Build.0 = Release|Win32
{0BDCE87F-A5FE-49AE-BE6D-A2A3E2BB69CE}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{0BDCE87F-A5FE-49AE-BE6D-A2A3E2BB69CE}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{271E59C4-81F9-4231-85D3-E7DDB2E2BC08}.Debug.ActiveCfg = Debug|Win32
{271E59C4-81F9-4231-85D3-E7DDB2E2BC08}.Debug.Build.0 = Debug|Win32
{271E59C4-81F9-4231-85D3-E7DDB2E2BC08}.DebugDLL.ActiveCfg = DebugDLL|Win32
{271E59C4-81F9-4231-85D3-E7DDB2E2BC08}.DebugDLL.Build.0 = DebugDLL|Win32
{271E59C4-81F9-4231-85D3-E7DDB2E2BC08}.Release.ActiveCfg = Release|Win32
{271E59C4-81F9-4231-85D3-E7DDB2E2BC08}.Release.Build.0 = Release|Win32
{271E59C4-81F9-4231-85D3-E7DDB2E2BC08}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{271E59C4-81F9-4231-85D3-E7DDB2E2BC08}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{2CDD0F47-E4B8-4C48-AD56-64C0A67EC89B}.Debug.ActiveCfg = Debug|Win32
{2CDD0F47-E4B8-4C48-AD56-64C0A67EC89B}.Debug.Build.0 = Debug|Win32
{2CDD0F47-E4B8-4C48-AD56-64C0A67EC89B}.DebugDLL.ActiveCfg = DebugDLL|Win32
{2CDD0F47-E4B8-4C48-AD56-64C0A67EC89B}.DebugDLL.Build.0 = DebugDLL|Win32
{2CDD0F47-E4B8-4C48-AD56-64C0A67EC89B}.Release.ActiveCfg = Release|Win32
{2CDD0F47-E4B8-4C48-AD56-64C0A67EC89B}.Release.Build.0 = Release|Win32
{2CDD0F47-E4B8-4C48-AD56-64C0A67EC89B}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{2CDD0F47-E4B8-4C48-AD56-64C0A67EC89B}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{7E0025E8-CFBE-4941-BEB7-825F14A87EE1}.Debug.ActiveCfg = Debug|Win32
{7E0025E8-CFBE-4941-BEB7-825F14A87EE1}.Debug.Build.0 = Debug|Win32
{7E0025E8-CFBE-4941-BEB7-825F14A87EE1}.DebugDLL.ActiveCfg = DebugDLL|Win32
{7E0025E8-CFBE-4941-BEB7-825F14A87EE1}.DebugDLL.Build.0 = DebugDLL|Win32
{7E0025E8-CFBE-4941-BEB7-825F14A87EE1}.Release.ActiveCfg = Release|Win32
{7E0025E8-CFBE-4941-BEB7-825F14A87EE1}.Release.Build.0 = Release|Win32
{7E0025E8-CFBE-4941-BEB7-825F14A87EE1}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{7E0025E8-CFBE-4941-BEB7-825F14A87EE1}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{F59D0AD2-6948-474B-B506-AD14EC9BE551}.Debug.ActiveCfg = Debug|Win32
{F59D0AD2-6948-474B-B506-AD14EC9BE551}.Debug.Build.0 = Debug|Win32
{F59D0AD2-6948-474B-B506-AD14EC9BE551}.DebugDLL.ActiveCfg = DebugDLL|Win32
{F59D0AD2-6948-474B-B506-AD14EC9BE551}.DebugDLL.Build.0 = DebugDLL|Win32
{F59D0AD2-6948-474B-B506-AD14EC9BE551}.Release.ActiveCfg = Release|Win32
{F59D0AD2-6948-474B-B506-AD14EC9BE551}.Release.Build.0 = Release|Win32
{F59D0AD2-6948-474B-B506-AD14EC9BE551}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{F59D0AD2-6948-474B-B506-AD14EC9BE551}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{52034F65-28AA-4E3F-A44D-C91F6F0922F8}.Debug.ActiveCfg = Debug|Win32
{52034F65-28AA-4E3F-A44D-C91F6F0922F8}.Debug.Build.0 = Debug|Win32
{52034F65-28AA-4E3F-A44D-C91F6F0922F8}.DebugDLL.ActiveCfg = DebugDLL|Win32
{52034F65-28AA-4E3F-A44D-C91F6F0922F8}.DebugDLL.Build.0 = DebugDLL|Win32
{52034F65-28AA-4E3F-A44D-C91F6F0922F8}.Release.ActiveCfg = Release|Win32
{52034F65-28AA-4E3F-A44D-C91F6F0922F8}.Release.Build.0 = Release|Win32
{52034F65-28AA-4E3F-A44D-C91F6F0922F8}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{52034F65-28AA-4E3F-A44D-C91F6F0922F8}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{C8F41CDA-76AA-4053-A8DE-F80892C1C2FC}.Debug.ActiveCfg = Debug|Win32
{C8F41CDA-76AA-4053-A8DE-F80892C1C2FC}.Debug.Build.0 = Debug|Win32
{C8F41CDA-76AA-4053-A8DE-F80892C1C2FC}.DebugDLL.ActiveCfg = DebugDLL|Win32
{C8F41CDA-76AA-4053-A8DE-F80892C1C2FC}.DebugDLL.Build.0 = DebugDLL|Win32
{C8F41CDA-76AA-4053-A8DE-F80892C1C2FC}.Release.ActiveCfg = Release|Win32
{C8F41CDA-76AA-4053-A8DE-F80892C1C2FC}.Release.Build.0 = Release|Win32
{C8F41CDA-76AA-4053-A8DE-F80892C1C2FC}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{C8F41CDA-76AA-4053-A8DE-F80892C1C2FC}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{EB7F30DE-DD77-4311-BB66-FFDF972052C7}.Debug.ActiveCfg = Debug|Win32
{EB7F30DE-DD77-4311-BB66-FFDF972052C7}.Debug.Build.0 = Debug|Win32
{EB7F30DE-DD77-4311-BB66-FFDF972052C7}.DebugDLL.ActiveCfg = DebugDLL|Win32
{EB7F30DE-DD77-4311-BB66-FFDF972052C7}.DebugDLL.Build.0 = DebugDLL|Win32
{EB7F30DE-DD77-4311-BB66-FFDF972052C7}.Release.ActiveCfg = Release|Win32
{EB7F30DE-DD77-4311-BB66-FFDF972052C7}.Release.Build.0 = Release|Win32
{EB7F30DE-DD77-4311-BB66-FFDF972052C7}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{EB7F30DE-DD77-4311-BB66-FFDF972052C7}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{BBDB5742-0A55-4C2C-973C-E876AAED6ABE}.Debug.ActiveCfg = Debug|Win32
{BBDB5742-0A55-4C2C-973C-E876AAED6ABE}.Debug.Build.0 = Debug|Win32
{BBDB5742-0A55-4C2C-973C-E876AAED6ABE}.DebugDLL.ActiveCfg = DebugDLL|Win32
{BBDB5742-0A55-4C2C-973C-E876AAED6ABE}.DebugDLL.Build.0 = DebugDLL|Win32
{BBDB5742-0A55-4C2C-973C-E876AAED6ABE}.Release.ActiveCfg = Release|Win32
{BBDB5742-0A55-4C2C-973C-E876AAED6ABE}.Release.Build.0 = Release|Win32
{BBDB5742-0A55-4C2C-973C-E876AAED6ABE}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{BBDB5742-0A55-4C2C-973C-E876AAED6ABE}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{94A7505B-3A53-40F0-95A2-2ECB1CEC7C57}.Debug.ActiveCfg = Debug|Win32
{94A7505B-3A53-40F0-95A2-2ECB1CEC7C57}.Debug.Build.0 = Debug|Win32
{94A7505B-3A53-40F0-95A2-2ECB1CEC7C57}.DebugDLL.ActiveCfg = DebugDLL|Win32
{94A7505B-3A53-40F0-95A2-2ECB1CEC7C57}.DebugDLL.Build.0 = DebugDLL|Win32
{94A7505B-3A53-40F0-95A2-2ECB1CEC7C57}.Release.ActiveCfg = Release|Win32
{94A7505B-3A53-40F0-95A2-2ECB1CEC7C57}.Release.Build.0 = Release|Win32
{94A7505B-3A53-40F0-95A2-2ECB1CEC7C57}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{94A7505B-3A53-40F0-95A2-2ECB1CEC7C57}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{5D43ECB3-681D-4732-9395-AB81CD283F6C}.Debug.ActiveCfg = Debug|Win32
{5D43ECB3-681D-4732-9395-AB81CD283F6C}.Debug.Build.0 = Debug|Win32
{5D43ECB3-681D-4732-9395-AB81CD283F6C}.DebugDLL.ActiveCfg = DebugDLL|Win32
{5D43ECB3-681D-4732-9395-AB81CD283F6C}.DebugDLL.Build.0 = DebugDLL|Win32
{5D43ECB3-681D-4732-9395-AB81CD283F6C}.Release.ActiveCfg = Release|Win32
{5D43ECB3-681D-4732-9395-AB81CD283F6C}.Release.Build.0 = Release|Win32
{5D43ECB3-681D-4732-9395-AB81CD283F6C}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{5D43ECB3-681D-4732-9395-AB81CD283F6C}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{D8B36F3A-34BB-4540-A731-EEABF1DC2E05}.Debug.ActiveCfg = Debug|Win32
{D8B36F3A-34BB-4540-A731-EEABF1DC2E05}.Debug.Build.0 = Debug|Win32
{D8B36F3A-34BB-4540-A731-EEABF1DC2E05}.DebugDLL.ActiveCfg = DebugDLL|Win32
{D8B36F3A-34BB-4540-A731-EEABF1DC2E05}.DebugDLL.Build.0 = DebugDLL|Win32
{D8B36F3A-34BB-4540-A731-EEABF1DC2E05}.Release.ActiveCfg = Release|Win32
{D8B36F3A-34BB-4540-A731-EEABF1DC2E05}.Release.Build.0 = Release|Win32
{D8B36F3A-34BB-4540-A731-EEABF1DC2E05}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{D8B36F3A-34BB-4540-A731-EEABF1DC2E05}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{36F0C797-F6BD-4F5C-8DB2-651D8502872D}.Debug.ActiveCfg = Debug|Win32
{36F0C797-F6BD-4F5C-8DB2-651D8502872D}.Debug.Build.0 = Debug|Win32
{36F0C797-F6BD-4F5C-8DB2-651D8502872D}.DebugDLL.ActiveCfg = DebugDLL|Win32
{36F0C797-F6BD-4F5C-8DB2-651D8502872D}.DebugDLL.Build.0 = DebugDLL|Win32
{36F0C797-F6BD-4F5C-8DB2-651D8502872D}.Release.ActiveCfg = Release|Win32
{36F0C797-F6BD-4F5C-8DB2-651D8502872D}.Release.Build.0 = Release|Win32
{36F0C797-F6BD-4F5C-8DB2-651D8502872D}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{36F0C797-F6BD-4F5C-8DB2-651D8502872D}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{408EB518-B855-404E-9BDC-B58F60DFA9B2}.Debug.ActiveCfg = Debug|Win32
{408EB518-B855-404E-9BDC-B58F60DFA9B2}.Debug.Build.0 = Debug|Win32
{408EB518-B855-404E-9BDC-B58F60DFA9B2}.DebugDLL.ActiveCfg = DebugDLL|Win32
{408EB518-B855-404E-9BDC-B58F60DFA9B2}.DebugDLL.Build.0 = DebugDLL|Win32
{408EB518-B855-404E-9BDC-B58F60DFA9B2}.Release.ActiveCfg = Release|Win32
{408EB518-B855-404E-9BDC-B58F60DFA9B2}.Release.Build.0 = Release|Win32
{408EB518-B855-404E-9BDC-B58F60DFA9B2}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{408EB518-B855-404E-9BDC-B58F60DFA9B2}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{09877CF4-83B6-44FE-A2E2-629AA5C8093E}.Debug.ActiveCfg = Debug|Win32
{09877CF4-83B6-44FE-A2E2-629AA5C8093E}.Debug.Build.0 = Debug|Win32
{09877CF4-83B6-44FE-A2E2-629AA5C8093E}.DebugDLL.ActiveCfg = DebugDLL|Win32
{09877CF4-83B6-44FE-A2E2-629AA5C8093E}.DebugDLL.Build.0 = DebugDLL|Win32
{09877CF4-83B6-44FE-A2E2-629AA5C8093E}.Release.ActiveCfg = Release|Win32
{09877CF4-83B6-44FE-A2E2-629AA5C8093E}.Release.Build.0 = Release|Win32
{09877CF4-83B6-44FE-A2E2-629AA5C8093E}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{09877CF4-83B6-44FE-A2E2-629AA5C8093E}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3C9F}.Debug.ActiveCfg = Debug|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3C9F}.Debug.Build.0 = Debug|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3C9F}.DebugDLL.ActiveCfg = DebugDLL|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3C9F}.DebugDLL.Build.0 = DebugDLL|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3C9F}.Release.ActiveCfg = Release|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3C9F}.Release.Build.0 = Release|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3C9F}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3C9F}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CAF}.Debug.ActiveCfg = Debug|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CAF}.Debug.Build.0 = Debug|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CAF}.DebugDLL.ActiveCfg = DebugDLL|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CAF}.DebugDLL.Build.0 = DebugDLL|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CAF}.Release.ActiveCfg = Release|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CAF}.Release.Build.0 = Release|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CAF}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CAF}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CBF}.Debug.ActiveCfg = Debug|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CBF}.Debug.Build.0 = Debug|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CBF}.DebugDLL.ActiveCfg = DebugDLL|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CBF}.DebugDLL.Build.0 = DebugDLL|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CBF}.Release.ActiveCfg = Release|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CBF}.Release.Build.0 = Release|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CBF}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CBF}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{156423D3-5FBB-45C6-A7CA-675B32F45C15}.Debug.ActiveCfg = Debug|Win32
{156423D3-5FBB-45C6-A7CA-675B32F45C15}.Debug.Build.0 = Debug|Win32
{156423D3-5FBB-45C6-A7CA-675B32F45C15}.DebugDLL.ActiveCfg = DebugDLL|Win32
{156423D3-5FBB-45C6-A7CA-675B32F45C15}.DebugDLL.Build.0 = DebugDLL|Win32
{156423D3-5FBB-45C6-A7CA-675B32F45C15}.Release.ActiveCfg = Release|Win32
{156423D3-5FBB-45C6-A7CA-675B32F45C15}.Release.Build.0 = Release|Win32
{156423D3-5FBB-45C6-A7CA-675B32F45C15}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{156423D3-5FBB-45C6-A7CA-675B32F45C15}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{9D2A443C-93D3-4144-B911-D7CA7CD85DE7}.Debug.ActiveCfg = Debug|Win32
{9D2A443C-93D3-4144-B911-D7CA7CD85DE7}.Debug.Build.0 = Debug|Win32
{9D2A443C-93D3-4144-B911-D7CA7CD85DE7}.DebugDLL.ActiveCfg = DebugDLL|Win32
{9D2A443C-93D3-4144-B911-D7CA7CD85DE7}.DebugDLL.Build.0 = DebugDLL|Win32
{9D2A443C-93D3-4144-B911-D7CA7CD85DE7}.Release.ActiveCfg = Release|Win32
{9D2A443C-93D3-4144-B911-D7CA7CD85DE7}.Release.Build.0 = Release|Win32
{9D2A443C-93D3-4144-B911-D7CA7CD85DE7}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{9D2A443C-93D3-4144-B911-D7CA7CD85DE7}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{20B07B93-9177-407B-A111-24A9967183F8}.Debug.ActiveCfg = Debug|Win32
{20B07B93-9177-407B-A111-24A9967183F8}.Debug.Build.0 = Debug|Win32
{20B07B93-9177-407B-A111-24A9967183F8}.DebugDLL.ActiveCfg = DebugDLL|Win32
{20B07B93-9177-407B-A111-24A9967183F8}.DebugDLL.Build.0 = DebugDLL|Win32
{20B07B93-9177-407B-A111-24A9967183F8}.Release.ActiveCfg = Release|Win32
{20B07B93-9177-407B-A111-24A9967183F8}.Release.Build.0 = Release|Win32
{20B07B93-9177-407B-A111-24A9967183F8}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{20B07B93-9177-407B-A111-24A9967183F8}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.Debug.ActiveCfg = Debug|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.Debug.Build.0 = Debug|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.DebugDLL.ActiveCfg = DebugDLL|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.DebugDLL.Build.0 = DebugDLL|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.Release.ActiveCfg = Release|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.Release.Build.0 = Release|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.Debug.ActiveCfg = Debug|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.Debug.Build.0 = Debug|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.DebugDLL.ActiveCfg = DebugDLL|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.DebugDLL.Build.0 = DebugDLL|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.Release.ActiveCfg = Release|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.Release.Build.0 = Release|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
DebugDLL|Win32 = DebugDLL|Win32
@ -320,6 +558,14 @@ Global
{20B07B93-9177-407B-A111-24A9967183F8}.Release|Win32.Build.0 = Release|Win32
{20B07B93-9177-407B-A111-24A9967183F8}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
{20B07B93-9177-407B-A111-24A9967183F8}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.Debug|Win32.ActiveCfg = Debug|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.Debug|Win32.Build.0 = Debug|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.DebugDLL|Win32.Build.0 = DebugDLL|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.Release|Win32.ActiveCfg = Release|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.Release|Win32.Build.0 = Release|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE

@ -1,5 +1,4 @@
Microsoft Visual Studio Solution File, Format Version 8.00
# Visual Studio 2003
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "exifprint", "exifprint\exifprint.vcproj", "{8391174F-52D5-4111-A0FE-E87135301CFB}"
ProjectSection(ProjectDependencies) = postProject
{831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D}
@ -86,6 +85,8 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "largeiptc-test", "largeiptc
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xmpsdk", "xmpsdk\xmpsdk.vcproj", "{09877CF4-83B6-44FE-A2E2-629AA5C8093E}"
ProjectSection(ProjectDependencies) = postProject
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "xmpsample", "xmpsample\xmpsample.vcproj", "{948E8E86-7F47-46B0-95B2-ED24805F3C9F}"
ProjectSection(ProjectDependencies) = postProject
@ -115,7 +116,242 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "prevtest", "prevtest\prevte
{831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mmap-test", "mmap-test\mmap-test.vcproj", "{2F4235D0-B5F5-4C59-981D-BA006734B56E}"
ProjectSection(ProjectDependencies) = postProject
{831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "convert-test", "convert-test\convert-test.vcproj", "{2F4235D0-B5F5-4C59-981D-BA006734B56E}"
ProjectSection(ProjectDependencies) = postProject
{831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D}
EndProjectSection
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "tiff-test", "tiff-test\tiff-test.vcproj", "{2F4235D0-B5F5-4C59-981D-BA006734B56E}"
ProjectSection(ProjectDependencies) = postProject
{831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D}
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfiguration) = preSolution
Debug = Debug
DebugDLL = DebugDLL
Release = Release
ReleaseDLL = ReleaseDLL
EndGlobalSection
GlobalSection(ProjectConfiguration) = postSolution
{8391174F-52D5-4111-A0FE-E87135301CFB}.Debug.ActiveCfg = Debug|Win32
{8391174F-52D5-4111-A0FE-E87135301CFB}.Debug.Build.0 = Debug|Win32
{8391174F-52D5-4111-A0FE-E87135301CFB}.DebugDLL.ActiveCfg = DebugDLL|Win32
{8391174F-52D5-4111-A0FE-E87135301CFB}.DebugDLL.Build.0 = DebugDLL|Win32
{8391174F-52D5-4111-A0FE-E87135301CFB}.Release.ActiveCfg = Release|Win32
{8391174F-52D5-4111-A0FE-E87135301CFB}.Release.Build.0 = Release|Win32
{8391174F-52D5-4111-A0FE-E87135301CFB}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{8391174F-52D5-4111-A0FE-E87135301CFB}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{831EF580-92C8-4CA8-B0CE-3D906280A54D}.Debug.ActiveCfg = Debug|Win32
{831EF580-92C8-4CA8-B0CE-3D906280A54D}.Debug.Build.0 = Debug|Win32
{831EF580-92C8-4CA8-B0CE-3D906280A54D}.DebugDLL.ActiveCfg = DebugDLL|Win32
{831EF580-92C8-4CA8-B0CE-3D906280A54D}.DebugDLL.Build.0 = DebugDLL|Win32
{831EF580-92C8-4CA8-B0CE-3D906280A54D}.Release.ActiveCfg = Release|Win32
{831EF580-92C8-4CA8-B0CE-3D906280A54D}.Release.Build.0 = Release|Win32
{831EF580-92C8-4CA8-B0CE-3D906280A54D}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{831EF580-92C8-4CA8-B0CE-3D906280A54D}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{07293CAC-00DA-493E-90C9-5D010C2B1B53}.Debug.ActiveCfg = Debug|Win32
{07293CAC-00DA-493E-90C9-5D010C2B1B53}.Debug.Build.0 = Debug|Win32
{07293CAC-00DA-493E-90C9-5D010C2B1B53}.DebugDLL.ActiveCfg = DebugDLL|Win32
{07293CAC-00DA-493E-90C9-5D010C2B1B53}.DebugDLL.Build.0 = DebugDLL|Win32
{07293CAC-00DA-493E-90C9-5D010C2B1B53}.Release.ActiveCfg = Release|Win32
{07293CAC-00DA-493E-90C9-5D010C2B1B53}.Release.Build.0 = Release|Win32
{07293CAC-00DA-493E-90C9-5D010C2B1B53}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{07293CAC-00DA-493E-90C9-5D010C2B1B53}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{0BDCE87F-A5FE-49AE-BE6D-A2A3E2BB69CE}.Debug.ActiveCfg = Debug|Win32
{0BDCE87F-A5FE-49AE-BE6D-A2A3E2BB69CE}.Debug.Build.0 = Debug|Win32
{0BDCE87F-A5FE-49AE-BE6D-A2A3E2BB69CE}.DebugDLL.ActiveCfg = DebugDLL|Win32
{0BDCE87F-A5FE-49AE-BE6D-A2A3E2BB69CE}.DebugDLL.Build.0 = DebugDLL|Win32
{0BDCE87F-A5FE-49AE-BE6D-A2A3E2BB69CE}.Release.ActiveCfg = Release|Win32
{0BDCE87F-A5FE-49AE-BE6D-A2A3E2BB69CE}.Release.Build.0 = Release|Win32
{0BDCE87F-A5FE-49AE-BE6D-A2A3E2BB69CE}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{0BDCE87F-A5FE-49AE-BE6D-A2A3E2BB69CE}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{271E59C4-81F9-4231-85D3-E7DDB2E2BC08}.Debug.ActiveCfg = Debug|Win32
{271E59C4-81F9-4231-85D3-E7DDB2E2BC08}.Debug.Build.0 = Debug|Win32
{271E59C4-81F9-4231-85D3-E7DDB2E2BC08}.DebugDLL.ActiveCfg = DebugDLL|Win32
{271E59C4-81F9-4231-85D3-E7DDB2E2BC08}.DebugDLL.Build.0 = DebugDLL|Win32
{271E59C4-81F9-4231-85D3-E7DDB2E2BC08}.Release.ActiveCfg = Release|Win32
{271E59C4-81F9-4231-85D3-E7DDB2E2BC08}.Release.Build.0 = Release|Win32
{271E59C4-81F9-4231-85D3-E7DDB2E2BC08}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{271E59C4-81F9-4231-85D3-E7DDB2E2BC08}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{2CDD0F47-E4B8-4C48-AD56-64C0A67EC89B}.Debug.ActiveCfg = Debug|Win32
{2CDD0F47-E4B8-4C48-AD56-64C0A67EC89B}.Debug.Build.0 = Debug|Win32
{2CDD0F47-E4B8-4C48-AD56-64C0A67EC89B}.DebugDLL.ActiveCfg = DebugDLL|Win32
{2CDD0F47-E4B8-4C48-AD56-64C0A67EC89B}.DebugDLL.Build.0 = DebugDLL|Win32
{2CDD0F47-E4B8-4C48-AD56-64C0A67EC89B}.Release.ActiveCfg = Release|Win32
{2CDD0F47-E4B8-4C48-AD56-64C0A67EC89B}.Release.Build.0 = Release|Win32
{2CDD0F47-E4B8-4C48-AD56-64C0A67EC89B}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{2CDD0F47-E4B8-4C48-AD56-64C0A67EC89B}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{7E0025E8-CFBE-4941-BEB7-825F14A87EE1}.Debug.ActiveCfg = Debug|Win32
{7E0025E8-CFBE-4941-BEB7-825F14A87EE1}.Debug.Build.0 = Debug|Win32
{7E0025E8-CFBE-4941-BEB7-825F14A87EE1}.DebugDLL.ActiveCfg = DebugDLL|Win32
{7E0025E8-CFBE-4941-BEB7-825F14A87EE1}.DebugDLL.Build.0 = DebugDLL|Win32
{7E0025E8-CFBE-4941-BEB7-825F14A87EE1}.Release.ActiveCfg = Release|Win32
{7E0025E8-CFBE-4941-BEB7-825F14A87EE1}.Release.Build.0 = Release|Win32
{7E0025E8-CFBE-4941-BEB7-825F14A87EE1}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{7E0025E8-CFBE-4941-BEB7-825F14A87EE1}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{F59D0AD2-6948-474B-B506-AD14EC9BE551}.Debug.ActiveCfg = Debug|Win32
{F59D0AD2-6948-474B-B506-AD14EC9BE551}.Debug.Build.0 = Debug|Win32
{F59D0AD2-6948-474B-B506-AD14EC9BE551}.DebugDLL.ActiveCfg = DebugDLL|Win32
{F59D0AD2-6948-474B-B506-AD14EC9BE551}.DebugDLL.Build.0 = DebugDLL|Win32
{F59D0AD2-6948-474B-B506-AD14EC9BE551}.Release.ActiveCfg = Release|Win32
{F59D0AD2-6948-474B-B506-AD14EC9BE551}.Release.Build.0 = Release|Win32
{F59D0AD2-6948-474B-B506-AD14EC9BE551}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{F59D0AD2-6948-474B-B506-AD14EC9BE551}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{52034F65-28AA-4E3F-A44D-C91F6F0922F8}.Debug.ActiveCfg = Debug|Win32
{52034F65-28AA-4E3F-A44D-C91F6F0922F8}.Debug.Build.0 = Debug|Win32
{52034F65-28AA-4E3F-A44D-C91F6F0922F8}.DebugDLL.ActiveCfg = DebugDLL|Win32
{52034F65-28AA-4E3F-A44D-C91F6F0922F8}.DebugDLL.Build.0 = DebugDLL|Win32
{52034F65-28AA-4E3F-A44D-C91F6F0922F8}.Release.ActiveCfg = Release|Win32
{52034F65-28AA-4E3F-A44D-C91F6F0922F8}.Release.Build.0 = Release|Win32
{52034F65-28AA-4E3F-A44D-C91F6F0922F8}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{52034F65-28AA-4E3F-A44D-C91F6F0922F8}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{C8F41CDA-76AA-4053-A8DE-F80892C1C2FC}.Debug.ActiveCfg = Debug|Win32
{C8F41CDA-76AA-4053-A8DE-F80892C1C2FC}.Debug.Build.0 = Debug|Win32
{C8F41CDA-76AA-4053-A8DE-F80892C1C2FC}.DebugDLL.ActiveCfg = DebugDLL|Win32
{C8F41CDA-76AA-4053-A8DE-F80892C1C2FC}.DebugDLL.Build.0 = DebugDLL|Win32
{C8F41CDA-76AA-4053-A8DE-F80892C1C2FC}.Release.ActiveCfg = Release|Win32
{C8F41CDA-76AA-4053-A8DE-F80892C1C2FC}.Release.Build.0 = Release|Win32
{C8F41CDA-76AA-4053-A8DE-F80892C1C2FC}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{C8F41CDA-76AA-4053-A8DE-F80892C1C2FC}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{EB7F30DE-DD77-4311-BB66-FFDF972052C7}.Debug.ActiveCfg = Debug|Win32
{EB7F30DE-DD77-4311-BB66-FFDF972052C7}.Debug.Build.0 = Debug|Win32
{EB7F30DE-DD77-4311-BB66-FFDF972052C7}.DebugDLL.ActiveCfg = DebugDLL|Win32
{EB7F30DE-DD77-4311-BB66-FFDF972052C7}.DebugDLL.Build.0 = DebugDLL|Win32
{EB7F30DE-DD77-4311-BB66-FFDF972052C7}.Release.ActiveCfg = Release|Win32
{EB7F30DE-DD77-4311-BB66-FFDF972052C7}.Release.Build.0 = Release|Win32
{EB7F30DE-DD77-4311-BB66-FFDF972052C7}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{EB7F30DE-DD77-4311-BB66-FFDF972052C7}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{BBDB5742-0A55-4C2C-973C-E876AAED6ABE}.Debug.ActiveCfg = Debug|Win32
{BBDB5742-0A55-4C2C-973C-E876AAED6ABE}.Debug.Build.0 = Debug|Win32
{BBDB5742-0A55-4C2C-973C-E876AAED6ABE}.DebugDLL.ActiveCfg = DebugDLL|Win32
{BBDB5742-0A55-4C2C-973C-E876AAED6ABE}.DebugDLL.Build.0 = DebugDLL|Win32
{BBDB5742-0A55-4C2C-973C-E876AAED6ABE}.Release.ActiveCfg = Release|Win32
{BBDB5742-0A55-4C2C-973C-E876AAED6ABE}.Release.Build.0 = Release|Win32
{BBDB5742-0A55-4C2C-973C-E876AAED6ABE}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{BBDB5742-0A55-4C2C-973C-E876AAED6ABE}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{94A7505B-3A53-40F0-95A2-2ECB1CEC7C57}.Debug.ActiveCfg = Debug|Win32
{94A7505B-3A53-40F0-95A2-2ECB1CEC7C57}.Debug.Build.0 = Debug|Win32
{94A7505B-3A53-40F0-95A2-2ECB1CEC7C57}.DebugDLL.ActiveCfg = DebugDLL|Win32
{94A7505B-3A53-40F0-95A2-2ECB1CEC7C57}.DebugDLL.Build.0 = DebugDLL|Win32
{94A7505B-3A53-40F0-95A2-2ECB1CEC7C57}.Release.ActiveCfg = Release|Win32
{94A7505B-3A53-40F0-95A2-2ECB1CEC7C57}.Release.Build.0 = Release|Win32
{94A7505B-3A53-40F0-95A2-2ECB1CEC7C57}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{94A7505B-3A53-40F0-95A2-2ECB1CEC7C57}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{5D43ECB3-681D-4732-9395-AB81CD283F6C}.Debug.ActiveCfg = Debug|Win32
{5D43ECB3-681D-4732-9395-AB81CD283F6C}.Debug.Build.0 = Debug|Win32
{5D43ECB3-681D-4732-9395-AB81CD283F6C}.DebugDLL.ActiveCfg = DebugDLL|Win32
{5D43ECB3-681D-4732-9395-AB81CD283F6C}.DebugDLL.Build.0 = DebugDLL|Win32
{5D43ECB3-681D-4732-9395-AB81CD283F6C}.Release.ActiveCfg = Release|Win32
{5D43ECB3-681D-4732-9395-AB81CD283F6C}.Release.Build.0 = Release|Win32
{5D43ECB3-681D-4732-9395-AB81CD283F6C}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{5D43ECB3-681D-4732-9395-AB81CD283F6C}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{D8B36F3A-34BB-4540-A731-EEABF1DC2E05}.Debug.ActiveCfg = Debug|Win32
{D8B36F3A-34BB-4540-A731-EEABF1DC2E05}.Debug.Build.0 = Debug|Win32
{D8B36F3A-34BB-4540-A731-EEABF1DC2E05}.DebugDLL.ActiveCfg = DebugDLL|Win32
{D8B36F3A-34BB-4540-A731-EEABF1DC2E05}.DebugDLL.Build.0 = DebugDLL|Win32
{D8B36F3A-34BB-4540-A731-EEABF1DC2E05}.Release.ActiveCfg = Release|Win32
{D8B36F3A-34BB-4540-A731-EEABF1DC2E05}.Release.Build.0 = Release|Win32
{D8B36F3A-34BB-4540-A731-EEABF1DC2E05}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{D8B36F3A-34BB-4540-A731-EEABF1DC2E05}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{36F0C797-F6BD-4F5C-8DB2-651D8502872D}.Debug.ActiveCfg = Debug|Win32
{36F0C797-F6BD-4F5C-8DB2-651D8502872D}.Debug.Build.0 = Debug|Win32
{36F0C797-F6BD-4F5C-8DB2-651D8502872D}.DebugDLL.ActiveCfg = DebugDLL|Win32
{36F0C797-F6BD-4F5C-8DB2-651D8502872D}.DebugDLL.Build.0 = DebugDLL|Win32
{36F0C797-F6BD-4F5C-8DB2-651D8502872D}.Release.ActiveCfg = Release|Win32
{36F0C797-F6BD-4F5C-8DB2-651D8502872D}.Release.Build.0 = Release|Win32
{36F0C797-F6BD-4F5C-8DB2-651D8502872D}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{36F0C797-F6BD-4F5C-8DB2-651D8502872D}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{408EB518-B855-404E-9BDC-B58F60DFA9B2}.Debug.ActiveCfg = Debug|Win32
{408EB518-B855-404E-9BDC-B58F60DFA9B2}.Debug.Build.0 = Debug|Win32
{408EB518-B855-404E-9BDC-B58F60DFA9B2}.DebugDLL.ActiveCfg = DebugDLL|Win32
{408EB518-B855-404E-9BDC-B58F60DFA9B2}.DebugDLL.Build.0 = DebugDLL|Win32
{408EB518-B855-404E-9BDC-B58F60DFA9B2}.Release.ActiveCfg = Release|Win32
{408EB518-B855-404E-9BDC-B58F60DFA9B2}.Release.Build.0 = Release|Win32
{408EB518-B855-404E-9BDC-B58F60DFA9B2}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{408EB518-B855-404E-9BDC-B58F60DFA9B2}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{09877CF4-83B6-44FE-A2E2-629AA5C8093E}.Debug.ActiveCfg = Debug|Win32
{09877CF4-83B6-44FE-A2E2-629AA5C8093E}.Debug.Build.0 = Debug|Win32
{09877CF4-83B6-44FE-A2E2-629AA5C8093E}.DebugDLL.ActiveCfg = DebugDLL|Win32
{09877CF4-83B6-44FE-A2E2-629AA5C8093E}.DebugDLL.Build.0 = DebugDLL|Win32
{09877CF4-83B6-44FE-A2E2-629AA5C8093E}.Release.ActiveCfg = Release|Win32
{09877CF4-83B6-44FE-A2E2-629AA5C8093E}.Release.Build.0 = Release|Win32
{09877CF4-83B6-44FE-A2E2-629AA5C8093E}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{09877CF4-83B6-44FE-A2E2-629AA5C8093E}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3C9F}.Debug.ActiveCfg = Debug|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3C9F}.Debug.Build.0 = Debug|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3C9F}.DebugDLL.ActiveCfg = DebugDLL|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3C9F}.DebugDLL.Build.0 = DebugDLL|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3C9F}.Release.ActiveCfg = Release|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3C9F}.Release.Build.0 = Release|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3C9F}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3C9F}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CAF}.Debug.ActiveCfg = Debug|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CAF}.Debug.Build.0 = Debug|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CAF}.DebugDLL.ActiveCfg = DebugDLL|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CAF}.DebugDLL.Build.0 = DebugDLL|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CAF}.Release.ActiveCfg = Release|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CAF}.Release.Build.0 = Release|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CAF}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CAF}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CBF}.Debug.ActiveCfg = Debug|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CBF}.Debug.Build.0 = Debug|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CBF}.DebugDLL.ActiveCfg = DebugDLL|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CBF}.DebugDLL.Build.0 = DebugDLL|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CBF}.Release.ActiveCfg = Release|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CBF}.Release.Build.0 = Release|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CBF}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{948E8E86-7F47-46B0-95B2-ED24805F3CBF}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{156423D3-5FBB-45C6-A7CA-675B32F45C15}.Debug.ActiveCfg = Debug|Win32
{156423D3-5FBB-45C6-A7CA-675B32F45C15}.Debug.Build.0 = Debug|Win32
{156423D3-5FBB-45C6-A7CA-675B32F45C15}.DebugDLL.ActiveCfg = DebugDLL|Win32
{156423D3-5FBB-45C6-A7CA-675B32F45C15}.DebugDLL.Build.0 = DebugDLL|Win32
{156423D3-5FBB-45C6-A7CA-675B32F45C15}.Release.ActiveCfg = Release|Win32
{156423D3-5FBB-45C6-A7CA-675B32F45C15}.Release.Build.0 = Release|Win32
{156423D3-5FBB-45C6-A7CA-675B32F45C15}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{156423D3-5FBB-45C6-A7CA-675B32F45C15}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{9D2A443C-93D3-4144-B911-D7CA7CD85DE7}.Debug.ActiveCfg = Debug|Win32
{9D2A443C-93D3-4144-B911-D7CA7CD85DE7}.Debug.Build.0 = Debug|Win32
{9D2A443C-93D3-4144-B911-D7CA7CD85DE7}.DebugDLL.ActiveCfg = DebugDLL|Win32
{9D2A443C-93D3-4144-B911-D7CA7CD85DE7}.DebugDLL.Build.0 = DebugDLL|Win32
{9D2A443C-93D3-4144-B911-D7CA7CD85DE7}.Release.ActiveCfg = Release|Win32
{9D2A443C-93D3-4144-B911-D7CA7CD85DE7}.Release.Build.0 = Release|Win32
{9D2A443C-93D3-4144-B911-D7CA7CD85DE7}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{9D2A443C-93D3-4144-B911-D7CA7CD85DE7}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.Debug.ActiveCfg = Debug|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.Debug.Build.0 = Debug|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.DebugDLL.ActiveCfg = DebugDLL|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.DebugDLL.Build.0 = DebugDLL|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.Release.ActiveCfg = Release|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.Release.Build.0 = Release|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.Debug.ActiveCfg = Debug|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.Debug.Build.0 = Debug|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.DebugDLL.ActiveCfg = DebugDLL|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.DebugDLL.Build.0 = DebugDLL|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.Release.ActiveCfg = Release|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.Release.Build.0 = Release|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.Debug.ActiveCfg = Debug|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.Debug.Build.0 = Debug|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.DebugDLL.ActiveCfg = DebugDLL|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.DebugDLL.Build.0 = DebugDLL|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.Release.ActiveCfg = Release|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.Release.Build.0 = Release|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.ReleaseDLL.ActiveCfg = ReleaseDLL|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.ReleaseDLL.Build.0 = ReleaseDLL|Win32
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
EndGlobalSection
GlobalSection(ExtensibilityAddIns) = postSolution
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Win32 = Debug|Win32
DebugDLL|Win32 = DebugDLL|Win32
@ -211,6 +447,11 @@ Global
{EB7F30DE-DD77-4311-BB66-FFDF972052C7}.Release|Win32.Build.0 = Release|Win32
{EB7F30DE-DD77-4311-BB66-FFDF972052C7}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
{EB7F30DE-DD77-4311-BB66-FFDF972052C7}.ReleaseDLL|Win32.Build.0 = ReleaseDLL|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.Debug|Win32.ActiveCfg = Debug|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.Debug|Win32.Build.0 = Debug|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.Release|Win32.ActiveCfg = Release|Win32
{2F4235D0-B5F5-4C59-981D-BA006734B56E}.ReleaseDLL|Win32.ActiveCfg = ReleaseDLL|Win32
{BBDB5742-0A55-4C2C-973C-E876AAED6ABE}.Debug|Win32.ActiveCfg = Debug|Win32
{BBDB5742-0A55-4C2C-973C-E876AAED6ABE}.Debug|Win32.Build.0 = Debug|Win32
{BBDB5742-0A55-4C2C-973C-E876AAED6ABE}.DebugDLL|Win32.ActiveCfg = DebugDLL|Win32

@ -5,239 +5,190 @@
Name="exiv2lib"
ProjectGUID="{831EF580-92C8-4CA8-B0CE-3D906280A54D}"
RootNamespace="exiv2lib"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
Keyword="Win32Proj">
<Platforms>
<Platform
Name="Win32"
/>
Name="Win32"/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine="if exist ..\include\exiv2 goto :jail&#x0D;&#x0A;mkdir ..\include\exiv2\&#x0D;&#x0A;copy/y ..\..\src\*.h ..\include\exiv2\&#x0D;&#x0A;copy/y ..\..\src\*.hpp ..\include\exiv2\&#x0D;&#x0A;cd ..\include\exiv2&#x0D;&#x0A;del *_int.hpp&#x0D;&#x0A;cd ..\..\exiv2lib&#x0D;&#x0A;:jail&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include;../include/exiv2;../../xmpsdk/include;../../xmpsdk/src;../../../expat-2.0.1/lib;../../../zlib-1.2.3;"
PreprocessorDefinitions="WIN32;_DEBUG"
MinimalRebuild="true"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
BufferSecurityCheck="true"
RuntimeTypeInfo="true"
BufferSecurityCheck="TRUE"
RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="0"
BrowseInformation="1"
WarningLevel="3"
WarnAsError="true"
DebugInformationFormat="3"
/>
WarnAsError="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
LinkLibraryDependencies="true"
OutputFile="$(OutDir)/exiv2.lib"
AdditionalLibraryDirectories="..\xmpsdk\Debug;..\..\..\expat-2.0.1\win32\bin\debug"
/>
AdditionalLibraryDirectories="..\xmpsdk\Debug;..\..\..\expat-2.0.1\win32\bin\debug"/>
<Tool
Name="VCALinkTool"
/>
Name="VCMIDLTool"/>
<Tool
Name="VCXDCMakeTool"
/>
Name="VCPostBuildEventTool"
Description="create the bin (delivery) directory"
CommandLine="mkdir ..\bin\Debug\
copy/y &quot;$(TargetPath)&quot; ..\bin\Debug\$(TargetFileName)
"/>
<Tool
Name="VCBscMakeTool"
/>
Name="VCPreBuildEventTool"
CommandLine="if exist ..\include\exiv2 goto :jail
mkdir ..\include\exiv2\
copy/y ..\..\src\*.h ..\include\exiv2\
copy/y ..\..\src\*.hpp ..\include\exiv2\
cd ..\include\exiv2
del *_int.hpp
cd ..\..\exiv2lib
:jail
"/>
<Tool
Name="VCFxCopTool"
/>
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"
Description="create the bin (delivery) directory"
CommandLine="mkdir ..\bin\Debug\&#x0D;&#x0A;copy/y &quot;$(TargetPath)&quot; ..\bin\Debug\$(TargetFileName)&#x0D;&#x0A;"
/>
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="4"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
Description="copy expat and zlib binaries"
CommandLine="if exist ..\include\exiv2 goto :jail&#x0D;&#x0A;mkdir ..\include\exiv2\&#x0D;&#x0A;copy/y ..\..\src\*.h ..\include\exiv2\&#x0D;&#x0A;copy/y ..\..\src\*.hpp ..\include\exiv2\&#x0D;&#x0A;cd ..\include\exiv2&#x0D;&#x0A;del *_int.hpp&#x0D;&#x0A;cd ..\..\exiv2lib&#x0D;&#x0A;:jail&#x0D;&#x0A;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include;../include/exiv2;../../xmpsdk/include;../../xmpsdk/src;../../../expat-2.0.1/lib;../../../zlib-1.2.3;"
PreprocessorDefinitions="WIN32;_NDEBUG"
RuntimeLibrary="0"
RuntimeTypeInfo="true"
RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="0"
BrowseInformation="1"
WarningLevel="3"
WarnAsError="true"
DebugInformationFormat="3"
/>
WarnAsError="TRUE"
DebugInformationFormat="3"/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
Name="VCCustomBuildTool"/>
<Tool
Name="VCLibrarianTool"
LinkLibraryDependencies="true"
OutputFile="$(OutDir)/exiv2.lib"
AdditionalLibraryDirectories="..\xmpsdk\Release;..\..\..\expat-2.0.1\win32\bin\release"
/>
AdditionalLibraryDirectories="..\xmpsdk\Release;..\..\..\expat-2.0.1\win32\bin\release"/>
<Tool
Name="VCALinkTool"
/>
Name="VCMIDLTool"/>
<Tool
Name="VCXDCMakeTool"
/>
Name="VCPostBuildEventTool"
Description="create the bin (delivery) directory"
CommandLine="mkdir ..\bin\Release\
copy/y &quot;$(TargetPath)&quot; ..\bin\$(ConfigurationName)\$(TargetFileName)
"/>
<Tool
Name="VCBscMakeTool"
/>
Name="VCPreBuildEventTool"
Description="copy expat and zlib binaries"
CommandLine="if exist ..\include\exiv2 goto :jail
mkdir ..\include\exiv2\
copy/y ..\..\src\*.h ..\include\exiv2\
copy/y ..\..\src\*.hpp ..\include\exiv2\
cd ..\include\exiv2
del *_int.hpp
cd ..\..\exiv2lib
:jail
"/>
<Tool
Name="VCFxCopTool"
/>
Name="VCPreLinkEventTool"/>
<Tool
Name="VCPostBuildEventTool"
Description="create the bin (delivery) directory"
CommandLine="mkdir ..\bin\Release\&#x0D;&#x0A;copy/y &quot;$(TargetPath)&quot; ..\bin\$(ConfigurationName)\$(TargetFileName)&#x0D;&#x0A;&#x0D;&#x0A;"
/>
Name="VCResourceCompilerTool"/>
<Tool
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
</Configuration>
<Configuration
Name="DebugDLL|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
Description="copy expat and zlib dlls"
CommandLine="if exist ..\include\exiv2 goto :jail&#x0D;&#x0A;mkdir ..\include\exiv2\&#x0D;&#x0A;copy/y ..\..\src\*.h ..\include\exiv2\&#x0D;&#x0A;copy/y ..\..\src\*.hpp ..\include\exiv2\&#x0D;&#x0A;cd ..\include\exiv2&#x0D;&#x0A;del *_int.hpp&#x0D;&#x0A;cd ..\..\exiv2lib&#x0D;&#x0A;:jail&#x0D;&#x0A;copy/y ..\..\..\expat-2.0.1\win32\bin\Debug\libexpat.dll $(OutDir)&#x0D;&#x0A;copy/y ..\..\..\zlib-1.2.3\projects\visualc6\Win32_DLL_Debug\zlib1d.dll $(OutDir)&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include;../include/exiv2;../../xmpsdk/include;../../xmpsdk/src;../../../expat-2.0.1/lib;../../../zlib-1.2.3;"
PreprocessorDefinitions="WIN32;_DEBUG;EXV_HAVE_DLL;EXV_BUILDING_LIB"
MinimalRebuild="true"
MinimalRebuild="TRUE"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
BufferSecurityCheck="true"
RuntimeTypeInfo="true"
BufferSecurityCheck="TRUE"
RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="0"
BrowseInformation="1"
WarningLevel="3"
WarnAsError="false"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
WarnAsError="FALSE"
DebugInformationFormat="3"/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/NODEFAULTLIB:LIBMTD"
AdditionalDependencies="..\xmpsdk\DebugDLL\xmpsdk.lib ..\..\..\expat-2.0.1\win32\bin\debug\libexpat.lib ..\..\..\zlib-1.2.3\projects\visualc6\Win32_DLL_Debug\zlib1d.lib"
OutputFile="$(OutDir)\exiv2.dll"
GenerateDebugInformation="true"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
GenerateDebugInformation="TRUE"
ImportLibrary="$(TargetDir)\exiv2.lib"
TargetMachine="1"
/>
TargetMachine="1"/>
<Tool
Name="VCALinkTool"
/>
Name="VCMIDLTool"/>
<Tool
Name="VCManifestTool"
/>
Name="VCPreBuildEventTool"
Description="copy expat and zlib dlls"
CommandLine="if exist ..\include\exiv2 goto :jail
mkdir ..\include\exiv2\
copy/y ..\..\src\*.h ..\include\exiv2\
copy/y ..\..\src\*.hpp ..\include\exiv2\
cd ..\include\exiv2
del *_int.hpp
cd ..\..\exiv2lib
:jail
copy/y ..\..\..\expat-2.0.1\win32\bin\Debug\libexpat.dll $(OutDir)
copy/y ..\..\..\zlib-1.2.3\projects\visualc6\Win32_DLL_Debug\zlib1d.dll $(OutDir)
"/>
<Tool
Name="VCXDCMakeTool"
/>
Name="VCPreLinkEventTool"/>
<Tool
Name="VCBscMakeTool"
/>
Name="VCResourceCompilerTool"/>
<Tool
Name="VCFxCopTool"
/>
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCAppVerifierTool"
/>
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
<Tool
Name="VCPostBuildEventTool"
Description="create the bin (delivery) directorie"
@ -249,80 +200,63 @@
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
Description="copy expat and zlib dlls"
CommandLine="if exist ..\include\exiv2 goto :jail&#x0D;&#x0A;mkdir ..\include\exiv2\&#x0D;&#x0A;copy/y ..\..\src\*.h ..\include\exiv2\&#x0D;&#x0A;copy/y ..\..\src\*.hpp ..\include\exiv2\&#x0D;&#x0A;cd ..\include\exiv2&#x0D;&#x0A;del *_int.hpp&#x0D;&#x0A;cd ..\..\exiv2lib&#x0D;&#x0A;:jail&#x0D;&#x0A;copy/y ..\..\..\expat-2.0.1\win32\bin\Release\*.dll $(OutDir)&#x0D;&#x0A;copy/y ..\..\..\zlib-1.2.3\projects\visualc6\Win32_DLL_Release\zlib1.dll $(OutDir)&#x0D;&#x0A;&#x0D;&#x0A;"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
CharacterSet="2">
<Tool
Name="VCCLCompilerTool"
Optimization="1"
AdditionalIncludeDirectories="../include;../include/exiv2;../../xmpsdk/include;../../xmpsdk/src;../../../expat-2.0.1/lib;../../../zlib-1.2.3;"
PreprocessorDefinitions="WIN32;_NDEBUG;EXV_HAVE_DLL;EXV_BUILDING_LIB"
MinimalRebuild="true"
MinimalRebuild="TRUE"
BasicRuntimeChecks="0"
RuntimeLibrary="2"
BufferSecurityCheck="true"
RuntimeTypeInfo="true"
BufferSecurityCheck="TRUE"
RuntimeTypeInfo="TRUE"
UsePrecompiledHeader="0"
BrowseInformation="1"
WarningLevel="3"
WarnAsError="false"
DebugInformationFormat="3"
/>
WarnAsError="FALSE"
DebugInformationFormat="3"/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
Name="VCCustomBuildTool"/>
<Tool
Name="VCLinkerTool"
AdditionalOptions="/NODEFAULTLIB:LIBCMT"
AdditionalDependencies="..\xmpsdk\ReleaseDLL\xmpsdk.lib ..\..\..\expat-2.0.1\win32\bin\release\libexpat.lib ..\..\..\zlib-1.2.3\projects\visualc6\Win32_DLL_Release\zlib1.lib"
OutputFile="$(OutDir)\exiv2.dll"
GenerateDebugInformation="false"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
GenerateDebugInformation="FALSE"
ImportLibrary="$(TargetDir)\exiv2.lib"
TargetMachine="1"
/>
TargetMachine="1"/>
<Tool
Name="VCALinkTool"
/>
Name="VCMIDLTool"/>
<Tool
Name="VCManifestTool"
/>
Name="VCPreBuildEventTool"
Description="copy expat and zlib dlls"
CommandLine="if exist ..\include\exiv2 goto :jail
mkdir ..\include\exiv2\
copy/y ..\..\src\*.h ..\include\exiv2\
copy/y ..\..\src\*.hpp ..\include\exiv2\
cd ..\include\exiv2
del *_int.hpp
cd ..\..\exiv2lib
:jail
copy/y ..\..\..\expat-2.0.1\win32\bin\Release\*.dll $(OutDir)
copy/y ..\..\..\zlib-1.2.3\projects\visualc6\Win32_DLL_Release\zlib1.dll $(OutDir)
"/>
<Tool
Name="VCXDCMakeTool"
/>
Name="VCPreLinkEventTool"/>
<Tool
Name="VCBscMakeTool"
/>
Name="VCResourceCompilerTool"/>
<Tool
Name="VCFxCopTool"
/>
Name="VCWebServiceProxyGeneratorTool"/>
<Tool
Name="VCAppVerifierTool"
/>
Name="VCXMLDataGeneratorTool"/>
<Tool
Name="VCWebDeploymentTool"/>
<Tool
Name="VCManagedWrapperGeneratorTool"/>
<Tool
Name="VCAuxiliaryManagedWrapperGeneratorTool"/>
<Tool
Name="VCPostBuildEventTool"
Description="create the bin (delivery) directory"
@ -336,396 +270,324 @@
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}">
<File
RelativePath="..\..\src\basicio.cpp">
</File>
<File
RelativePath="..\..\src\basicio.cpp"
>
RelativePath="..\..\src\bmpimage.cpp">
</File>
<File
RelativePath="..\..\src\bmpimage.cpp"
>
RelativePath="..\..\src\canonmn.cpp">
</File>
<File
RelativePath="..\..\src\canonmn.cpp"
>
RelativePath="..\..\src\convert.cpp">
</File>
<File
RelativePath="..\..\src\convert.cpp"
>
RelativePath="..\..\src\cr2image.cpp">
</File>
<File
RelativePath="..\..\src\cr2image.cpp"
>
RelativePath="..\..\src\crwimage.cpp">
</File>
<File
RelativePath="..\..\src\crwimage.cpp"
>
RelativePath="..\..\src\datasets.cpp">
</File>
<File
RelativePath="..\..\src\datasets.cpp"
>
RelativePath="..\..\src\easyaccess.cpp">
</File>
<File
RelativePath="..\..\src\easyaccess.cpp"
>
RelativePath="..\..\src\error.cpp">
</File>
<File
RelativePath="..\..\src\error.cpp"
>
RelativePath="..\..\src\exif.cpp">
</File>
<File
RelativePath="..\..\src\exif.cpp"
>
RelativePath="..\..\src\fujimn.cpp">
</File>
<File
RelativePath="..\..\src\fujimn.cpp"
>
RelativePath="..\..\src\futils.cpp">
</File>
<File
RelativePath="..\..\src\futils.cpp"
>
RelativePath="..\..\src\gifimage.cpp">
</File>
<File
RelativePath="..\..\src\gifimage.cpp"
>
RelativePath="..\..\src\image.cpp">
</File>
<File
RelativePath="..\..\src\image.cpp"
>
RelativePath="..\..\src\iptc.cpp">
</File>
<File
RelativePath="..\..\src\iptc.cpp"
>
RelativePath="..\..\src\jp2image.cpp">
</File>
<File
RelativePath="..\..\src\jp2image.cpp"
>
RelativePath="..\..\src\jpgimage.cpp">
</File>
<File
RelativePath="..\..\src\jpgimage.cpp"
>
RelativePath="..\..\src\localtime.c">
</File>
<File
RelativePath="..\..\src\localtime.c"
>
RelativePath="..\..\src\makernote.cpp">
</File>
<File
RelativePath="..\..\src\makernote.cpp"
>
RelativePath="..\..\src\metadatum.cpp">
</File>
<File
RelativePath="..\..\src\metadatum.cpp"
>
RelativePath="..\..\src\minoltamn.cpp">
</File>
<File
RelativePath="..\..\src\minoltamn.cpp"
>
RelativePath="..\..\src\mrwimage.cpp">
</File>
<File
RelativePath="..\..\src\mrwimage.cpp"
>
RelativePath="..\..\src\nikonmn.cpp">
</File>
<File
RelativePath="..\..\src\nikonmn.cpp"
>
RelativePath="..\..\src\olympusmn.cpp">
</File>
<File
RelativePath="..\..\src\olympusmn.cpp"
>
RelativePath="..\..\src\orfimage.cpp">
</File>
<File
RelativePath="..\..\src\orfimage.cpp"
>
RelativePath="..\..\src\panasonicmn.cpp">
</File>
<File
RelativePath="..\..\src\panasonicmn.cpp"
>
RelativePath="..\..\src\pentaxmn.cpp">
</File>
<File
RelativePath="..\..\src\pentaxmn.cpp"
>
RelativePath="..\..\src\pgfimage.cpp">
</File>
<File
RelativePath="..\..\src\pngchunk.cpp"
>
RelativePath="..\..\src\pngchunk.cpp">
<FileConfiguration
Name="Debug|Win32"
>
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
GeneratePreprocessedFile="0"
/>
GeneratePreprocessedFile="0"/>
</FileConfiguration>
</File>
<File
RelativePath="..\..\src\pngimage.cpp"
>
RelativePath="..\..\src\pngimage.cpp">
</File>
<File
RelativePath="..\..\src\preview.cpp"
>
RelativePath="..\..\src\preview.cpp">
</File>
<File
RelativePath="..\..\src\properties.cpp"
>
RelativePath="..\..\src\properties.cpp">
</File>
<File
RelativePath="..\..\src\psdimage.cpp"
>
RelativePath="..\..\src\psdimage.cpp">
</File>
<File
RelativePath="..\..\src\rafimage.cpp"
>
RelativePath="..\..\src\rafimage.cpp">
</File>
<File
RelativePath="..\..\src\rw2image.cpp"
>
RelativePath="..\..\src\rw2image.cpp">
</File>
<File
RelativePath="..\..\src\sigmamn.cpp"
>
RelativePath="..\..\src\sigmamn.cpp">
</File>
<File
RelativePath="..\..\src\sonymn.cpp"
>
RelativePath="..\..\src\sonymn.cpp">
</File>
<File
RelativePath="..\..\src\tags.cpp"
>
RelativePath="..\..\src\tags.cpp">
</File>
<File
RelativePath="..\..\src\tgaimage.cpp"
>
RelativePath="..\..\src\tgaimage.cpp">
</File>
<File
RelativePath="..\..\src\tiffcomposite.cpp"
>
RelativePath="..\..\src\tiffcomposite.cpp">
</File>
<File
RelativePath="..\..\src\tiffimage.cpp"
>
RelativePath="..\..\src\tiffimage.cpp">
</File>
<File
RelativePath="..\..\src\tiffvisitor.cpp"
>
RelativePath="..\..\src\tiffvisitor.cpp">
</File>
<File
RelativePath="..\..\src\types.cpp"
>
RelativePath="..\..\src\types.cpp">
</File>
<File
RelativePath="..\..\src\value.cpp"
>
RelativePath="..\..\src\value.cpp">
</File>
<File
RelativePath="..\..\src\xmp.cpp"
>
RelativePath="..\..\src\xmp.cpp">
</File>
<File
RelativePath="..\..\src\xmpsidecar.cpp"
>
RelativePath="..\..\src\xmpsidecar.cpp">
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}">
<File
RelativePath="..\..\src\basicio.hpp"
>
RelativePath="..\..\src\basicio.hpp">
</File>
<File
RelativePath="..\..\src\bmpimage.hpp"
>
RelativePath="..\..\src\bmpimage.hpp">
</File>
<File
RelativePath="..\..\src\canonmn.hpp"
>
RelativePath="..\..\src\canonmn.hpp">
</File>
<File
RelativePath="..\..\config.h"
>
RelativePath="..\..\config.h">
</File>
<File
RelativePath="..\..\src\convert.hpp"
>
RelativePath="..\..\src\convert.hpp">
</File>
<File
RelativePath="..\..\src\cr2image.hpp"
>
RelativePath="..\..\src\cr2image.hpp">
</File>
<File
RelativePath="..\..\src\crwimage.hpp"
>
RelativePath="..\..\src\crwimage.hpp">
</File>
<File
RelativePath="..\..\src\datasets.hpp"
>
RelativePath="..\..\src\datasets.hpp">
</File>
<File
RelativePath="..\..\src\easyaccess.hpp"
>
RelativePath="..\..\src\easyaccess.hpp">
</File>
<File
RelativePath="..\..\src\error.hpp"
>
RelativePath="..\..\src\error.hpp">
</File>
<File
RelativePath="..\..\src\exif.hpp"
>
RelativePath="..\..\src\exif.hpp">
</File>
<File
RelativePath="..\..\src\exv_msvc.h"
>
RelativePath="..\..\src\fujimn.hpp">
</File>
<File
RelativePath="..\..\src\fujimn.hpp"
>
RelativePath="..\..\src\futils.hpp">
</File>
<File
RelativePath="..\..\src\futils.hpp"
>
RelativePath="..\..\src\gifimage.hpp">
</File>
<File
RelativePath="..\..\src\gifimage.hpp"
>
RelativePath="..\..\src\image.hpp">
</File>
<File
RelativePath="..\..\src\image.hpp"
>
RelativePath="..\..\src\iptc.hpp">
</File>
<File
RelativePath="..\..\src\iptc.hpp"
>
RelativePath="..\..\src\jp2image.hpp">
</File>
<File
RelativePath="..\..\src\jp2image.hpp"
>
RelativePath="..\..\src\jpgimage.hpp">
</File>
<File
RelativePath="..\..\src\jpgimage.hpp"
>
RelativePath="..\..\src\makernote.hpp">
</File>
<File
RelativePath="..\..\src\makernote.hpp"
>
RelativePath="..\..\src\metadatum.hpp">
</File>
<File
RelativePath="..\..\src\metadatum.hpp"
>
RelativePath="..\..\src\minoltamn.hpp">
</File>
<File
RelativePath="..\..\src\minoltamn.hpp"
>
RelativePath="..\..\src\mn.hpp">
</File>
<File
RelativePath="..\..\src\mn.hpp"
>
RelativePath="..\..\src\mrwimage.hpp">
</File>
<File
RelativePath="..\..\src\mrwimage.hpp"
>
RelativePath="..\..\src\nikonmn.hpp">
</File>
<File
RelativePath="..\..\src\nikonmn.hpp"
>
RelativePath="..\..\src\olympusmn.hpp">
</File>
<File
RelativePath="..\..\src\olympusmn.hpp"
>
RelativePath="..\..\src\orfimage.hpp">
</File>
<File
RelativePath="..\..\src\orfimage.hpp"
>
RelativePath="..\..\src\panasonicmn.hpp">
</File>
<File
RelativePath="..\..\src\panasonicmn.hpp"
>
RelativePath="..\..\src\pentaxmn.hpp">
</File>
<File
RelativePath="..\..\src\pentaxmn.hpp"
>
RelativePath="..\..\src\pgfimage.hpp">
</File>
<File
RelativePath="..\..\src\pngimage.hpp"
>
RelativePath="..\..\src\pngimage.hpp">
</File>
<File
RelativePath="..\..\src\preview.hpp"
>
RelativePath="..\..\src\preview.hpp">
</File>
<File
RelativePath="..\..\src\properties.hpp"
>
RelativePath="..\..\src\properties.hpp">
</File>
<File
RelativePath="..\..\src\psdimage.hpp"
>
RelativePath="..\..\src\psdimage.hpp">
</File>
<File
RelativePath="..\..\src\rafimage.hpp"
>
RelativePath="..\..\src\rafimage.hpp">
</File>
<File
RelativePath="..\..\src\rcsid.hpp"
>
RelativePath="..\..\src\rcsid.hpp">
</File>
<File
RelativePath="..\..\src\rw2image.hpp"
>
RelativePath="..\..\src\rw2image.hpp">
</File>
<File
RelativePath="..\..\src\sigmamn.hpp"
>
RelativePath="..\..\src\sigmamn.hpp">
</File>
<File
RelativePath="..\..\src\sonymn.hpp"
>
RelativePath="..\..\src\sonymn.hpp">
</File>
<File
RelativePath="..\..\src\tags.hpp"
>
RelativePath="..\..\src\tags.hpp">
</File>
<File
RelativePath="..\..\src\tgaimage.hpp"
>
RelativePath="..\..\src\tgaimage.hpp">
</File>
<File
RelativePath="..\..\src\tiffcomposite.hpp"
>
RelativePath="..\..\src\tiffcomposite.hpp">
</File>
<File
RelativePath="..\..\src\tiffimage.hpp"
>
RelativePath="..\..\src\tiffimage.hpp">
</File>
<File
RelativePath="..\..\src\tiffvisitor.hpp"
>
RelativePath="..\..\src\tiffvisitor.hpp">
</File>
<File
RelativePath="..\..\src\types.hpp"
>
RelativePath="..\..\src\types.hpp">
</File>
<File
RelativePath="..\..\src\value.hpp"
>
RelativePath="..\..\src\value.hpp">
</File>
<File
RelativePath="..\..\src\xmp.hpp"
>
RelativePath="..\..\src\xmp.hpp">
</File>
<File
RelativePath="..\..\src\xmpsidecar.hpp"
>
RelativePath="..\..\src\xmpsidecar.hpp">
</File>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}">
</Filter>
<Filter
Name="MSVC-only"
Filter="">
<File
RelativePath="..\include\exv_msvc.h">
</File>
<File
RelativePath="..\src\mmap.cpp">
</File>
<File
RelativePath="..\include\sys\mman.h">
</File>
<File
RelativePath="..\include\sys\socket.h">
</File>
<File
RelativePath="..\include\sys\types.h">
</File>
<File
RelativePath="..\include\winposix_export.h">
</File>
</Filter>
</Files>
<Globals>

@ -69,6 +69,19 @@ typedef int pid_t;
#define EXV_SEPERATOR_STR "\\"
#define EXV_SEPERATOR_CHR '\\'
/* Windows unicode path support */
#define EXV_UNICODE_PATH
/* Define to 1 if you have the "sys/mman.h header file (and supporting code of course) */
/* At this time (between 0.18.1 and 0.19) this is used by TIFF files to avoid reading */
/* the total file into memory returning in a 6x improvement in exiv2 on 2mb tiff files */
#define EXV_HAVE_SYS_MMAN_H 1
#ifdef EXV_HAVE_SYS_MMAN_H
#if EXV_HAVE_SYS_MMAN_H
#define EXV_HAVE_MMAP 1
#define EXV_HAVE_MUNMAP 1
#endif
#endif
/* Shared library support */
#ifdef EXV_HAVE_DLL

@ -0,0 +1,57 @@
/*
This file is part of the KDE libraries
Copyright (C) 2004 Jaroslaw Staniek <js@iidea.pl>
These sources are based on ftp://g.oswego.edu/pub/misc/malloc.c
file by Doug Lea, released to the public domain.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#ifndef KDEWIN_SYS_MMAN_H
#define KDEWIN_SYS_MMAN_H
// include everywhere
#include <sys/types.h>
#ifdef __cplusplus
extern "C" {
#endif
#define PROT_NONE 0
#define PROT_READ 1
#define PROT_WRITE 2
#define PROT_EXEC 4
/* These values don't really matter in windows mmap emulation */
#define MAP_FILE 0
#define MAP_SHARED 1
#define MAP_PRIVATE 2
#define MAP_TYPE 0xF
#define MAP_FIXED 0x10
#define MAP_ANONYMOUS 0x20
#define MAP_ANON MAP_ANONYMOUS
#define MAP_FAILED ((void *)-1)
KDEWIN32_EXPORT void *mmap(void *start, size_t length, int prot , int flags, int fd, off_t offset);
KDEWIN32_EXPORT int munmap(void *start, size_t length);
#ifdef __cplusplus
}
#endif
#endif // KDEWIN_SYS_MMAN_H

@ -0,0 +1,7 @@
#ifndef _sys_socket_h_
#define _sys_socket_h_
// rmills
// minimum to enable mmap.cpp to compile without change
#endif

@ -0,0 +1,8 @@
#ifndef _types_h_
#define _types_h_
// rmills
// minimum required by exiv2
//
#include "winposix_export.h"
#endif

@ -0,0 +1,39 @@
#ifndef _WINPOSIX_EXPORT_H_
#define _WINPOSIX_EXPORT_H_
// rmills
// msvc/include/winposix_export.h
//
// I'm very appreciative and respectful of the work of Jaroslaw Staniek <js@iidea.pl>
// in the KDE libraries where I found msvc/src/mmap.cpp and msvc/mman.h
//
// http://websvn.kde.org/trunk/KDE/kdelibs/win/include/msvc/sys/mman.h?revision=517357&view=markup&pathrev=519502
// http://websvn.kde.org/trunk/KDE/kdelibs/win/src/mmap.c?revision=519502&view=markup&pathrev=519502
// I have commented 2 essential tiny changes in mmap.cpp to make it compile with MSVC
// I've also added a dummy sys/socket.h and sys/types.h file to keep everybody happy!
//
// the contents of this file are the minimum required to enable exiv2 to compile link and execute the mmap.cpp code
//
#ifndef ENOTSUP
#define ENOTSUP 911
#endif
#ifndef off_t
#define off_t size_t
#endif
#ifndef KDEWIN32_EXPORT
#define KDEWIN32_EXPORT
#endif
// give MSVC 7.1 (VS 2003 .Net) encouragement to ignore _set_errno !
#if _MSC_VER < 1400
#ifndef _set_errno
#define _set_errno(x)
#endif
#endif
#endif

@ -0,0 +1,399 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="mmap-test"
ProjectGUID="{2F4235D0-B5F5-4C59-981D-BA006734B56E}"
RootNamespace="mmap-test"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include;../include/exiv2;../../xmpsdk/include;../../xmpsdk/src;../../../expat-2.0.1/lib;../../../zlib-1.2.3;"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
BufferSecurityCheck="true"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
BrowseInformation="1"
WarningLevel="3"
WarnAsError="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkLibraryDependencies="true"
AdditionalOptions="/NODEFAULTLIB:MSVCRTD"
AdditionalDependencies="..\exiv2lib\$(ConfigurationName)\exiv2.lib ..\..\..\expat-2.0.1\win32\bin\debug\libexpatMT.lib ..\xmpsdk\$(ConfigurationName)\xmpsdk.lib ..\..\..\zlib-1.2.3\projects\visualc6\Win32_LIB_Debug\zlibd.lib"
OutputFile="$(OutDir)/mmap-test.exe"
LinkIncremental="1"
AdditionalLibraryDirectories=""
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/mmap-test.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="copy target to bin"
CommandLine="copy/y &quot;$(TargetPath)&quot; &quot;$(SolutionDir)\bin\$(ConfigurationName)&quot;"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include;../include/exiv2;../../xmpsdk/include;../../xmpsdk/src;../../../expat-2.0.1/lib;../../../zlib-1.2.3;"
PreprocessorDefinitions="WIN32;_NDEBUG;_CONSOLE"
RuntimeLibrary="0"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
BrowseInformation="1"
WarningLevel="3"
WarnAsError="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkLibraryDependencies="true"
AdditionalOptions="/NODEFAULTLIB:MSVCRT"
AdditionalDependencies="..\exiv2lib\$(ConfigurationName)\exiv2.lib ..\..\..\expat-2.0.1\win32\bin\release\libexpatMT.lib ..\xmpsdk\$(ConfigurationName)\xmpsdk.lib ..\..\..\zlib-1.2.3\projects\visualc6\Win32_LIB_Release\zlib.lib"
LinkIncremental="1"
GenerateDebugInformation="false"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="copy target to bin"
CommandLine="copy/y &quot;$(TargetPath)&quot; &quot;$(SolutionDir)\bin\$(ConfigurationName)&quot;"
/>
</Configuration>
<Configuration
Name="DebugDLL|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
Description="copy expat dll"
CommandLine="copy/y ..\..\..\expat-2.0.1\win32\bin\debug\*.dll &quot;$(TargetDir)&quot;"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include;../include/exiv2;../../xmpsdk/include;../../xmpsdk/src;../../../expat-2.0.1/lib;../../../zlib-1.2.3;"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;EXV_HAVE_DLL"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
BufferSecurityCheck="true"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
BrowseInformation="1"
WarningLevel="3"
WarnAsError="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
Description="copy the dlls"
CommandLine="copy/y ..\exiv2lib\$(ConfigurationName)\*.dll &quot;$(TargetDir)&quot;"
/>
<Tool
Name="VCLinkerTool"
LinkLibraryDependencies="true"
AdditionalOptions="/NODEFAULTLIB:LIBCMTD"
AdditionalDependencies="..\exiv2lib\$(ConfigurationName)\exiv2.lib ..\..\..\expat-2.0.1\win32\bin\release\libexpat.lib ..\xmpsdk\$(ConfigurationName)\xmpsdk.lib ..\..\..\zlib-1.2.3\projects\visualc6\Win32_DLL_Debug\zlib1d.lib"
OutputFile="$(OutDir)/mmap-test.exe"
LinkIncremental="1"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/mmap-test.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="copy target to bin"
CommandLine="copy/y &quot;$(TargetPath)&quot; &quot;$(SolutionDir)\bin\$(ConfigurationName)&quot;"
/>
</Configuration>
<Configuration
Name="ReleaseDLL|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
Description="copy expat dll"
CommandLine="copy/y ..\..\..\expat-2.0.1\win32\bin\release\*.dll &quot;$(TargetDir)&quot;"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include;../include/exiv2;../../xmpsdk/include;../../xmpsdk/src;../../../expat-2.0.1/lib;../../../zlib-1.2.3;"
PreprocessorDefinitions="WIN32;_NDEBUG;_CONSOLE;EXV_HAVE_DLL"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="2"
BufferSecurityCheck="true"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
BrowseInformation="1"
WarningLevel="3"
WarnAsError="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
Description="copy the dlls"
CommandLine="copy/y ..\exiv2lib\$(ConfigurationName)\*.dll &quot;$(TargetDir)&quot;"
/>
<Tool
Name="VCLinkerTool"
LinkLibraryDependencies="true"
AdditionalOptions="/NODEFAULTLIB:LIBCMT"
AdditionalDependencies="..\exiv2lib\$(ConfigurationName)\exiv2.lib ..\..\..\expat-2.0.1\win32\bin\debug\libexpat.lib ..\xmpsdk\$(ConfigurationName)\xmpsdk.lib ..\..\..\zlib-1.2.3\projects\visualc6\Win32_DLL_Release\zlib1.lib"
OutputFile="$(OutDir)/mmap-test.exe"
LinkIncremental="1"
GenerateDebugInformation="false"
ProgramDatabaseFile="$(OutDir)/mmap-test.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="copy target to bin"
CommandLine="copy/y &quot;$(TargetPath)&quot; &quot;$(SolutionDir)\bin\$(ConfigurationName)&quot;"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\samples\mmap-test.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

@ -1,7 +1,9 @@
@echo off
rem ---- in the bin directories ----
rem ---------------------------------
rem ---- run everything in the bin
bin\Debug\addmoddel.exe
bin\Debug\convert-test.exe
bin\Debug\exifcomment.exe
bin\Debug\exifdata-test.exe
bin\Debug\exifprint.exe
@ -12,9 +14,11 @@ bin\Debug\iptcprint.exe
bin\Debug\iptctest.exe
bin\Debug\largeiptc-test.exe
bin\Debug\metacopy.exe
bin\Debug\mmap-test.exe
bin\Debug\prevtest.exe
bin\Debug\stringto-test.exe
bin\Debug\taglist.exe
bin\Debug\tiff-test.exe
bin\Debug\utiltest.exe
bin\Debug\write-test.exe
bin\Debug\write2-test.exe
@ -22,6 +26,7 @@ bin\Debug\xmpparse.exe
bin\Debug\xmpparser-test.exe
bin\Debug\xmpsample.exe
bin\DebugDLL\addmoddel.exe
bin\DebugDLL\convert-test.exe
bin\DebugDLL\exifcomment.exe
bin\DebugDLL\exifdata-test.exe
bin\DebugDLL\exifprint.exe
@ -32,9 +37,11 @@ bin\DebugDLL\iptcprint.exe
bin\DebugDLL\iptctest.exe
bin\DebugDLL\largeiptc-test.exe
bin\DebugDLL\metacopy.exe
bin\DebugDLL\mmap-test.exe
bin\DebugDLL\prevtest.exe
bin\DebugDLL\stringto-test.exe
bin\DebugDLL\taglist.exe
bin\DebugDLL\tiff-test.exe
bin\DebugDLL\utiltest.exe
bin\DebugDLL\write-test.exe
bin\DebugDLL\write2-test.exe
@ -42,6 +49,7 @@ bin\DebugDLL\xmpparse.exe
bin\DebugDLL\xmpparser-test.exe
bin\DebugDLL\xmpsample.exe
bin\Release\addmoddel.exe
bin\Release\convert-test.exe
bin\Release\exifcomment.exe
bin\Release\exifdata-test.exe
bin\Release\exifprint.exe
@ -52,9 +60,11 @@ bin\Release\iptcprint.exe
bin\Release\iptctest.exe
bin\Release\largeiptc-test.exe
bin\Release\metacopy.exe
bin\Release\mmap-test.exe
bin\Release\prevtest.exe
bin\Release\stringto-test.exe
bin\Release\taglist.exe
bin\Release\tiff-test.exe
bin\Release\utiltest.exe
bin\Release\write-test.exe
bin\Release\write2-test.exe
@ -62,6 +72,7 @@ bin\Release\xmpparse.exe
bin\Release\xmpparser-test.exe
bin\Release\xmpsample.exe
bin\ReleaseDLL\addmoddel.exe
bin\ReleaseDLL\convert-test.exe
bin\ReleaseDLL\exifcomment.exe
bin\ReleaseDLL\exifdata-test.exe
bin\ReleaseDLL\exifprint.exe
@ -72,9 +83,11 @@ bin\ReleaseDLL\iptcprint.exe
bin\ReleaseDLL\iptctest.exe
bin\ReleaseDLL\largeiptc-test.exe
bin\ReleaseDLL\metacopy.exe
bin\ReleaseDLL\mmap-test.exe
bin\ReleaseDLL\prevtest.exe
bin\ReleaseDLL\stringto-test.exe
bin\ReleaseDLL\taglist.exe
bin\ReleaseDLL\tiff-test.exe
bin\ReleaseDLL\utiltest.exe
bin\ReleaseDLL\write-test.exe
bin\ReleaseDLL\write2-test.exe
@ -82,95 +95,24 @@ bin\ReleaseDLL\xmpparse.exe
bin\ReleaseDLL\xmpparser-test.exe
bin\ReleaseDLL\xmpsample.exe
rem ------- run everything ---------
rem ---------------------------------
rem ---- run everything in the build directories
addmoddel\Debug\addmoddel.exe
addmoddel\DebugDLL\addmoddel.exe
addmoddel\Release\addmoddel.exe
addmoddel\ReleaseDLL\addmoddel.exe
bin\Debug\addmoddel.exe
bin\Debug\exifcomment.exe
bin\Debug\exifdata-test.exe
bin\Debug\exifprint.exe
bin\Debug\exiv2.exe
bin\Debug\iotest.exe
bin\Debug\iptceasy.exe
bin\Debug\iptcprint.exe
bin\Debug\iptctest.exe
bin\Debug\largeiptc-test.exe
bin\Debug\metacopy.exe
bin\Debug\prevtest.exe
bin\Debug\stringto-test.exe
bin\Debug\taglist.exe
bin\Debug\utiltest.exe
bin\Debug\write-test.exe
bin\Debug\write2-test.exe
bin\Debug\xmpparse.exe
bin\Debug\xmpparser-test.exe
bin\Debug\xmpsample.exe
bin\DebugDLL\addmoddel.exe
bin\DebugDLL\exifcomment.exe
bin\DebugDLL\exifdata-test.exe
bin\DebugDLL\exifprint.exe
bin\DebugDLL\exiv2.exe
bin\DebugDLL\iotest.exe
bin\DebugDLL\iptceasy.exe
bin\DebugDLL\iptcprint.exe
bin\DebugDLL\iptctest.exe
bin\DebugDLL\largeiptc-test.exe
bin\DebugDLL\metacopy.exe
bin\DebugDLL\prevtest.exe
bin\DebugDLL\stringto-test.exe
bin\DebugDLL\taglist.exe
bin\DebugDLL\utiltest.exe
bin\DebugDLL\write-test.exe
bin\DebugDLL\write2-test.exe
bin\DebugDLL\xmpparse.exe
bin\DebugDLL\xmpparser-test.exe
bin\DebugDLL\xmpsample.exe
bin\Release\addmoddel.exe
bin\Release\exifcomment.exe
bin\Release\exifdata-test.exe
bin\Release\exifprint.exe
bin\Release\exiv2.exe
bin\Release\iotest.exe
bin\Release\iptceasy.exe
bin\Release\iptcprint.exe
bin\Release\iptctest.exe
bin\Release\largeiptc-test.exe
bin\Release\metacopy.exe
bin\Release\prevtest.exe
bin\Release\stringto-test.exe
bin\Release\taglist.exe
bin\Release\utiltest.exe
bin\Release\write-test.exe
bin\Release\write2-test.exe
bin\Release\xmpparse.exe
bin\Release\xmpparser-test.exe
bin\Release\xmpsample.exe
bin\ReleaseDLL\addmoddel.exe
bin\ReleaseDLL\exifcomment.exe
bin\ReleaseDLL\exifdata-test.exe
bin\ReleaseDLL\exifprint.exe
bin\ReleaseDLL\exiv2.exe
bin\ReleaseDLL\iotest.exe
bin\ReleaseDLL\iptceasy.exe
bin\ReleaseDLL\iptcprint.exe
bin\ReleaseDLL\iptctest.exe
bin\ReleaseDLL\largeiptc-test.exe
bin\ReleaseDLL\metacopy.exe
bin\ReleaseDLL\prevtest.exe
bin\ReleaseDLL\stringto-test.exe
bin\ReleaseDLL\taglist.exe
bin\ReleaseDLL\utiltest.exe
bin\ReleaseDLL\write-test.exe
bin\ReleaseDLL\write2-test.exe
bin\ReleaseDLL\xmpparse.exe
bin\ReleaseDLL\xmpparser-test.exe
bin\ReleaseDLL\xmpsample.exe
convert-test\Debug\convert-test.exe
convert-test\DebugDLL\convert-test.exe
convert-test\Release\convert-test.exe
convert-test\ReleaseDLL\convert-test.exe
exifcomment\Debug\exifcomment.exe
exifcomment\DebugDLL\exifcomment.exe
exifcomment\Release\exifcomment.exe
exifcomment\ReleaseDLL\exifcomment.exe
tiff-test\Debug\tiff-test.exe
tiff-test\DebugDLL\tiff-test.exe
tiff-test\Release\tiff-test.exe
tiff-test\ReleaseDLL\tiff-test.exe
exifdata-test\Debug\exifdata-test.exe
exifdata-test\DebugDLL\exifdata-test.exe
exifdata-test\Release\exifdata-test.exe
@ -206,6 +148,10 @@ largeiptc-test\ReleaseDLL\largeiptc-test.exe
metacopy\Debug\metacopy.exe
metacopy\DebugDLL\metacopy.exe
metacopy\Release\metacopy.exe
mmap-test\ReleaseDLL\mmap-test.exe
mmap-test\Debug\mmap-test.exe
mmap-test\DebugDLL\mmap-test.exe
mmap-test\Release\mmap-test.exe
metacopy\ReleaseDLL\metacopy.exe
prevtest\Debug\prevtest.exe
prevtest\DebugDLL\prevtest.exe
@ -219,6 +165,10 @@ taglist\Debug\taglist.exe
taglist\DebugDLL\taglist.exe
taglist\Release\taglist.exe
taglist\ReleaseDLL\taglist.exe
tiff-test\Debug\tiff-test.exe
tiff-test\DebugDLL\tiff-test.exe
tiff-test\Release\tiff-test.exe
tiff-test\ReleaseDLL\tiff-test.exe
utiltest\Debug\utiltest.exe
utiltest\DebugDLL\utiltest.exe
utiltest\Release\utiltest.exe
@ -244,114 +194,139 @@ xmpsample\DebugDLL\xmpsample.exe
xmpsample\Release\xmpsample.exe
xmpsample\ReleaseDLL\xmpsample.exe
rem ---------------------------------
rem ------- exiv2.exe on a file ----
bin\Debug\exiv2.exe -pt test.jpg
bin\Debug\exiv2.exe test.png
bin\Debug\exiv2.exe test.tiff
bin\DebugDLL\exiv2.exe -pt test.jpg
bin\DebugDLL\exiv2.exe test.png
bin\DebugDLL\exiv2.exe test.tiff
bin\Release\exiv2.exe -pt test.jpg
bin\Release\exiv2.exe test.png
bin\Release\exiv2.exe test.tiff
bin\ReleaseDLL\exiv2.exe -pt test.jpg
bin\ReleaseDLL\exiv2.exe test.png
bin\ReleaseDLL\exiv2.exe test.tiff
rem ---------------------------------
rem ------- mmap-test on a file ----
bin\Debug\mmap-test.exe test.tiff
bin\DebugDLL\mmap-test.exe test.tiff
bin\Release\mmap-test.exe test.tiff
bin\ReleaseDLL\mmap-test.exe test.tiff
rem ---------------------------------
rem Check the DLL dependencies
cd bin\Debug
echo -------Debug---------------
..\..\depends2.exe addmoddel.exe | sort
..\..\depends2.exe convert-test.exe | sort
..\..\depends2.exe exifcomment.exe | sort
..\..\depends2.exe exifdata-test.exe | sort
..\..\depends2.exe exifprint.exe | sort
..\..\depends2.exe exiv2.exe | sort
..\..\depends2.exe exivsimple.dll | sort
..\..\depends2.exe iotest.exe | sort
..\..\depends2.exe iptceasy.exe | sort
..\..\depends2.exe iptcprint.exe | sort
..\..\depends2.exe iptctest.exe | sort
..\..\depends2.exe largeiptc-test.exe | sort
..\..\depends2.exe metacopy.exe | sort
..\..\depends2.exe mmap-test.exe | sort
..\..\depends2.exe prevtest.exe | sort
..\..\depends2.exe stringto-test.exe | sort
..\..\depends2.exe taglist.exe | sort
..\..\depends2.exe tiff-test.exe | sort
..\..\depends2.exe utiltest.exe | sort
..\..\depends2.exe write-test.exe | sort
..\..\depends2.exe write2-test.exe | sort
..\..\depends2.exe xmpparse.exe | sort
..\..\depends2.exe xmpparser-test.exe | sort
..\..\depends2.exe xmpsample.exe | sort
..\..\depends2.exe exivsimple.dll | sort
cd ..\DebugDLL
echo -------DebugDLL---------------
..\..\depends2.exe addmoddel.exe | sort
..\..\depends2.exe convert-test.exe | sort
..\..\depends2.exe exifcomment.exe | sort
..\..\depends2.exe exifdata-test.exe | sort
..\..\depends2.exe exifprint.exe | sort
..\..\depends2.exe exiv2.exe | sort
..\..\depends2.exe exivsimple.dll | sort
..\..\depends2.exe iotest.exe | sort
..\..\depends2.exe iptceasy.exe | sort
..\..\depends2.exe iptcprint.exe | sort
..\..\depends2.exe iptctest.exe | sort
..\..\depends2.exe largeiptc-test.exe | sort
..\..\depends2.exe metacopy.exe | sort
..\..\depends2.exe mmap-test.exe | sort
..\..\depends2.exe prevtest.exe | sort
..\..\depends2.exe stringto-test.exe | sort
..\..\depends2.exe taglist.exe | sort
..\..\depends2.exe tiff-test.exe | sort
..\..\depends2.exe utiltest.exe | sort
..\..\depends2.exe write-test.exe | sort
..\..\depends2.exe write2-test.exe | sort
..\..\depends2.exe xmpparse.exe | sort
..\..\depends2.exe xmpparser-test.exe | sort
..\..\depends2.exe xmpsample.exe | sort
..\..\depends2.exe exivsimple.dll | sort
cd ..\Release
echo -------Release---------------
..\..\depends2.exe addmoddel.exe | sort
..\..\depends2.exe convert-test.exe | sort
..\..\depends2.exe exifcomment.exe | sort
..\..\depends2.exe exifdata-test.exe | sort
..\..\depends2.exe exifprint.exe | sort
..\..\depends2.exe exiv2.exe | sort
..\..\depends2.exe exivsimple.dll | sort
..\..\depends2.exe iotest.exe | sort
..\..\depends2.exe iptceasy.exe | sort
..\..\depends2.exe iptcprint.exe | sort
..\..\depends2.exe iptctest.exe | sort
..\..\depends2.exe largeiptc-test.exe | sort
..\..\depends2.exe metacopy.exe | sort
..\..\depends2.exe mmap-test.exe | sort
..\..\depends2.exe prevtest.exe | sort
..\..\depends2.exe stringto-test.exe | sort
..\..\depends2.exe taglist.exe | sort
..\..\depends2.exe tiff-test.exe | sort
..\..\depends2.exe utiltest.exe | sort
..\..\depends2.exe write-test.exe | sort
..\..\depends2.exe write2-test.exe | sort
..\..\depends2.exe xmpparse.exe | sort
..\..\depends2.exe xmpparser-test.exe | sort
..\..\depends2.exe xmpsample.exe | sort
..\..\depends2.exe exivsimple.dll | sort
cd ..\ReleaseDLL
echo -------ReleaseDLL---------------
..\..\depends2.exe addmoddel.exe | sort
..\..\depends2.exe convert-test.exe | sort
..\..\depends2.exe exifcomment.exe | sort
..\..\depends2.exe exifdata-test.exe | sort
..\..\depends2.exe exifprint.exe | sort
..\..\depends2.exe exiv2.exe | sort
..\..\depends2.exe exivsimple.dll | sort
..\..\depends2.exe iotest.exe | sort
..\..\depends2.exe iptceasy.exe | sort
..\..\depends2.exe iptcprint.exe | sort
..\..\depends2.exe iptctest.exe | sort
..\..\depends2.exe largeiptc-test.exe | sort
..\..\depends2.exe metacopy.exe | sort
..\..\depends2.exe mmap-test.exe | sort
..\..\depends2.exe prevtest.exe | sort
..\..\depends2.exe stringto-test.exe | sort
..\..\depends2.exe taglist.exe | sort
..\..\depends2.exe tiff-test.exe | sort
..\..\depends2.exe utiltest.exe | sort
..\..\depends2.exe write-test.exe | sort
..\..\depends2.exe write2-test.exe | sort
..\..\depends2.exe xmpparse.exe | sort
..\..\depends2.exe xmpparser-test.exe | sort
..\..\depends2.exe xmpsample.exe | sort
..\..\depends2.exe exivsimple.dll | sort
cd ..\..

File diff suppressed because it is too large Load Diff

@ -0,0 +1,196 @@
/*
This file is part of the KDE libraries
Copyright (c) 2006 Christian Ehrlicher <ch.ehrlicher@gmx.de>
These sources are based on ftp://g.oswego.edu/pub/misc/malloc.c
file by Doug Lea, released to the public domain.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License version 2 as published by the Free Software Foundation.
This library 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
Library General Public License for more details.
You should have received a copy of the GNU Library General Public License
along with this library; see the file COPYING.LIB. If not, write to
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
Boston, MA 02110-1301, USA.
*/
#include <winposix_export.h>
#include <windows.h>
#include <assert.h>
#include <stdlib.h>
#include <errno.h>
#include <io.h>
#include <sys/mman.h>
#include <sys/socket.h>
#ifndef SECTION_MAP_EXECUTE_EXPLICIT
//not defined in the February 2003 version of the Platform SDK
#define SECTION_MAP_EXECUTE_EXPLICIT 0x0020
#endif
#ifndef FILE_MAP_EXECUTE
//not defined in the February 2003 version of the Platform SDK
#define FILE_MAP_EXECUTE SECTION_MAP_EXECUTE_EXPLICIT
#endif
#define MUNMAP_FAILURE (-1)
#define USE_MALLOC_LOCK 1
struct mmapInfos {
HANDLE hFile; // the duplicated fd
HANDLE hMap; // handle returned by CreateFileMapping
void* start; // ptr returned by MapViewOfFile
};
CRITICAL_SECTION cs;
// rmills - only change is to add long to the following 2 lines
static long g_curMMapInfos = 0;
static long g_maxMMapInfos = -1;
static struct mmapInfos *g_mmapInfos = NULL;
#define NEW_MMAP_STRUCT_CNT 10
static int mapProtFlags(int flags, DWORD *dwAccess)
{
if ( ( flags & PROT_READ ) == PROT_READ ) {
if ( ( flags & PROT_WRITE ) == PROT_WRITE ) {
*dwAccess = FILE_MAP_WRITE;
if ( ( flags & PROT_EXEC ) == PROT_EXEC ) {
return PAGE_EXECUTE_READWRITE;
}
return PAGE_READWRITE;
}
if ( ( flags & PROT_EXEC ) == PROT_EXEC ) {
*dwAccess = FILE_MAP_EXECUTE;
return PAGE_EXECUTE_READ;
}
*dwAccess = FILE_MAP_READ;
return PAGE_READONLY;
}
if ( ( flags & PROT_WRITE ) == PROT_WRITE ) {
*dwAccess = FILE_MAP_COPY;
return PAGE_WRITECOPY;
}
if ( ( flags & PROT_EXEC ) == PROT_EXEC ) {
*dwAccess = FILE_MAP_EXECUTE;
return PAGE_EXECUTE_READ;
}
*dwAccess = 0;
return 0;
}
void *mmap(void *start, size_t length, int prot , int flags, int fd, off_t offset)
{
struct mmapInfos mmi;
DWORD dwAccess;
DWORD flProtect;
HANDLE hfd;
if ( g_maxMMapInfos == -1 ) {
g_maxMMapInfos = 0;
InitializeCriticalSection( &cs );
}
flProtect = mapProtFlags( flags, &dwAccess );
if ( flProtect == 0 ) {
_set_errno( EINVAL );
return MAP_FAILED;
}
// we don't support this atm
if ( prot == MAP_FIXED ) {
_set_errno( ENOTSUP );
return MAP_FAILED;
}
if ( fd == -1 ) {
_set_errno( EBADF );
return MAP_FAILED;
}
hfd = (HANDLE)_get_osfhandle( fd );
if ( hfd == INVALID_HANDLE_VALUE )
return MAP_FAILED;
if ( !DuplicateHandle( GetCurrentProcess(), hfd, GetCurrentProcess(),
&mmi.hFile, 0, FALSE, DUPLICATE_SAME_ACCESS ) ) {
#ifdef _DEBUG
DWORD dwLastErr = GetLastError();
#endif
return MAP_FAILED;
}
mmi.hMap = CreateFileMapping( mmi.hFile, NULL, flProtect,
0, length, NULL );
if ( mmi.hMap == 0 ) {
_set_errno( EACCES );
return MAP_FAILED;
}
mmi.start = MapViewOfFile( mmi.hMap, dwAccess, 0, offset, 0 );
if ( mmi.start == 0 ) {
DWORD dwLastErr = GetLastError();
if ( dwLastErr == ERROR_MAPPED_ALIGNMENT )
_set_errno( EINVAL );
else
_set_errno( EACCES );
return MAP_FAILED;
}
EnterCriticalSection( &cs );
if ( g_mmapInfos == NULL ) {
g_maxMMapInfos = NEW_MMAP_STRUCT_CNT;
g_mmapInfos = ( struct mmapInfos* )calloc( g_maxMMapInfos,
sizeof( struct mmapInfos ) );
}
if( g_curMMapInfos == g_maxMMapInfos) {
g_maxMMapInfos += NEW_MMAP_STRUCT_CNT;
g_mmapInfos = ( struct mmapInfos* )realloc( g_mmapInfos,
g_maxMMapInfos * sizeof( struct mmapInfos ) );
}
memcpy( &g_mmapInfos[g_curMMapInfos], &mmi, sizeof( struct mmapInfos) );
g_curMMapInfos++;
LeaveCriticalSection( &cs );
return mmi.start;
}
int munmap(void *start, size_t length)
{
int i, j;
for( i = 0; i < g_curMMapInfos; i++ ) {
if( g_mmapInfos[i].start == start )
break;
}
if( i == g_curMMapInfos ) {
_set_errno( EINVAL );
return -1;
}
UnmapViewOfFile( g_mmapInfos[i].start );
CloseHandle( g_mmapInfos[i].hMap );
CloseHandle( g_mmapInfos[i].hFile );
EnterCriticalSection( &cs );
for( j = i + 1; j < g_curMMapInfos; j++ ) {
memcpy( &g_mmapInfos[ j - 1 ], &g_mmapInfos[ j ],
sizeof( struct mmapInfos ) );
}
g_curMMapInfos--;
if( g_curMMapInfos == 0 ) {
free( g_mmapInfos );
g_mmapInfos = NULL;
g_maxMMapInfos = 0;
}
LeaveCriticalSection( &cs );
return 0;
}

Binary file not shown.

@ -0,0 +1,399 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="7.10"
Name="tiff-test"
ProjectGUID="{2F4235D0-B5F5-4C59-981D-BA006734B56E}"
RootNamespace="tiff-test"
Keyword="Win32Proj"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Debug|Win32"
OutputDirectory="Debug"
IntermediateDirectory="Debug"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include;../include/exiv2;../../xmpsdk/include;../../xmpsdk/src;../../../expat-2.0.1/lib;../../../zlib-1.2.3;"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="1"
BufferSecurityCheck="true"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
BrowseInformation="1"
WarningLevel="3"
WarnAsError="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkLibraryDependencies="true"
AdditionalOptions="/NODEFAULTLIB:MSVCRTD"
AdditionalDependencies="..\exiv2lib\$(ConfigurationName)\exiv2.lib ..\..\..\expat-2.0.1\win32\bin\debug\libexpatMT.lib ..\xmpsdk\$(ConfigurationName)\xmpsdk.lib ..\..\..\zlib-1.2.3\projects\visualc6\Win32_LIB_Debug\zlibd.lib"
OutputFile="$(OutDir)/tiff-test.exe"
LinkIncremental="1"
AdditionalLibraryDirectories=""
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/tiff-test.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="copy target to bin"
CommandLine="copy/y &quot;$(TargetPath)&quot; &quot;$(SolutionDir)\bin\$(ConfigurationName)&quot;"
/>
</Configuration>
<Configuration
Name="Release|Win32"
OutputDirectory="Release"
IntermediateDirectory="Release"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine=""
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalIncludeDirectories="../include;../include/exiv2;../../xmpsdk/include;../../xmpsdk/src;../../../expat-2.0.1/lib;../../../zlib-1.2.3;"
PreprocessorDefinitions="WIN32;_NDEBUG;_CONSOLE"
RuntimeLibrary="0"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
BrowseInformation="1"
WarningLevel="3"
WarnAsError="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
LinkLibraryDependencies="true"
AdditionalOptions="/NODEFAULTLIB:MSVCRT"
AdditionalDependencies="..\exiv2lib\$(ConfigurationName)\exiv2.lib ..\..\..\expat-2.0.1\win32\bin\release\libexpatMT.lib ..\xmpsdk\$(ConfigurationName)\xmpsdk.lib ..\..\..\zlib-1.2.3\projects\visualc6\Win32_LIB_Release\zlib.lib"
LinkIncremental="1"
GenerateDebugInformation="false"
SubSystem="1"
OptimizeReferences="2"
EnableCOMDATFolding="2"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="copy target to bin"
CommandLine="copy/y &quot;$(TargetPath)&quot; &quot;$(SolutionDir)\bin\$(ConfigurationName)&quot;"
/>
</Configuration>
<Configuration
Name="DebugDLL|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
Description="copy expat dll"
CommandLine="copy/y ..\..\..\expat-2.0.1\win32\bin\debug\*.dll &quot;$(TargetDir)&quot;"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include;../include/exiv2;../../xmpsdk/include;../../xmpsdk/src;../../../expat-2.0.1/lib;../../../zlib-1.2.3;"
PreprocessorDefinitions="WIN32;_DEBUG;_CONSOLE;EXV_HAVE_DLL"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
BufferSecurityCheck="true"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
BrowseInformation="1"
WarningLevel="3"
WarnAsError="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
Description="copy the dlls"
CommandLine="copy/y ..\exiv2lib\$(ConfigurationName)\*.dll &quot;$(TargetDir)&quot;"
/>
<Tool
Name="VCLinkerTool"
LinkLibraryDependencies="true"
AdditionalOptions="/NODEFAULTLIB:LIBCMTD"
AdditionalDependencies="..\exiv2lib\$(ConfigurationName)\exiv2.lib ..\..\..\expat-2.0.1\win32\bin\release\libexpat.lib ..\xmpsdk\$(ConfigurationName)\xmpsdk.lib ..\..\..\zlib-1.2.3\projects\visualc6\Win32_DLL_Debug\zlib1d.lib"
OutputFile="$(OutDir)/tiff-test.exe"
LinkIncremental="1"
GenerateDebugInformation="true"
ProgramDatabaseFile="$(OutDir)/tiff-test.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="copy target to bin"
CommandLine="copy/y &quot;$(TargetPath)&quot; &quot;$(SolutionDir)\bin\$(ConfigurationName)&quot;"
/>
</Configuration>
<Configuration
Name="ReleaseDLL|Win32"
OutputDirectory="$(ConfigurationName)"
IntermediateDirectory="$(ConfigurationName)"
ConfigurationType="1"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
Description="copy expat dll"
CommandLine="copy/y ..\..\..\expat-2.0.1\win32\bin\release\*.dll &quot;$(TargetDir)&quot;"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../include;../include/exiv2;../../xmpsdk/include;../../xmpsdk/src;../../../expat-2.0.1/lib;../../../zlib-1.2.3;"
PreprocessorDefinitions="WIN32;_NDEBUG;_CONSOLE;EXV_HAVE_DLL"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="2"
BufferSecurityCheck="true"
RuntimeTypeInfo="true"
UsePrecompiledHeader="0"
BrowseInformation="1"
WarningLevel="3"
WarnAsError="true"
DebugInformationFormat="3"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
/>
<Tool
Name="VCPreLinkEventTool"
Description="copy the dlls"
CommandLine="copy/y ..\exiv2lib\$(ConfigurationName)\*.dll &quot;$(TargetDir)&quot;"
/>
<Tool
Name="VCLinkerTool"
LinkLibraryDependencies="true"
AdditionalOptions="/NODEFAULTLIB:LIBCMT"
AdditionalDependencies="..\exiv2lib\$(ConfigurationName)\exiv2.lib ..\..\..\expat-2.0.1\win32\bin\debug\libexpat.lib ..\xmpsdk\$(ConfigurationName)\xmpsdk.lib ..\..\..\zlib-1.2.3\projects\visualc6\Win32_DLL_Release\zlib1.lib"
OutputFile="$(OutDir)/tiff-test.exe"
LinkIncremental="1"
GenerateDebugInformation="false"
ProgramDatabaseFile="$(OutDir)/tiff-test.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCPostBuildEventTool"
Description="copy target to bin"
CommandLine="copy/y &quot;$(TargetPath)&quot; &quot;$(SolutionDir)\bin\$(ConfigurationName)&quot;"
/>
</Configuration>
</Configurations>
<References>
</References>
<Files>
<Filter
Name="Source Files"
Filter="cpp;c;cxx;def;odl;idl;hpj;bat;asm;asmx"
UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
>
<File
RelativePath="..\..\samples\tiff-test.cpp"
>
</File>
</Filter>
<Filter
Name="Header Files"
Filter="h;hpp;hxx;hm;inl;inc;xsd"
UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"
>
</Filter>
<Filter
Name="Resource Files"
Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx"
UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"
>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>

@ -0,0 +1,52 @@
# CMake build system for exiv2 library and executables
# Copyright 2008 by Patrick Spendrin <ps_ml@gmx.de>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# 3. The name of the author may not be used to endorse or promote
# products derived from this software without specific prior
# written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
set( SAMPLES addmoddel.cpp
exifcomment.cpp
exifdata-test.cpp
exifprint.cpp
iotest.cpp
iptceasy.cpp
iptcprint.cpp
iptctest.cpp
key-test.cpp
largeiptc-test.cpp
write-test.cpp
write2-test.cpp
xmpparse.cpp
xmpparser-test.cpp
xmpsample.cpp )
foreach(entry ${SAMPLES})
STRING( REPLACE ".cpp" "" target ${entry})
add_executable( ${target} ${target}.cpp )
add_test( ${target}_test ${target} )
target_link_libraries(${target} exiv2 )
endforeach(entry ${SAMPLES})

@ -66,6 +66,7 @@ BINSRC = addmoddel.cpp \
iptctest.cpp \
key-test.cpp \
largeiptc-test.cpp \
mmap-test.cpp \
prevtest.cpp \
stringto-test.cpp \
tiff-test.cpp \

@ -0,0 +1,43 @@
// ***************************************************************** -*- C++ -*-
// mmap-test.cpp, $Rev$
// Simple mmap tests
#include <exiv2/basicio.hpp>
#include <exiv2/error.hpp>
#include <exiv2/futils.hpp>
#include <iostream>
#include <cstring>
using namespace Exiv2;
int main(int argc, char* const argv[])
try {
if (argc != 2) {
std::cout << "Usage: " << argv[0] << " file\n";
return 1;
}
const char* path = argv[1];
FileIo file(path);
// Open the file in read mode
if (file.open("rb") != 0) {
throw Error(10, path, "rb", strError());
}
// Map it to memory
const byte* pData = file.mmap();
long size = file.size();
DataBuf buf(size);
// Read from the memory mapped region
memcpy(buf.pData_, pData, buf.size_);
// Reopen file in write mode and write to it
file.write(buf.pData_, buf.size_);
// Read from the mapped region again
memcpy(buf.pData_, pData, buf.size_);
file.close();
return 0;
}
catch (const AnyError& e) {
std::cout << e << "\n";
}

@ -148,6 +148,20 @@ try {
write(file, edMn9);
print(file);
std::cout <<"\n----- Minolta MakerNote tags\n";
Exiv2::ExifData edMn10;
edMn10["Exif.Image.Make"] = "Minolta";
edMn10["Exif.Image.Model"] = "A fancy Minolta camera";
edMn10["Exif.Minolta.ColorMode"] = uint32_t(1);
edMn10["Exif.MinoltaCsNew.WhiteBalance"] = uint32_t(2);
edMn10["Exif.MinoltaCs5D.WhiteBalance"] = uint16_t(3);
edMn10["Exif.MinoltaCs5D.ColorTemperature"] = int16_t(-1);
edMn10["Exif.MinoltaCs7D.WhiteBalance"] = uint16_t(4);
edMn10["Exif.MinoltaCs7D.ExposureCompensation"] = int16_t(-2);
edMn10["Exif.MinoltaCs7D.ColorTemperature"] = int16_t(-3);
write(file, edMn10);
print(file);
std::cout <<"\n----- One IOP tag\n";
Exiv2::ExifData ed3;
ed3["Exif.Iop.InteroperabilityIndex"] = "Test 3";

@ -0,0 +1,224 @@
# CMake build system for exiv2 library and executables
# Copyright 2008 by Patrick Spendrin <ps_ml@gmx.de>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# 1. Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above
# copyright notice, this list of conditions and the following
# disclaimer in the documentation and/or other materials provided
# with the distribution.
# 3. The name of the author may not be used to endorse or promote
# products derived from this software without specific prior
# written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
# GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
# INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
# IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
# IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#
# Private headers which are only needed for the library itself
set( LIBEXIV2_PRIVATE_HDR cr2image_int.hpp
crwimage_int.hpp
makernote_int.hpp
orfimage_int.hpp
pngchunk_int.hpp
rw2image_int.hpp
tiffcomposite_int.hpp
tifffwd_int.hpp
tiffimage_int.hpp
tiffvisitor_int.hpp
)
# Add standalone C++ header files to this list
set( LIBEXIV2_HDR basicio.hpp
bmpimage.hpp
canonmn.hpp
convert.hpp
cr2image.hpp
crwimage.hpp
datasets.hpp
easyaccess.hpp
error.hpp
exif.hpp
fujimn.hpp
futils.hpp
gifimage.hpp
image.hpp
iptc.hpp
jp2image.hpp
jpgimage.hpp
metadatum.hpp
minoltamn.hpp
mn.hpp
mrwimage.hpp
nikonmn.hpp
olympusmn.hpp
orfimage.hpp
panasonicmn.hpp
pentaxmn.hpp
pgfimage.hpp
pngimage.hpp
preview.hpp
properties.hpp
psdimage.hpp
rafimage.hpp
rcsid.hpp
rw2image.hpp
sigmamn.hpp
sonymn.hpp
tags.hpp
tgaimage.hpp
tiffimage.hpp
types.hpp
value.hpp
version.hpp
xmp.hpp
xmpsidecar.hpp )
# Add library C++ source files to this list
set( LIBEXIV2_SRC basicio.cpp
bmpimage.cpp
canonmn.cpp
convert.cpp
cr2image.cpp
crwedit.cpp
crwimage.cpp
datasets.cpp
easyaccess.cpp
error.cpp
exif.cpp
futils.cpp
fujimn.cpp
gifimage.cpp
image.cpp
iptc.cpp
jp2image.cpp
jpgimage.cpp
makernote.cpp
metadatum.cpp
minoltamn.cpp
mrwimage.cpp
nikonmn.cpp
olympusmn.cpp
orfimage.cpp
panasonicmn.cpp
pentaxmn.cpp
pgfimage.cpp
preview.cpp
properties.cpp
psdimage.cpp
rafimage.cpp
rw2image.cpp
sigmamn.cpp
sonymn.cpp
tags.cpp
tgaimage.cpp
tiffcomposite.cpp
tiffimage.cpp
tiffvisitor.cpp
types.cpp
value.cpp
version.cpp
xmp.cpp
xmpsidecar.cpp )
# Add source files of simple applications to this list
set( TAGLIST_SRC taglist.cpp )
# Source files for the Exiv2 application
set( EXIV2_SRC exiv2.cpp
actions.cpp
utils.cpp )
# Source files for the metacopy sample application
set( MC_SRC metacopy.cpp
utils.cpp )
if( EXIV2_ENABLE_PNG )
if( ZLIB_FOUND )
set( LIBEXIV2_SRC ${LIBEXIV2_SRC} pngchunk.cpp
pngimage.cpp )
endif( ZLIB_FOUND )
endif( EXIV2_ENABLE_PNG )
if(NOT HAVE_TIMEGM )
set( LIBEXIV2_SRC ${LIBEXIV2_SRC} localtime.c )
set( EXIV2_SRC ${EXIV2_SRC} localtime.c )
endif( NOT HAVE_TIMEGM )
if( MSVC )
set( MC_SRC ${MC_SRC} getopt_win32.c )
set( EXIV2_SRC ${EXIV2_SRC} getopt_win32.c )
set( LIBEXIV2_SRC ${LIBEXIV2_SRC} getopt_win32.c )
endif( MSVC )
if( EXIV2_ENABLE_XMP )
if( NOT EXIV2_ENABLE_LIBXMP )
set( LIBEXIV2_SRC ${XMPSRC} ${LIBEXIV2_SRC} )
endif( NOT EXIV2_ENABLE_LIBXMP )
endif( EXIV2_ENABLE_XMP )
# ******************************************************************************
# Library
add_library( exiv2 ${STATIC_FLAG} ${LIBEXIV2_SRC} )
set_target_properties( exiv2 PROPERTIES VERSION ${GENERIC_LIB_VERSION}
SOVERSION ${GENERIC_LIB_SOVERSION}
DEFINE_SYMBOL EXV_BUILDING_LIB )
if( EXIV2_ENABLE_LIBXMP )
target_link_libraries( exiv2 ${XMPLIB} )
endif( EXIV2_ENABLE_LIBXMP )
target_link_libraries( exiv2 ${EXPAT_LIBRARIES} )
if( EXIV2_ENABLE_PNG )
if( ZLIB_FOUND )
target_link_libraries( exiv2 ${ZLIB_LIBRARIES} )
endif( ZLIB_FOUND )
endif( EXIV2_ENABLE_PNG )
if( EXIV2_ENABLE_NLS )
target_link_libraries( exiv2 ${LIBINTL_LIBRARIES} )
endif( EXIV2_ENABLE_NLS )
if( ICONV_TEST )
target_link_libraries( exiv2 ${ICONV_LIBRARIES} )
message ( "----------------> ICONV_LIBRARIES : " ${ICONV_LIBRARIES} )
endif( ICONV_TEST )
install( TARGETS exiv2 ${INSTALL_TARGET_STANDARD_ARGS} )
# ******************************************************************************
# Binary
add_executable( exiv2bin ${EXIV2_SRC} )
set_target_properties( exiv2bin PROPERTIES OUTPUT_NAME exiv2 )
target_link_libraries( exiv2bin exiv2 )
install( TARGETS exiv2bin ${INSTALL_TARGET_STANDARD_ARGS} )
# ******************************************************************************
# Binary
add_executable( metacopy ${MC_SRC} )
target_link_libraries( metacopy exiv2 )
install( TARGETS metacopy ${INSTALL_TARGET_STANDARD_ARGS} )
# ******************************************************************************
# Binary
add_executable( taglist ${TAGLIST_SRC} )
target_link_libraries( taglist exiv2 )
install( TARGETS taglist ${INSTALL_TARGET_STANDARD_ARGS} )
# ******************************************************************************
# Headers
install( FILES ${LIBEXIV2_HDR} DESTINATION include/exiv2 )
# ******************************************************************************
# Man page
install( FILES exiv2.1 DESTINATION man/man1 )

@ -90,7 +90,8 @@ CCSRC = basicio.cpp \
nikonmn.cpp \
olympusmn.cpp \
orfimage.cpp \
panasonicmn.cpp
panasonicmn.cpp \
pgfimage.cpp
ifdef HAVE_LIBZ
CCSRC += pngimage.cpp \
pngchunk.cpp

@ -167,6 +167,10 @@ namespace {
// class member definitions
namespace Action {
Task::~Task()
{
}
Task::AutoPtr Task::clone() const
{
return AutoPtr(clone_());
@ -226,6 +230,10 @@ namespace Action {
return Task::AutoPtr(0);
} // TaskFactory::create
Print::~Print()
{
}
int Print::run(const std::string& path)
try {
path_ = path;
@ -293,7 +301,7 @@ namespace Action {
// Image number
// Todo: Image number for cameras other than Canon
printTag(exifData, "Exif.Canon.ImageNumber", _("Image number"));
printTag(exifData, "Exif.Canon.FileNumber", _("Image number"));
// Exposure time
// From ExposureTime, failing that, try ShutterSpeedValue
@ -705,6 +713,10 @@ namespace Action {
return new Print(*this);
}
Rename::~Rename()
{
}
int Rename::run(const std::string& path)
{
try {
@ -790,6 +802,10 @@ namespace Action {
return new Rename(*this);
}
Erase::~Erase()
{
}
int Erase::run(const std::string& path)
try {
path_ = path;
@ -906,6 +922,10 @@ namespace Action {
return new Erase(*this);
}
Extract::~Extract()
{
}
int Extract::run(const std::string& path)
try {
path_ = path;
@ -1044,6 +1064,10 @@ namespace Action {
return new Extract(*this);
}
Insert::~Insert()
{
}
int Insert::run(const std::string& path)
try {
if (!Exiv2::fileExists(path, true)) {
@ -1143,6 +1167,10 @@ namespace Action {
return new Insert(*this);
}
Modify::~Modify()
{
}
int Modify::run(const std::string& path)
{
try {
@ -1378,6 +1406,10 @@ namespace Action {
return new Modify(*this);
}
Adjust::~Adjust()
{
}
int Adjust::run(const std::string& path)
try {
adjustment_ = Params::instance().adjustment_;
@ -1514,6 +1546,10 @@ namespace Action {
return 0;
} // Adjust::adjustDateTime
FixIso::~FixIso()
{
}
int FixIso::run(const std::string& path)
{
try {
@ -1535,37 +1571,15 @@ namespace Action {
<< ": " << _("No Exif data found in the file\n");
return -3;
}
// Check if the standard tag exists
Exiv2::ExifKey key("Exif.Photo.ISOSpeedRatings");
Exiv2::ExifData::iterator md = exifData.findKey(key);
Exiv2::ExifData::const_iterator md = Exiv2::isoSpeed(exifData);
if (md != exifData.end()) {
if (Params::instance().verbose_) {
std::cout << _("Standard Exif ISO tag exists; not modified\n");
if (strcmp(md->key().c_str(), "Exif.Photo.ISOSpeedRatings") == 0) {
if (Params::instance().verbose_) {
std::cout << _("Standard Exif ISO tag exists; not modified\n");
}
return 0;
}
return 0;
}
// Fix Nikon ISO setting
key = Exiv2::ExifKey("Exif.Nikon3.ISOSpeed");
md = exifData.findKey(key);
if (md == exifData.end()) {
key = Exiv2::ExifKey("Exif.Nikon2.ISOSpeed");
md = exifData.findKey(key);
}
if (md == exifData.end()) {
key = Exiv2::ExifKey("Exif.Nikon1.ISOSpeed");
md = exifData.findKey(key);
}
// Canon has a similar bad habit, fix that too
if (md == exifData.end()) {
key = Exiv2::ExifKey("Exif.CanonSi.ISOSpeed");
md = exifData.findKey(key);
}
if (md == exifData.end()) {
key = Exiv2::ExifKey("Exif.CanonCs.ISOSpeed");
md = exifData.findKey(key);
}
// Copy the proprietary tag to the standard place
if (md != exifData.end()) {
// Copy the proprietary tag to the standard place
std::ostringstream os;
md->write(os, &exifData);
if (Params::instance().verbose_) {

@ -77,7 +77,7 @@ namespace Action {
//! Shortcut for an auto pointer.
typedef std::auto_ptr<Task> AutoPtr;
//! Virtual destructor.
virtual ~Task() {}
virtual ~Task();
//! Virtual copy construction.
AutoPtr clone() const;
/*!
@ -157,7 +157,7 @@ namespace Action {
//! %Print the Exif (or other metadata) of a file to stdout
class Print : public Task {
public:
virtual ~Print() {}
virtual ~Print();
virtual int run(const std::string& path);
typedef std::auto_ptr<Print> AutoPtr;
AutoPtr clone() const;
@ -208,7 +208,7 @@ namespace Action {
*/
class Rename : public Task {
public:
virtual ~Rename() {}
virtual ~Rename();
virtual int run(const std::string& path);
typedef std::auto_ptr<Rename> AutoPtr;
AutoPtr clone() const;
@ -220,7 +220,7 @@ namespace Action {
//! %Adjust the Exif (or other metadata) timestamps
class Adjust : public Task {
public:
virtual ~Adjust() {}
virtual ~Adjust();
virtual int run(const std::string& path);
typedef std::auto_ptr<Adjust> AutoPtr;
AutoPtr clone() const;
@ -243,7 +243,7 @@ namespace Action {
*/
class Erase : public Task {
public:
virtual ~Erase() {}
virtual ~Erase();
virtual int run(const std::string& path);
typedef std::auto_ptr<Erase> AutoPtr;
AutoPtr clone() const;
@ -280,7 +280,7 @@ namespace Action {
*/
class Extract : public Task {
public:
virtual ~Extract() {}
virtual ~Extract();
virtual int run(const std::string& path);
typedef std::auto_ptr<Extract> AutoPtr;
AutoPtr clone() const;
@ -315,7 +315,7 @@ namespace Action {
*/
class Insert : public Task {
public:
virtual ~Insert() {}
virtual ~Insert();
virtual int run(const std::string& path);
typedef std::auto_ptr<Insert> AutoPtr;
AutoPtr clone() const;
@ -344,7 +344,7 @@ namespace Action {
*/
class Modify : public Task {
public:
virtual ~Modify() {}
virtual ~Modify();
virtual int run(const std::string& path);
typedef std::auto_ptr<Modify> AutoPtr;
AutoPtr clone() const;
@ -377,7 +377,7 @@ namespace Action {
*/
class FixIso : public Task {
public:
virtual ~FixIso() {}
virtual ~FixIso();
virtual int run(const std::string& path);
typedef std::auto_ptr<FixIso> AutoPtr;
AutoPtr clone() const;

@ -69,43 +69,77 @@ EXIV2_RCSID("@(#) $Id$")
// class member definitions
namespace Exiv2 {
BasicIo::~BasicIo()
{
}
FileIo::FileIo(const std::string& path)
: path_(path), fp_(0), opMode_(opSeek),
pMappedArea_(0), mappedLength_(0), isMalloced_(false)
: path_(path),
#ifdef EXV_UNICODE_PATH
wpMode_(wpStandard),
#endif
fp_(0), opMode_(opSeek),
pMappedArea_(0), mappedLength_(0), isMalloced_(false), isWriteable_(false)
{
}
#ifdef EXV_UNICODE_PATH
FileIo::FileIo(const std::wstring& wpath)
: wpath_(wpath),
wpMode_(wpUnicode),
fp_(0), opMode_(opSeek),
pMappedArea_(0), mappedLength_(0), isMalloced_(false), isWriteable_(false)
{
}
#endif
FileIo::~FileIo()
{
munmap();
close();
}
void FileIo::munmap()
int FileIo::munmap()
{
int rc = 0;
if (pMappedArea_ != 0) {
#if defined EXV_HAVE_MMAP && defined EXV_HAVE_MUNMAP
if (::munmap(pMappedArea_, mappedLength_) != 0) {
throw Error(2, path_, strError(), "munmap");
rc = 1;
}
#else
if (isWriteable_) {
write(pMappedArea_, mappedLength_);
}
if (isMalloced_) {
delete[] pMappedArea_;
isMalloced_ = false;
}
#endif
}
if (isWriteable_) {
if (fp_ != 0) switchMode(opRead);
isWriteable_ = false;
}
pMappedArea_ = 0;
mappedLength_ = 0;
return rc;
}
const byte* FileIo::mmap()
byte* FileIo::mmap(bool isWriteable)
{
assert(fp_ != 0);
munmap();
if (munmap() != 0) {
throw Error(2, path_, strError(), "munmap");
}
mappedLength_ = size();
isWriteable_ = isWriteable;
#if defined EXV_HAVE_MMAP && defined EXV_HAVE_MUNMAP
void* rc = ::mmap(0, mappedLength_, PROT_READ, MAP_SHARED, fileno(fp_), 0);
int prot = PROT_READ;
if (isWriteable_) {
prot |= PROT_WRITE;
if (switchMode(opWrite) != 0) return 0;
}
void* rc = ::mmap(0, mappedLength_, prot, MAP_SHARED, fileno(fp_), 0);
if (MAP_FAILED == rc) {
throw Error(2, path_, strError(), "mmap");
}
@ -121,18 +155,53 @@ namespace Exiv2 {
return pMappedArea_;
}
int FileIo::stat(StructStat& buf) const
{
int ret = 0;
#ifdef EXV_UNICODE_PATH
if (wpMode_ == wpUnicode) {
struct _stat st;
ret = ::_wstat(wpath_.c_str(), &st);
if (0 == ret) {
buf.st_size = st.st_size;
buf.st_mode = st.st_mode;
}
}
else
#endif
{
struct stat st;
ret = ::stat(path_.c_str(), &st);
if (0 == ret) {
buf.st_size = st.st_size;
buf.st_mode = st.st_mode;
}
}
return ret;
}
BasicIo::AutoPtr FileIo::temporary() const
{
BasicIo::AutoPtr basicIo;
struct stat buf;
int ret = stat(path_.c_str(), &buf);
StructStat buf;
int ret = stat(buf);
// If file is > 1MB then use a file, otherwise use memory buffer
if (ret != 0 || buf.st_size > 1048576) {
pid_t pid = ::getpid();
std::string tmpname = path_ + toString(pid);
std::auto_ptr<FileIo> fileIo(new FileIo(tmpname));
std::auto_ptr<FileIo> fileIo;
#ifdef EXV_UNICODE_PATH
if (wpMode_ == wpUnicode) {
std::wstring tmpname = wpath_ + s2ws(toString(pid));
fileIo = std::auto_ptr<FileIo>(new FileIo(tmpname));
}
else
#endif
{
std::string tmpname = path_ + toString(pid);
fileIo = std::auto_ptr<FileIo>(new FileIo(tmpname));
}
if (fileIo->open("w+b") != 0) {
throw Error(10, path_, "w+b", strError());
}
@ -181,7 +250,15 @@ namespace Exiv2 {
// Reopen the file
long offset = std::ftell(fp_);
if (offset == -1) return -1;
if (open("r+b") != 0) return 1;
// 'Manual' open("r+b") to avoid munmap()
if (fp_ != 0) {
std::fclose(fp_);
fp_= 0;
}
openMode_ = "r+b";
opMode_ = opSeek;
fp_ = std::fopen(path_.c_str(), openMode_.c_str());
if (!fp_) return 1;
return std::fseek(fp_, offset, SEEK_SET);
}
@ -227,70 +304,128 @@ namespace Exiv2 {
// Check if the file can be written to, if it already exists
if (open("w+b") != 0) {
// Remove the (temporary) file
std::remove(fileIo->path_.c_str());
#ifdef EXV_UNICODE_PATH
if (fileIo->wpMode_ == wpUnicode) {
::_wremove(fileIo->wpath_.c_str());
}
else
#endif
{
::remove(fileIo->path_.c_str());
}
throw Error(10, path_, "w+b", strError());
}
close();
bool statOk = true;
struct stat buf1;
char* pf = const_cast<char*>(path_.c_str());
mode_t origStMode = 0;
char* pf = 0;
#ifdef EXV_UNICODE_PATH
wchar_t* wpf = 0;
if (wpMode_ == wpUnicode) {
wpf = const_cast<wchar_t*>(wpath_.c_str());
}
else
#endif
{
pf = const_cast<char*>(path_.c_str());
}
// Get the permissions of the file, or linked-to file, on platforms which have lstat
#ifdef EXV_HAVE_LSTAT
# ifdef EXV_UNICODE_PATH
# error EXV_UNICODE_PATH and EXV_HAVE_LSTAT are not compatible. Stop.
# endif
struct stat buf1;
if (::lstat(pf, &buf1) == -1) {
statOk = false;
#ifndef SUPPRESS_WARNINGS
std::cerr << "Warning: " << Error(2, pf, strError(), "lstat") << "\n";
std::cerr << "Warning: " << Error(2, pf, strError(), "::lstat") << "\n";
#endif
}
origStMode = buf1.st_mode;
DataBuf lbuf; // So that the allocated memory is freed. Must have same scope as pf
// In case path_ is a symlink, get the path of the linked-to file
if (statOk && S_ISLNK(buf1.st_mode)) {
lbuf.alloc(buf1.st_size + 1);
memset(lbuf.pData_, 0x0, lbuf.size_);
pf = reinterpret_cast<char*>(lbuf.pData_);
if (readlink(path_.c_str(), pf, lbuf.size_ - 1) == -1) {
if (::readlink(path_.c_str(), pf, lbuf.size_ - 1) == -1) {
throw Error(2, path_, strError(), "readlink");
}
// We need the permissions of the file, not the symlink
if (::stat(pf, &buf1) == -1) {
statOk = false;
#ifndef SUPPRESS_WARNINGS
std::cerr << "Warning: " << Error(2, pf, strError(), "stat") << "\n";
std::cerr << "Warning: " << Error(2, pf, strError(), "::stat") << "\n";
#endif
}
origStMode = buf1.st_mode;
}
#else
if (::stat(pf, &buf1) == -1) {
#else // EXV_HAVE_LSTAT
StructStat buf1;
if (stat(buf1) == -1) {
statOk = false;
#ifndef SUPPRESS_WARNINGS
std::cerr << "Warning: " << Error(2, pf, strError(), "stat") << "\n";
#endif
}
origStMode = buf1.st_mode;
#endif // !EXV_HAVE_LSTAT
// MSVCRT rename that does not overwrite existing files
if (fileExists(pf) && std::remove(pf) != 0) {
throw Error(2, pf, strError(), "std::remove");
}
if (std::rename(fileIo->path_.c_str(), pf) == -1) {
throw Error(17, fileIo->path_, pf, strError());
}
std::remove(fileIo->path_.c_str());
// Check permissions of new file
struct stat buf2;
if (statOk && ::stat(pf, &buf2) == -1) {
statOk = false;
#ifdef EXV_UNICODE_PATH
if (wpMode_ == wpUnicode) {
if (fileExists(wpf) && ::_wremove(wpf) != 0) {
throw Error(2, wpf, strError(), "::_wremove");
}
if (::_wrename(fileIo->wpath_.c_str(), wpf) == -1) {
throw Error(17, ws2s(fileIo->wpath_), wpf, strError());
}
::_wremove(fileIo->wpath_.c_str());
// Check permissions of new file
struct _stat buf2;
if (statOk && ::_wstat(wpf, &buf2) == -1) {
statOk = false;
#ifndef SUPPRESS_WARNINGS
std::cerr << "Warning: " << Error(2, pf, strError(), "stat") << "\n";
std::cerr << "Warning: " << Error(2, wpf, strError(), "::_wstat") << "\n";
#endif
}
if (statOk && buf1.st_mode != buf2.st_mode) {
// Set original file permissions
if (::chmod(pf, buf1.st_mode) == -1) {
}
if (statOk && origStMode != buf2.st_mode) {
// Set original file permissions
if (::_wchmod(wpf, origStMode) == -1) {
#ifndef SUPPRESS_WARNINGS
std::cerr << "Warning: " << Error(2, pf, strError(), "chmod") << "\n";
std::cerr << "Warning: " << Error(2, wpf, strError(), "::_wchmod") << "\n";
#endif
}
}
} // if (wpMode_ == wpUnicode)
else
#endif // EXV_UNICODE_PATH
{
if (fileExists(pf) && ::remove(pf) != 0) {
throw Error(2, pf, strError(), "::remove");
}
if (::rename(fileIo->path_.c_str(), pf) == -1) {
throw Error(17, fileIo->path_, pf, strError());
}
::remove(fileIo->path_.c_str());
// Check permissions of new file
struct stat buf2;
if (statOk && ::stat(pf, &buf2) == -1) {
statOk = false;
#ifndef SUPPRESS_WARNINGS
std::cerr << "Warning: " << Error(2, pf, strError(), "::stat") << "\n";
#endif
}
if (statOk && origStMode != buf2.st_mode) {
// Set original file permissions
if (::chmod(pf, origStMode) == -1) {
#ifndef SUPPRESS_WARNINGS
std::cerr << "Warning: " << Error(2, pf, strError(), "::chmod") << "\n";
#endif
}
}
}
}
} // if (fileIo)
else {
// Generic handling, reopen both to reset to start
if (open("w+b") != 0) {
@ -353,8 +488,8 @@ namespace Exiv2 {
#endif
}
struct stat buf;
int ret = ::stat(path_.c_str(), &buf);
StructStat buf;
int ret = stat(buf);
if (ret != 0) return -1;
return buf.st_size;
@ -368,13 +503,18 @@ namespace Exiv2 {
int FileIo::open(const std::string& mode)
{
if (fp_ != 0) {
std::fclose(fp_);
}
close();
openMode_ = mode;
opMode_ = opSeek;
fp_ = std::fopen(path_.c_str(), mode.c_str());
#ifdef EXV_UNICODE_PATH
if (wpMode_ == wpUnicode) {
fp_ = ::_wfopen(wpath_.c_str(), s2ws(mode).c_str());
}
else
#endif
{
fp_ = ::fopen(path_.c_str(), mode.c_str());
}
if (!fp_) return 1;
return 0;
}
@ -386,11 +526,13 @@ namespace Exiv2 {
int FileIo::close()
{
int rc = 0;
if (munmap() != 0) rc = 2;
if (fp_ != 0) {
std::fclose(fp_);
if (std::fclose(fp_) != 0) rc |= 1;
fp_= 0;
}
return 0;
return rc;
}
DataBuf FileIo::read(long rcount)
@ -429,9 +571,24 @@ namespace Exiv2 {
std::string FileIo::path() const
{
#ifdef EXV_UNICODE_PATH
if (wpMode_ == wpUnicode) {
return ws2s(wpath_);
}
#endif
return path_;
}
#ifdef EXV_UNICODE_PATH
std::wstring FileIo::wpath() const
{
if (wpMode_ == wpStandard) {
return s2ws(path_);
}
return wpath_;
}
#endif
MemIo::MemIo()
: data_(0),
idx_(0),
@ -568,6 +725,16 @@ namespace Exiv2 {
return 0;
}
byte* MemIo::mmap(bool /*isWriteable*/)
{
return data_;
}
int MemIo::munmap()
{
return 0;
}
long MemIo::tell() const
{
return idx_;
@ -637,6 +804,13 @@ namespace Exiv2 {
return "MemIo";
}
#ifdef EXV_UNICODE_PATH
std::wstring MemIo::wpath() const
{
return EXV_WIDEN("MemIo");
}
#endif
// *************************************************************************
// free functions
@ -648,7 +822,7 @@ namespace Exiv2 {
}
struct stat st;
if (0 != ::stat(path.c_str(), &st)) {
throw Error(2, path, strError(), "stat");
throw Error(2, path, strError(), "::stat");
}
DataBuf buf(st.st_size);
long len = file.read(buf.pData_, buf.size_);
@ -658,6 +832,26 @@ namespace Exiv2 {
return buf;
}
#ifdef EXV_UNICODE_PATH
DataBuf readFile(const std::wstring& wpath)
{
FileIo file(wpath);
if (file.open("rb") != 0) {
throw Error(10, ws2s(wpath), "rb", strError());
}
struct _stat st;
if (0 != ::_wstat(wpath.c_str(), &st)) {
throw Error(2, ws2s(wpath), strError(), "::_wstat");
}
DataBuf buf(st.st_size);
long len = file.read(buf.pData_, buf.size_);
if (len != buf.size_) {
throw Error(2, ws2s(wpath), strError(), "FileIo::read");
}
return buf;
}
#endif
long writeFile(const DataBuf& buf, const std::string& path)
{
FileIo file(path);
@ -667,4 +861,15 @@ namespace Exiv2 {
return file.write(buf.pData_, buf.size_);
}
#ifdef EXV_UNICODE_PATH
long writeFile(const DataBuf& buf, const std::wstring& wpath)
{
FileIo file(wpath);
if (file.open("wb") != 0) {
throw Error(10, ws2s(wpath), "wb", strError());
}
return file.write(buf.pData_, buf.size_);
}
#endif
} // namespace Exiv2

@ -37,6 +37,13 @@
#include <string>
#include <memory>
#include <cstdio>
#include <sys/types.h>
#include <sys/stat.h>
// MSVC doesn't provide mode_t
#ifdef _MSC_VER
typedef unsigned short mode_t;
#endif
// *****************************************************************************
// namespace extensions
@ -63,7 +70,7 @@ namespace Exiv2 {
//! @name Creators
//@{
//! Destructor
virtual ~BasicIo() {}
virtual ~BasicIo();
//@}
//! @name Manipulators
@ -173,17 +180,21 @@ namespace Exiv2 {
virtual int seek(long offset, Position pos) = 0;
/*!
@brief Direct access to the IO data. For files, this is done by
mapping the file into the process's address space; for
memory blocks, this allows direct access to the memory
block.
Todo: This is currently only for read access.
mapping the file into the process's address space; for memory
blocks, this allows direct access to the memory block.
@param isWriteable Set to true if the mapped area should be writeable
(default is false).
@return A pointer to the mapped area.
@throw Error In case of failure.
*/
virtual const byte* mmap() =0;
virtual byte* mmap(bool isWriteable =false) =0;
/*!
@brief Remove a mapping established with mmap().
@brief Remove a mapping established with mmap(). If the mapped area
is writeable, this ensures that changes are written back.
@return 0 if successful;<BR>
Nonzero if failure;
*/
virtual void munmap() =0;
virtual int munmap() =0;
//@}
//! @name Accessors
@ -212,6 +223,13 @@ namespace Exiv2 {
available.
*/
virtual std::string path() const =0;
#ifdef EXV_UNICODE_PATH
/*!
@brief Like path() but returns a unicode path in an std::wstring.
@note This function is only available on Windows.
*/
virtual std::wstring wpath() const =0;
#endif
/*!
@brief Returns a temporary data storage location. This is often
needed to rewrite an IO source.
@ -286,6 +304,14 @@ namespace Exiv2 {
@param path The full path of a file
*/
FileIo(const std::string& path);
#ifdef EXV_UNICODE_PATH
/*!
@brief Like FileIo(const std::string& path) but accepts a
unicode path in an std::wstring.
@note This constructor is only available on Windows.
*/
FileIo(const std::wstring& wpath);
#endif
//! Destructor. Flushes and closes an open file.
virtual ~FileIo();
//@}
@ -409,13 +435,25 @@ namespace Exiv2 {
*/
virtual int seek(long offset, Position pos);
/*!
@brief Map the file into the process's address space. The file must
be open before mmap() is called.
@note The returned pointer is valid only as long as the MemIo object
is in scope.
@brief Map the file into the process's address space. The file must be
open before mmap() is called. If the mapped area is writeable,
changes may not be written back to the underlying file until
munmap() is called. The pointer is valid only as long as the
FileIo object exists.
@param isWriteable Set to true if the mapped area should be writeable
(default is false).
@return A pointer to the mapped area.
@throw Error In case of failure.
*/
virtual byte* mmap(bool isWriteable =false);
/*!
@brief Remove a mapping established with mmap(). If the mapped area is
writeable, this ensures that changes are written back to the
underlying file.
@return 0 if successful;<BR>
Nonzero if failure;
*/
virtual const byte* mmap();
virtual void munmap();
virtual int munmap();
//@}
//! @name Accessors
@ -441,6 +479,13 @@ namespace Exiv2 {
virtual bool eof() const;
//! Returns the path of the file
virtual std::string path() const;
#ifdef EXV_UNICODE_PATH
/*
@brief Like path() but returns the unicode path of the file in an std::wstring.
@note This function is only available on Windows.
*/
virtual std::wstring wpath() const;
#endif
/*!
@brief Returns a temporary data storage location. The actual type
returned depends upon the size of the file represented a FileIo
@ -462,9 +507,15 @@ namespace Exiv2 {
// Enumeration
enum OpMode { opRead, opWrite, opSeek };
#ifdef EXV_UNICODE_PATH
enum WpMode { wpStandard, wpUnicode };
#endif
// DATA
std::string path_;
#ifdef EXV_UNICODE_PATH
std::wstring wpath_;
WpMode wpMode_;
#endif
std::string openMode_;
FILE *fp_;
OpMode opMode_;
@ -472,6 +523,15 @@ namespace Exiv2 {
byte* pMappedArea_;
size_t mappedLength_;
bool isMalloced_; //!< Is the mapped area allocated?
bool isWriteable_; //!< Can the mapped area be written to?
// TYPES
//! Simple struct stat wrapper for internal use
struct StructStat {
StructStat() : st_mode(0), st_size(0) {}
mode_t st_mode; //!< Permissions
off_t st_size; //!< Size
};
// METHODS
/*!
@ -481,6 +541,8 @@ namespace Exiv2 {
@return 0 if successful
*/
EXV_DLLLOCAL int switchMode(OpMode opMode);
//! stat wrapper for internal use
EXV_DLLLOCAL int stat(StructStat& buf) const;
}; // class FileIo
@ -617,14 +679,14 @@ namespace Exiv2 {
virtual int seek(long offset, Position pos);
/*!
@brief Allow direct access to the underlying data buffer. The buffer
is not protected against write access except for the const
specifier.
is not protected against write access in any way, the argument
is ignored.
@note The application must ensure that the memory pointed to by the
returned pointer remains valid and allocated as long as the
MemIo object is in scope.
MemIo object exists.
*/
virtual const byte* mmap() { return data_; }
virtual void munmap() {}
virtual byte* mmap(bool /*isWriteable*/ =false);
virtual int munmap();
//@}
//! @name Accessors
@ -648,6 +710,13 @@ namespace Exiv2 {
virtual bool eof() const;
//! Returns a dummy path, indicating that memory access is used
virtual std::string path() const;
#ifdef EXV_UNICODE_PATH
/*
@brief Like path() but returns a unicode dummy path in an std::wstring.
@note This function is only available on Windows.
*/
virtual std::wstring wpath() const;
#endif
/*!
@brief Returns a temporary data storage location. Currently returns
an empty MemIo object, but callers should not rely on this
@ -679,11 +748,33 @@ namespace Exiv2 {
// *****************************************************************************
// template, inline and free functions
//! Read file \em path into a DataBuf, which is returned.
/*!
@brief Read file \em path into a DataBuf, which is returned.
@return Buffer containing the file.
@throw Error In case of failure.
*/
EXIV2API DataBuf readFile(const std::string& path);
//! Write DataBuf \em buf to file \em path. Return the number of bytes written.
#ifdef EXV_UNICODE_PATH
/*!
@brief Like readFile() but accepts a unicode path in an std::wstring.
@note This function is only available on Windows.
*/
EXIV2API DataBuf readFile(const std::wstring& wpath);
#endif
/*!
@brief Write DataBuf \em buf to file \em path.
@return Return the number of bytes written.
@throw Error In case of failure.
*/
EXIV2API long writeFile(const DataBuf& buf, const std::string& path);
#ifdef EXV_UNICODE_PATH
/*!
@brief Like writeFile() but accepts a unicode path in an std::wstring.
@note This function is only available on Windows.
*/
EXIV2API long writeFile(const DataBuf& buf, const std::wstring& wpath);
#endif
} // namespace Exiv2

@ -57,6 +57,11 @@ namespace Exiv2 {
{
} // BmpImage::BmpImage
std::string BmpImage::mimeType() const
{
return "image/x-ms-bmp";
}
void BmpImage::setExifData(const ExifData& /*exifData*/)
{
// Todo: implement me!

@ -109,7 +109,7 @@ namespace Exiv2 {
//! @name Accessors
//@{
std::string mimeType() const { return "image/x-ms-bmp"; }
std::string mimeType() const;
//@}
}; // class BmpImage

@ -19,12 +19,11 @@
* Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
*/
/*
File : canonmn.cpp
Version: $Rev$
Authors: Andreas Huggel (ahu) <ahuggel@gmx.net>
David Cannings (dc) <david@edeca.net>
Credits: EXIF MakerNote of Canon by David Burren <http://www.burren.cx/david/canon.html>
Canon makernote tags by Phil Harvey <http://www.sno.phy.queensu.ca/~phil/exiftool/TagNames/Canon.html>
File: canonmn.cpp
Version: $Rev$
Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net>
David Cannings (dc) <david@edeca.net>
Andi Clemens (ac) <andi.clemens@gmx.net>
*/
// *****************************************************************************
#include "rcsid.hpp"
@ -171,7 +170,7 @@ namespace Exiv2 {
TagInfo(0x0005, "Panorama", N_("Panorama"), N_("Panorama"), canonIfdId, makerTags, unsignedShort, printValue),
TagInfo(0x0006, "ImageType", N_("Image Type"), N_("Image type"), canonIfdId, makerTags, asciiString, printValue),
TagInfo(0x0007, "FirmwareVersion", N_("Firmware Version"), N_("Firmware version"), canonIfdId, makerTags, asciiString, printValue),
TagInfo(0x0008, "ImageNumber", N_("Image Number"), N_("Image number"), canonIfdId, makerTags, unsignedLong, print0x0008),
TagInfo(0x0008, "FileNumber", N_("File Number"), N_("File number"), canonIfdId, makerTags, unsignedLong, print0x0008),
TagInfo(0x0009, "OwnerName", N_("Owner Name"), N_("Owner Name"), canonIfdId, makerTags, asciiString, printValue),
TagInfo(0x000c, "SerialNumber", N_("Serial Number"), N_("Camera serial number"), canonIfdId, makerTags, unsignedLong, print0x000c),
TagInfo(0x000d, "0x000d", "0x000d", N_("Unknown"), canonIfdId, makerTags, unsignedShort, printValue),
@ -199,11 +198,12 @@ namespace Exiv2 {
//! Quality, tag 0x0003
extern const TagDetails canonCsQuality[] = {
{ 1, N_("Economy") },
{ 2, N_("Normal") },
{ 3, N_("Fine") },
{ 4, N_("RAW") },
{ 5, N_("Superfine") }
{ 1, N_("Economy") },
{ 2, N_("Normal") },
{ 3, N_("Fine") },
{ 4, N_("RAW") },
{ 5, N_("Superfine") },
{ 130, N_("Normal Movie") }
};
//! FlashMode, tag 0x0004
@ -376,6 +376,7 @@ namespace Exiv2 {
{ 6, "Sigma 18-50mm f/3.5-5.6 DC" }, // 1
{ 6, "Sigma 18-125mm f/3.5-5.6 DC IF ASP" }, // 2
{ 6, "Tokina AF193-2 19-35mm f/3.5-4.5" }, // 3
{ 6, "Sigma 28-80mm f/3.5-5.6 II Macro" }, // 4
{ 7, "Canon EF 100-300mm f/5.6L" },
{ 8, "Canon EF 100-300mm f/5.6" }, // 0
{ 8, "Sigma 70-300mm f/4-5.6 DG Macro" }, // 1
@ -875,6 +876,120 @@ namespace Exiv2 {
return tagInfoPi_;
}
//! BracketMode, tag 0x0003
extern const TagDetails canonBracketMode[] = {
{ 0, N_("Off") },
{ 1, N_("AEB") },
{ 2, N_("FEB") },
{ 3, N_("ISO") },
{ 4, N_("WB") }
};
//! RawJpgSize, tag 0x0007
extern const TagDetails canonRawJpgSize[] = {
{ 0, N_("Large") },
{ 1, N_("Medium") },
{ 2, N_("Small") },
{ 5, N_("Medium 1") },
{ 6, N_("Medium 2") },
{ 7, N_("Medium 3") },
{ 8, N_("Postcard") },
{ 9, N_("Widescreen") },
{ 129, N_("Medium Movie") },
{ 130, N_("Small Movie") }
};
//! NoiseReduction, tag 0x0008
extern const TagDetails canonNoiseReduction[] = {
{ 0, N_("Off") },
{ 1, N_("On 1") },
{ 2, N_("On 2") },
{ 3, N_("On") },
{ 4, N_("Auto") }
};
//! WBBracketMode, tag 0x0009
extern const TagDetails canonWBBracketMode[] = {
{ 0, N_("Off") },
{ 1, N_("On (shift AB)") },
{ 2, N_("On (shift GM)") }
};
//! FilterEffect, tag 0x000e
extern const TagDetails canonFilterEffect[] = {
{ 0, N_("None") },
{ 1, N_("Yellow") },
{ 2, N_("Orange") },
{ 3, N_("Red") },
{ 4, N_("Green") }
};
//! ToningEffect, tag 0x000e
extern const TagDetails canonToningEffect[] = {
{ 0, N_("None") },
{ 1, N_("Sepia") },
{ 2, N_("Blue") },
{ 3, N_("Purple") },
{ 4, N_("Green") }
};
// Canon File Info Tag
const TagInfo CanonMakerNote::tagInfoFi_[] = {
TagInfo(0x0001, "FileNumber", N_("File Number"), N_("File Number"), canonFiIfdId, makerTags, unsignedLong, printFiFileNumber),
TagInfo(0x0003, "BracketMode", N_("Bracket Mode"), N_("Bracket Mode"), canonFiIfdId, makerTags, signedShort, EXV_PRINT_TAG(canonBracketMode)),
TagInfo(0x0004, "BracketValue", N_("Bracket Value"), N_("Bracket Value"), canonFiIfdId, makerTags, signedShort, printValue),
TagInfo(0x0005, "BracketShotNumber", N_("Bracket Shot Number"), N_("Bracket Shot Number"), canonFiIfdId, makerTags, signedShort, printValue),
TagInfo(0x0006, "RawJpgQuality", N_("Raw Jpg Quality"), N_("Raw Jpg Quality"), canonFiIfdId, makerTags, signedShort, EXV_PRINT_TAG(canonCsQuality)),
TagInfo(0x0007, "RawJpgSize", N_("Raw Jpg Size"), N_("Raw Jpg Size"), canonFiIfdId, makerTags, signedShort, EXV_PRINT_TAG(canonRawJpgSize)),
TagInfo(0x0008, "NoiseReduction", N_("Noise Reduction"), N_("Noise Reduction"), canonFiIfdId, makerTags, signedShort, EXV_PRINT_TAG(canonNoiseReduction)),
TagInfo(0x0009, "WBBracketMode", N_("WB Bracket Mode"), N_("WB Bracket Mode"), canonFiIfdId, makerTags, signedShort, EXV_PRINT_TAG(canonWBBracketMode)),
TagInfo(0x000c, "WBBracketValueAB", N_("WB Bracket Value AB"), N_("WB Bracket Value AB"), canonFiIfdId, makerTags, signedShort, printValue),
TagInfo(0x000d, "WBBracketValueGM", N_("WB Bracket Value GM"), N_("WB Bracket Value GM"), canonFiIfdId, makerTags, signedShort, printValue),
TagInfo(0x000e, "FilterEffect", N_("Filter Effect"), N_("Filter Effect"), canonFiIfdId, makerTags, signedShort, EXV_PRINT_TAG(canonFilterEffect)),
TagInfo(0x000f, "ToningEffect", N_("Toning Effect"), N_("Toning Effect"), canonFiIfdId, makerTags, signedShort, EXV_PRINT_TAG(canonToningEffect)),
// End of list marker
TagInfo(0xffff, "(UnknownCanonFiTag)", "(UnknownCanonFiTag)", N_("Unknown Canon File Info tag"), canonFiIfdId, makerTags, invalidTypeId, printValue)
};
const TagInfo* CanonMakerNote::tagListFi()
{
return tagInfoFi_;
}
std::ostream& CanonMakerNote::printFiFileNumber(std::ostream& os,
const Value& value,
const ExifData* metadata)
{
if (!metadata || value.typeId() != unsignedLong) return os << "(" << value << ")";
ExifData::const_iterator pos = metadata->findKey(ExifKey("Exif.Image.Model"));
if (pos == metadata->end()) return os << "(" << value << ")";
// Ported from Exiftool
std::string model = pos->toString();
if ( model.find("20D") != std::string::npos
|| model.find("350D") != std::string::npos
|| model.substr(model.size() - 8, 8) == "REBEL XT"
|| model.find("Kiss Digital N") != std::string::npos) {
uint32_t val = value.toLong();
uint32_t dn = (val & 0xffc0) >> 6;
uint32_t fn = ((val >> 16) & 0xff) + ((val & 0x3f) << 8);
return os << std::dec << dn << "-" << std::setw(4) << std::setfill('0') << fn;
}
if ( model.find("30D") != std::string::npos
|| model.find("400D") != std::string::npos
|| model.find("REBEL XTi") != std::string::npos
|| model.find("Kiss Digital X") != std::string::npos
|| model.find("K236") != std::string::npos) {
uint32_t val = value.toLong();
uint32_t dn = (val & 0xffc00) >> 10;
while (dn < 100) dn += 0x40;
uint32_t fn = ((val & 0x3ff) << 4) + ((val >> 20) & 0x0f);
return os << std::dec << dn << "-" << std::setw(4) << std::setfill('0') << fn;
}
return os << "(" << value << ")";
}
std::ostream& CanonMakerNote::printFocalLength(std::ostream& os,
const Value& value,
const ExifData* metadata)

@ -26,6 +26,7 @@
@version $Rev$
@author <a href="mailto:ahuggel@gmx.net">Andreas Huggel (ahu)</a><br>
<a href="mailto:david@edeca.net">David Cannings (dc)</a>
<a href="mailto:andi.clemens@gmx.net">Andi Clemens (ac)</a>
@date 18-Feb-04, ahu: created<BR>
07-Mar-04, ahu: isolated as a separate component<BR>
12-Aug-06, dc: started updating all tags
@ -69,9 +70,13 @@ namespace Exiv2 {
static const TagInfo* tagListCf();
//! Return read-only list of built-in Canon Picture Info tags
static const TagInfo* tagListPi();
//! Return read-only list of built-in Canon File Info tags
static const TagInfo* tagListFi();
//! @name Print functions for Canon %MakerNote tags
//@{
//! Print the FileInfo FileNumber
static std::ostream& printFiFileNumber(std::ostream& os, const Value& value, const ExifData* metadata);
//! Print the focal length
static std::ostream& printFocalLength(std::ostream& os, const Value& value, const ExifData*);
//! Print the image number
@ -107,6 +112,7 @@ namespace Exiv2 {
static const TagInfo tagInfoSi_[];
static const TagInfo tagInfoCf_[];
static const TagInfo tagInfoPi_[];
static const TagInfo tagInfoFi_[];
static const TagInfo tagInfoPa_[];
}; // class CanonMakerNote

@ -36,6 +36,7 @@ EXIV2_RCSID("@(#) $Id$")
#include "exif.hpp"
#include "iptc.hpp"
#include "xmp.hpp"
#include "futils.hpp"
#include "convert.hpp"
// + standard includes
@ -46,6 +47,12 @@ EXIV2_RCSID("@(#) $Id$")
#ifdef _MSC_VER
# define snprintf _snprintf
#endif
#include <cstring>
#ifdef EXV_HAVE_ICONV
# include <iconv.h>
# include <errno.h>
#endif
// Adobe XMP Toolkit
#ifdef EXV_HAVE_XMP_TOOLKIT
@ -66,6 +73,12 @@ namespace {
The return code indicates if the operation was successful.
*/
bool getTextValue(std::string& value, const Exiv2::XmpData::iterator& pos);
/*!
@brief Convert string charset with iconv.
*/
bool convertStringCharset(std::string &str, const char* from, const char* to);
}
// *****************************************************************************
@ -97,7 +110,7 @@ namespace Exiv2 {
//! Constructor for Exif tags and XMP properties.
Converter(ExifData& exifData, XmpData& xmpData);
//! Constructor for Iptc tags and XMP properties.
Converter(IptcData& iptcData, XmpData& xmpData);
Converter(IptcData& iptcData, XmpData& xmpData, const char *iptcCharset = 0);
//@}
//! @name Manipulators
@ -277,6 +290,7 @@ namespace Exiv2 {
ExifData *exifData_;
IptcData *iptcData_;
XmpData *xmpData_;
const char *iptcCharset_;
}; // class Converter
@ -288,7 +302,7 @@ namespace Exiv2 {
{ mdExif, "Exif.Image.Compression", "Xmp.tiff.Compression", &Converter::cnvExifValue, &Converter::cnvXmpValue },
{ mdExif, "Exif.Image.PhotometricInterpretation", "Xmp.tiff.PhotometricInterpretation", &Converter::cnvExifValue, &Converter::cnvXmpValue },
{ mdExif, "Exif.Image.Orientation", "Xmp.tiff.Orientation", &Converter::cnvExifValue, &Converter::cnvXmpValue },
{ mdExif, "Exif.Image.SamplesPerPixel", "Xmp.tiff.SamplesPerPixe", &Converter::cnvExifValue, &Converter::cnvXmpValue },
{ mdExif, "Exif.Image.SamplesPerPixel", "Xmp.tiff.SamplesPerPixel", &Converter::cnvExifValue, &Converter::cnvXmpValue },
{ mdExif, "Exif.Image.PlanarConfiguration", "Xmp.tiff.PlanarConfiguration", &Converter::cnvExifValue, &Converter::cnvXmpValue },
{ mdExif, "Exif.Image.YCbCrSubSampling", "Xmp.tiff.YCbCrSubSampling", &Converter::cnvExifValue, &Converter::cnvXmpValue },
{ mdExif, "Exif.Image.YCbCrPositioning", "Xmp.tiff.YCbCrPositioning", &Converter::cnvExifValue, &Converter::cnvXmpValue },
@ -391,7 +405,7 @@ namespace Exiv2 {
{ mdIptc, "Iptc.Application2.Category", "Xmp.photoshop.Category", &Converter::cnvIptcValue, &Converter::cnvXmpValueToIptc },
{ mdIptc, "Iptc.Application2.SuppCategory", "Xmp.photoshop.SupplementalCategory", &Converter::cnvIptcValue, &Converter::cnvXmpValueToIptc },
{ mdIptc, "Iptc.Application2.Keywords", "Xmp.dc.subject", &Converter::cnvIptcValue, &Converter::cnvXmpValueToIptc },
{ mdIptc, "Iptc.Application2.LocationName", "Xmp.iptc.Location", &Converter::cnvIptcValue, &Converter::cnvXmpValueToIptc },
{ mdIptc, "Iptc.Application2.SubLocation", "Xmp.iptc.Location", &Converter::cnvIptcValue, &Converter::cnvXmpValueToIptc },
{ mdIptc, "Iptc.Application2.SpecialInstructions","Xmp.photoshop.Instruction", &Converter::cnvIptcValue, &Converter::cnvXmpValueToIptc },
{ mdIptc, "Iptc.Application2.DateCreated", "Xmp.photoshop.DateCreated", &Converter::cnvIptcValue, &Converter::cnvXmpValueToIptc },
{ mdIptc, "Iptc.Application2.Byline", "Xmp.dc.creator", &Converter::cnvIptcValue, &Converter::cnvXmpValueToIptc },
@ -411,12 +425,12 @@ namespace Exiv2 {
};
Converter::Converter(ExifData& exifData, XmpData& xmpData)
: erase_(false), overwrite_(true), exifData_(&exifData), iptcData_(0), xmpData_(&xmpData)
: erase_(false), overwrite_(true), exifData_(&exifData), iptcData_(0), xmpData_(&xmpData), iptcCharset_(0)
{
}
Converter::Converter(IptcData& iptcData, XmpData& xmpData)
: erase_(false), overwrite_(true), exifData_(0), iptcData_(&iptcData), xmpData_(&xmpData)
Converter::Converter(IptcData& iptcData, XmpData& xmpData, const char *iptcCharset)
: erase_(false), overwrite_(true), exifData_(0), iptcData_(&iptcData), xmpData_(&xmpData), iptcCharset_(iptcCharset)
{
}
@ -590,6 +604,7 @@ namespace Exiv2 {
snprintf(buf, sizeof(buf), "%.9f", dsec);
buf[sizeof(buf) - 1] = 0;
buf[1] = '.'; // some locales use ','
subsec = buf + 1;
Exiv2::ExifData::iterator datePos = exifData_->findKey(ExifKey("Exif.GPSInfo.GPSDateStamp"));
@ -627,10 +642,15 @@ namespace Exiv2 {
}
if (subsecTag) {
Exiv2::ExifData::iterator subsec_pos = exifData_->findKey(ExifKey(subsecTag));
ExifData::iterator subsec_pos = exifData_->findKey(ExifKey(subsecTag));
if ( subsec_pos != exifData_->end()
&& !subsec_pos->toString().empty()) {
subsec = std::string(".") + subsec_pos->toString();
&& subsec_pos->typeId() == asciiString) {
std::string ss = subsec_pos->toString();
if (!ss.empty()) {
bool ok = false;
stringTo<long>(ss, ok);
if (ok) subsec = std::string(".") + ss;
}
}
if (erase_) exifData_->erase(subsec_pos);
}
@ -1074,6 +1094,7 @@ namespace Exiv2 {
++pos;
continue;
}
if (iptcCharset_) convertStringCharset(value, iptcCharset_, "UTF-8");
(*xmpData_)[to] = value;
if (erase_) {
pos = iptcData_->erase(pos);
@ -1226,6 +1247,7 @@ namespace Exiv2 {
#endif
}
// *************************************************************************
// free functions
void copyExifToXmp(const ExifData& exifData, XmpData& xmpData)
@ -1260,15 +1282,20 @@ namespace Exiv2 {
converter.syncExifWithXmp();
}
void copyIptcToXmp(const IptcData& iptcData, XmpData& xmpData)
void copyIptcToXmp(const IptcData& iptcData, XmpData& xmpData, const char *iptcCharset)
{
Converter converter(const_cast<IptcData&>(iptcData), xmpData);
if (!iptcCharset) iptcCharset = iptcData.detectCharset();
if (!iptcCharset) iptcCharset = "ISO-8859-1";
Converter converter(const_cast<IptcData&>(iptcData), xmpData, iptcCharset);
converter.cnvToXmp();
}
void moveIptcToXmp(IptcData& iptcData, XmpData& xmpData)
void moveIptcToXmp(IptcData& iptcData, XmpData& xmpData, const char *iptcCharset)
{
Converter converter(const_cast<IptcData&>(iptcData), xmpData);
if (!iptcCharset) iptcCharset = iptcData.detectCharset();
if (!iptcCharset) iptcCharset = "ISO-8859-1";
Converter converter(const_cast<IptcData&>(iptcData), xmpData, iptcCharset);
converter.setErase();
converter.cnvToXmp();
}
@ -1277,6 +1304,7 @@ namespace Exiv2 {
{
Converter converter(iptcData, const_cast<XmpData&>(xmpData));
converter.cnvFromXmp();
iptcData["Iptc.Envelope.CharacterSet"] = "\033%G"; // indicate UTF-8 encoding
}
void moveXmpToIptc(XmpData& xmpData, IptcData& iptcData)
@ -1284,6 +1312,7 @@ namespace Exiv2 {
Converter converter(iptcData, const_cast<XmpData&>(xmpData));
converter.setErase();
converter.cnvFromXmp();
iptcData["Iptc.Envelope.CharacterSet"] = "\033%G"; // indicate UTF-8 encoding
}
} // namespace Exiv2
@ -1319,4 +1348,53 @@ namespace {
return pos->value().ok();
}
bool convertStringCharset(std::string &str, const char* from, const char* to)
{
if (0 == strcmp(from, to)) return true; // nothing to do
#if defined EXV_HAVE_ICONV
bool ret = true;
iconv_t cd;
cd = iconv_open(to, from);
if (cd == (iconv_t)(-1)) {
#ifndef SUPPRESS_WARNINGS
std::cerr << "Warning: iconv_open: " << Exiv2::strError() << "\n";
#endif
return false;
}
std::string outstr;
char *inptr = const_cast<char *>(str.c_str());
size_t inbytesleft = str.length();
while (inbytesleft) {
char outbuf[100];
char *outptr = outbuf;
size_t outbytesleft = sizeof(outbuf) - 1;
size_t rc = iconv(cd,
&inptr,
&inbytesleft,
&outptr,
&outbytesleft);
if (rc == size_t(-1) && errno != E2BIG) {
#ifndef SUPPRESS_WARNINGS
std::cerr << "Warning: iconv: "
<< Exiv2::strError()
<< " inbytesleft = " << inbytesleft << "\n";
#endif
ret = false;
break;
}
*outptr = '\0';
outstr.append(outbuf);
}
if (cd != (iconv_t)(-1)) {
iconv_close(cd);
}
if (ret) str = outstr;
return ret;
#else // !EXV_HAVE_ICONV
return false;
#endif // EXV_HAVE_ICONV
}
}

@ -69,9 +69,9 @@ namespace Exiv2 {
EXIV2API void syncExifWithXmp(ExifData& exifData, XmpData& xmpData);
//! Convert (copy) IPTC datasets to XMP properties.
EXIV2API void copyIptcToXmp(const IptcData& iptcData, XmpData& xmpData);
EXIV2API void copyIptcToXmp(const IptcData& iptcData, XmpData& xmpData, const char *iptcCharset = 0);
//! Convert (move) IPTC datasets to XMP properties, remove converted IPTC datasets.
EXIV2API void moveIptcToXmp(IptcData& iptcData, XmpData& xmpData);
EXIV2API void moveIptcToXmp(IptcData& iptcData, XmpData& xmpData, const char *iptcCharset = 0);
//! Convert (copy) XMP properties to IPTC datasets.
EXIV2API void copyXmpToIptc(const XmpData& xmpData, IptcData& iptcData);

@ -63,6 +63,11 @@ namespace Exiv2 {
{
} // Cr2Image::Cr2Image
std::string Cr2Image::mimeType() const
{
return "image/x-canon-cr2";
}
int Cr2Image::pixelWidth() const
{
ExifData::const_iterator imageWidth = exifData_.findKey(Exiv2::ExifKey("Exif.Photo.PixelXDimension"));
@ -236,10 +241,10 @@ namespace Exiv2 {
return true;
} // Cr2Header::read
uint32_t Cr2Header::write(Blob& blob) const
DataBuf Cr2Header::write() const
{
// Todo: Implement me!
return 0;
return DataBuf();
}
}} // namespace Internal, Exiv2

@ -103,7 +103,7 @@ namespace Exiv2 {
//! @name Accessors
//@{
std::string mimeType() const { return "image/x-canon-cr2"; }
std::string mimeType() const;
int pixelWidth() const;
int pixelHeight() const;
//@}

@ -65,7 +65,7 @@ namespace Exiv2 {
//! @name Accessors
//@{
uint32_t write(Blob& blob) const;
DataBuf write() const;
//@}
private:

@ -95,6 +95,11 @@ namespace Exiv2 {
{
} // CrwImage::CrwImage
std::string CrwImage::mimeType() const
{
return "image/x-canon-crw";
}
int CrwImage::pixelWidth() const
{
Exiv2::ExifData::const_iterator widthIter = exifData_.findKey(Exiv2::ExifKey("Exif.Photo.PixelXDimension"));
@ -338,6 +343,10 @@ namespace Exiv2 {
if (isAllocated_) delete[] pData_;
}
CiffEntry::~CiffEntry()
{
}
CiffDirectory::~CiffDirectory()
{
Components::iterator b = components_.begin();

@ -97,7 +97,7 @@ namespace Exiv2 {
//! @name Accessors
//@{
std::string mimeType() const { return "image/x-canon-crw"; }
std::string mimeType() const;
int pixelWidth() const;
int pixelHeight() const;
//@}

@ -322,7 +322,7 @@ namespace Exiv2 {
CiffEntry(uint16_t tag, uint16_t dir) : CiffComponent(tag, dir) {}
//! Virtual destructor.
virtual ~CiffEntry() {}
virtual ~CiffEntry();
//@}
// Default assignment operator is fine

@ -141,7 +141,7 @@ namespace Exiv2 {
"invocation or designation of coded character sets. The control functions follow "
"the ISO 2022 standard and may consist of the escape control "
"character and one or more graphic characters."),
false, false, 0, 32, Exiv2::undefined, IptcDataSets::envelope, ""),
false, false, 0, 32, Exiv2::string, IptcDataSets::envelope, ""),
DataSet(IptcDataSets::UNO, "UNO", N_("Unique Name Object"),
N_("This tag provide a globally unique "
"identification for objects as specified in the IIM, independent of "
@ -622,6 +622,46 @@ namespace Exiv2 {
return *this;
}
std::string IptcKey::key() const
{
return key_;
}
const char* IptcKey::familyName() const
{
return familyName_;
}
std::string IptcKey::groupName() const
{
return recordName();
}
std::string IptcKey::tagName() const
{
return IptcDataSets::dataSetName(tag_, record_);
}
std::string IptcKey::tagLabel() const
{
return IptcDataSets::dataSetTitle(tag_, record_);
}
uint16_t IptcKey::tag() const
{
return tag_;
}
std::string IptcKey::recordName() const
{
return IptcDataSets::recordName(record_);
}
uint16_t IptcKey::record() const
{
return record_;
}
IptcKey::AutoPtr IptcKey::clone() const
{
return AutoPtr(clone_());

@ -312,25 +312,21 @@ namespace Exiv2 {
//! @name Accessors
//@{
virtual std::string key() const { return key_; }
virtual const char* familyName() const { return familyName_; }
virtual std::string key() const;
virtual const char* familyName() const;
/*!
@brief Return the name of the group (the second part of the key).
For IPTC keys, the group name is the record name.
*/
virtual std::string groupName() const { return recordName(); }
virtual std::string tagName() const
{ return IptcDataSets::dataSetName(tag_, record_); }
virtual std::string tagLabel() const
{ return IptcDataSets::dataSetTitle(tag_, record_); }
virtual uint16_t tag() const { return tag_; }
virtual std::string groupName() const;
virtual std::string tagName() const;
virtual std::string tagLabel() const;
virtual uint16_t tag() const;
AutoPtr clone() const;
//! Return the name of the record
std::string recordName() const
{ return IptcDataSets::recordName(record_); }
std::string recordName() const;
//! Return the record id
uint16_t record() const { return record_; }
uint16_t record() const;
//@}
protected:

@ -84,6 +84,8 @@ namespace Exiv2 {
"Exif.Nikon1.ISOSpeed",
"Exif.Nikon2.ISOSpeed",
"Exif.Nikon3.ISOSpeed",
"Exif.NikonIi.ISO",
"Exif.NikonIi.ISO2",
"Exif.MinoltaCsNew.ISOSpeed",
"Exif.MinoltaCsOld.ISOSpeed",
"Exif.MinoltaCs5D.ISOSpeed",
@ -91,7 +93,23 @@ namespace Exiv2 {
"Exif.Pentax.ISO",
"Exif.Olympus.ISOSpeed"
};
return findMetadatum(ed, keys, EXV_COUNTOF(keys));
// Find the first ISO value which is not "0"
const int cnt = EXV_COUNTOF(keys);
ExifData::const_iterator md = ed.end();
for (int idx = 0; idx < cnt; ) {
md = findMetadatum(ed, keys + idx, cnt - idx);
if (md == ed.end()) break;
std::ostringstream os;
md->write(os, &ed);
bool ok = false;
long v = parseLong(os.str(), ok);
if (ok && v != 0) break;
while (strcmp(keys[idx++], md->key().c_str()) != 0 && idx < cnt) {}
md = ed.end();
}
return md;
}
ExifData::const_iterator flashBias(const ExifData& ed)
@ -200,4 +218,66 @@ namespace Exiv2 {
return findMetadatum(ed, keys, EXV_COUNTOF(keys));
}
ExifData::const_iterator saturation(const ExifData& ed)
{
static const char* keys[] = {
"Exif.Photo.Saturation",
"Exif.CanonCs.Saturation",
"Exif.MinoltaCsNew.Saturation",
"Exif.MinoltaCsOld.Saturation",
"Exif.MinoltaCs7D.Saturation",
"Exif.MinoltaCs5D.Saturation",
"Exif.Fujifilm.Color",
"Exif.Nikon3.Saturation",
"Exif.Panasonic.Saturation",
"Exif.Pentax.Saturation",
"Exif.Sigma.Saturation"
};
return findMetadatum(ed, keys, EXV_COUNTOF(keys));
}
ExifData::const_iterator sharpness(const ExifData& ed)
{
static const char* keys[] = {
"Exif.Photo.Sharpness",
"Exif.CanonCs.Sharpness",
"Exif.Fujifilm.Sharpness",
"Exif.MinoltaCsNew.Sharpness",
"Exif.MinoltaCsOld.Sharpness",
"Exif.MinoltaCs7D.Sharpness",
"Exif.MinoltaCs5D.Sharpness",
"Exif.Olympus.SharpnessFactor",
"Exif.Panasonic.Sharpness",
"Exif.Pentax.Sharpness",
"Exif.Sigma.Sharpness"
};
return findMetadatum(ed, keys, EXV_COUNTOF(keys));
}
ExifData::const_iterator contrast(const ExifData& ed)
{
static const char* keys[] = {
"Exif.Photo.Contrast",
"Exif.CanonCs.Contrast",
"Exif.Fujifilm.Tone",
"Exif.MinoltaCsNew.Contrast",
"Exif.MinoltaCsOld.Contrast",
"Exif.MinoltaCs7D.Contrast",
"Exif.MinoltaCs5D.Contrast",
"Exif.Olympus.Contrast",
"Exif.Panasonic.Contrast",
"Exif.Pentax.Contrast",
"Exif.Sigma.Contrast"
};
return findMetadatum(ed, keys, EXV_COUNTOF(keys));
}
ExifData::const_iterator sceneCaptureType(const ExifData& ed)
{
static const char* keys[] = {
"Exif.Photo.SceneCaptureType",
"Exif.Olympus.SpecialMode"
};
return findMetadatum(ed, keys, EXV_COUNTOF(keys));
}
} // namespace Exiv2

@ -56,6 +56,14 @@ namespace Exiv2 {
EXIV2API ExifData::const_iterator whiteBalance(const ExifData& ed);
//! Return the name of the lens used
EXIV2API ExifData::const_iterator lensName(const ExifData& ed);
//! Return the saturation level
EXIV2API ExifData::const_iterator saturation(const ExifData& ed);
//! Return the sharpness level
EXIV2API ExifData::const_iterator sharpness(const ExifData& ed);
//! Return the contrast level
EXIV2API ExifData::const_iterator contrast(const ExifData& ed);
//! Return the scene capture type
EXIV2API ExifData::const_iterator sceneCaptureType(const ExifData& ed);
} // namespace Exiv2

@ -109,6 +109,24 @@ namespace {
// class member definitions
namespace Exiv2 {
AnyError::~AnyError() throw()
{
}
Error::~Error() throw()
{
}
int Error::code() const throw()
{
return code_;
}
const char* Error::what() const throw()
{
return msg_.c_str();
}
int Error::errorIdx(int code)
{
int idx;

@ -64,9 +64,7 @@ namespace Exiv2 {
//! @name Creators
//@{
//! Virtual destructor.
virtual ~AnyError() throw()
{
}
virtual ~AnyError() throw();
//@}
//! @name Accessors
@ -120,19 +118,17 @@ namespace Exiv2 {
setMsg();
}
//! Virtual destructor. (Needed because of throw())
virtual ~Error() throw()
{
}
virtual ~Error() throw();
//@}
//! @name Accessors
//@{
virtual int code() const throw() { return code_; }
virtual int code() const throw();
/*!
@brief Return the error message. The pointer returned by what()
is valid only as long as the Error object exists.
*/
virtual const char* what() const throw() { return msg_.c_str(); }
virtual const char* what() const throw();
//@}
private:

@ -60,6 +60,25 @@ EXIV2_RCSID("@(#) $Id$")
// *****************************************************************************
namespace {
//! Unary predicate that matches a Exifdatum with a given key
class FindExifdatumByKey {
public:
//! Constructor, initializes the object with the key to look for
FindExifdatumByKey(const std::string& key) : key_(key) {}
/*!
@brief Returns true if the key of \em exifdatum is equal
to that of the object.
*/
bool operator()(const Exiv2::Exifdatum& exifdatum) const
{
return key_ == exifdatum.key();
}
private:
std::string key_;
}; // class FindExifdatumByKey
/*!
@brief Exif %Thumbnail image. This abstract base class provides the
interface for the thumbnail image that is optionally embedded in
@ -98,6 +117,13 @@ namespace {
(".tif", ".jpg").
*/
virtual const char* extension() const =0;
#ifdef EXV_UNICODE_PATH
/*!
@brief Like extension() but returns the extension in a wchar_t.
@note This function is only available on Windows.
*/
virtual const wchar_t* wextension() const =0;
#endif
//@}
}; // class Thumbnail
@ -119,6 +145,9 @@ namespace {
Exiv2::DataBuf copy(const Exiv2::ExifData& exifData) const;
const char* mimeType() const;
const char* extension() const;
#ifdef EXV_UNICODE_PATH
const wchar_t* wextension() const;
#endif
//@}
}; // class TiffThumbnail
@ -140,6 +169,9 @@ namespace {
Exiv2::DataBuf copy(const Exiv2::ExifData& exifData) const;
const char* mimeType() const;
const char* extension() const;
#ifdef EXV_UNICODE_PATH
const wchar_t* wextension() const;
#endif
//@}
}; // class JpegThumbnail
@ -275,6 +307,131 @@ namespace Exiv2 {
return value_->read(value);
}
int Exifdatum::setDataArea(const byte* buf, long len)
{
return value_.get() == 0 ? -1 : value_->setDataArea(buf, len);
}
std::string Exifdatum::key() const
{
return key_.get() == 0 ? "" : key_->key();
}
const char* Exifdatum::familyName() const
{
return key_.get() == 0 ? "" : key_->familyName();
}
std::string Exifdatum::groupName() const
{
return key_.get() == 0 ? "" : key_->groupName();
}
std::string Exifdatum::tagName() const
{
return key_.get() == 0 ? "" : key_->tagName();
}
std::string Exifdatum::tagLabel() const
{
return key_.get() == 0 ? "" : key_->tagLabel();
}
uint16_t Exifdatum::tag() const
{
return key_.get() == 0 ? 0xffff : key_->tag();
}
IfdId Exifdatum::ifdId() const
{
return key_.get() == 0 ? ifdIdNotSet : key_->ifdId();
}
const char* Exifdatum::ifdName() const
{
return key_.get() == 0 ? "" : key_->ifdName();
}
std::string Exifdatum::ifdItem() const
{
return key_.get() == 0 ? "" : key_->ifdItem();
}
int Exifdatum::idx() const
{
return key_.get() == 0 ? 0 : key_->idx();
}
long Exifdatum::copy(byte* buf, ByteOrder byteOrder) const
{
return value_.get() == 0 ? 0 : value_->copy(buf, byteOrder);
}
TypeId Exifdatum::typeId() const
{
return value_.get() == 0 ? invalidTypeId : value_->typeId();
}
const char* Exifdatum::typeName() const
{
return TypeInfo::typeName(typeId());
}
long Exifdatum::typeSize() const
{
return TypeInfo::typeSize(typeId());
}
long Exifdatum::count() const
{
return value_.get() == 0 ? 0 : value_->count();
}
long Exifdatum::size() const
{
return value_.get() == 0 ? 0 : value_->size();
}
std::string Exifdatum::toString() const
{
return value_.get() == 0 ? "" : value_->toString();
}
std::string Exifdatum::toString(long n) const
{
return value_.get() == 0 ? "" : value_->toString(n);
}
long Exifdatum::toLong(long n) const
{
return value_.get() == 0 ? -1 : value_->toLong(n);
}
float Exifdatum::toFloat(long n) const
{
return value_.get() == 0 ? -1 : value_->toFloat(n);
}
Rational Exifdatum::toRational(long n) const
{
return value_.get() == 0 ? Rational(-1, 1) : value_->toRational(n);
}
Value::AutoPtr Exifdatum::getValue() const
{
return value_.get() == 0 ? Value::AutoPtr(0) : value_->clone();
}
long Exifdatum::sizeDataArea() const
{
return value_.get() == 0 ? 0 : value_->sizeDataArea();
}
DataBuf Exifdatum::dataArea() const
{
return value_.get() == 0 ? DataBuf(0, 0) : value_->dataArea();
}
ExifThumbC::ExifThumbC(const ExifData& exifData)
: exifData_(exifData)
{
@ -297,6 +454,18 @@ namespace Exiv2 {
return Exiv2::writeFile(buf, name);
}
#ifdef EXV_UNICODE_PATH
long ExifThumbC::writeFile(const std::wstring& wpath) const
{
Thumbnail::AutoPtr thumbnail = Thumbnail::create(exifData_);
if (thumbnail.get() == 0) return 0;
std::wstring name = wpath + thumbnail->wextension();
DataBuf buf(thumbnail->copy(exifData_));
if (buf.size_ == 0) return 0;
return Exiv2::writeFile(buf, name);
}
#endif
const char* ExifThumbC::mimeType() const
{
Thumbnail::AutoPtr thumbnail = Thumbnail::create(exifData_);
@ -311,6 +480,15 @@ namespace Exiv2 {
return thumbnail->extension();
}
#ifdef EXV_UNICODE_PATH
const wchar_t* ExifThumbC::wextension() const
{
Thumbnail::AutoPtr thumbnail = Thumbnail::create(exifData_);
if (thumbnail.get() == 0) return EXV_WIDEN("");
return thumbnail->wextension();
}
#endif
ExifThumb::ExifThumb(ExifData& exifData)
: ExifThumbC(exifData), exifData_(exifData)
{
@ -327,6 +505,19 @@ namespace Exiv2 {
setJpegThumbnail(thumb.pData_, thumb.size_, xres, yres, unit);
}
#ifdef EXV_UNICODE_PATH
void ExifThumb::setJpegThumbnail(
const std::wstring& wpath,
URational xres,
URational yres,
uint16_t unit
)
{
DataBuf thumb = readFile(wpath); // may throw
setJpegThumbnail(thumb.pData_, thumb.size_, xres, yres, unit);
}
#endif
void ExifThumb::setJpegThumbnail(
const byte* buf,
long size,
@ -347,6 +538,14 @@ namespace Exiv2 {
setJpegThumbnail(thumb.pData_, thumb.size_);
}
#ifdef EXV_UNICODE_PATH
void ExifThumb::setJpegThumbnail(const std::wstring& wpath)
{
DataBuf thumb = readFile(wpath); // may throw
setJpegThumbnail(thumb.pData_, thumb.size_);
}
#endif
void ExifThumb::setJpegThumbnail(const byte* buf, long size)
{
exifData_["Exif.Thumbnail.Compression"] = uint16_t(6);
@ -386,13 +585,13 @@ namespace Exiv2 {
ExifData::const_iterator ExifData::findKey(const ExifKey& key) const
{
return std::find_if(exifMetadata_.begin(), exifMetadata_.end(),
FindMetadatumByKey(key.key()));
FindExifdatumByKey(key.key()));
}
ExifData::iterator ExifData::findKey(const ExifKey& key)
{
return std::find_if(exifMetadata_.begin(), exifMetadata_.end(),
FindMetadatumByKey(key.key()));
FindExifdatumByKey(key.key()));
}
void ExifData::clear()
@ -504,8 +703,9 @@ namespace Exiv2 {
const XmpData emptyXmp;
// Encode and check if the result fits into a JPEG Exif APP1 segment
MemIo mio1;
std::auto_ptr<TiffHeaderBase> header(new TiffHeader(byteOrder));
WriteMethod wm = TiffParserWorker::encode(blob,
WriteMethod wm = TiffParserWorker::encode(mio1,
pData,
size,
ed,
@ -514,10 +714,12 @@ namespace Exiv2 {
Tag::root,
TiffMapping::findEncoder,
header.get());
if (blob.size() <= 65527) return wm;
if (mio1.size() <= 65527) {
append(blob, mio1.mmap(), mio1.size());
return wm;
}
// If it doesn't fit, remove additional tags
blob.clear();
// Delete preview tags if the preview is larger than 32kB.
// Todo: Enhance preview classes to be able to write and delete previews and use that instead.
@ -599,7 +801,8 @@ namespace Exiv2 {
}
// Encode the remaining Exif tags again, don't care if it fits this time
wm = TiffParserWorker::encode(blob,
MemIo mio2;
wm = TiffParserWorker::encode(mio2,
pData,
size,
ed,
@ -608,10 +811,10 @@ namespace Exiv2 {
Tag::root,
TiffMapping::findEncoder,
header.get());
append(blob, mio2.mmap(), mio2.size());
#ifdef DEBUG
if (wm == wmIntrusive) {
std::cerr << "SIZE OF EXIF DATA IS " << std::dec << blob.size() << " BYTES\n";
std::cerr << "SIZE OF EXIF DATA IS " << std::dec << io.size() << " BYTES\n";
}
else {
std::cerr << "SIZE DOESN'T MATTER, NON-INTRUSIVE WRITING USED\n";
@ -663,6 +866,13 @@ namespace {
return ".tif";
}
#ifdef EXV_UNICODE_PATH
const wchar_t* TiffThumbnail::wextension() const
{
return EXV_WIDEN(".tif");
}
#endif
Exiv2::DataBuf TiffThumbnail::copy(const Exiv2::ExifData& exifData) const
{
Exiv2::ExifData thumb;
@ -674,11 +884,11 @@ namespace {
}
}
Exiv2::Blob blob;
Exiv2::MemIo io;
const Exiv2::IptcData emptyIptc;
const Exiv2::XmpData emptyXmp;
Exiv2::TiffParser::encode(blob, 0, 0, Exiv2::littleEndian, thumb, emptyIptc, emptyXmp);
return Exiv2::DataBuf((blob.size() > 0 ? &blob[0] : 0), static_cast<long>(blob.size()));
Exiv2::TiffParser::encode(io, 0, 0, Exiv2::littleEndian, thumb, emptyIptc, emptyXmp);
return io.read(io.size());
}
const char* JpegThumbnail::mimeType() const
@ -691,6 +901,13 @@ namespace {
return ".jpg";
}
#ifdef EXV_UNICODE_PATH
const wchar_t* JpegThumbnail::wextension() const
{
return EXV_WIDEN(".jpg");
}
#endif
Exiv2::DataBuf JpegThumbnail::copy(const Exiv2::ExifData& exifData) const
{
Exiv2::ExifKey key("Exif.Thumbnail.JPEGInterchangeFormat");

@ -149,37 +149,26 @@ namespace Exiv2 {
@return Return -1 if the %Exifdatum does not have a value yet or the
value has no data area, else 0.
*/
int setDataArea(const byte* buf, long len)
{ return value_.get() == 0 ? -1 : value_->setDataArea(buf, len); }
int setDataArea(const byte* buf, long len);
//@}
//! @name Accessors
//@{
//! Return the key of the %Exifdatum.
std::string key() const
{ return key_.get() == 0 ? "" : key_->key(); }
const char* familyName() const
{ return key_.get() == 0 ? "" : key_->familyName(); }
std::string groupName() const
{ return key_.get() == 0 ? "" : key_->groupName(); }
std::string tagName() const
{ return key_.get() == 0 ? "" : key_->tagName(); }
std::string tagLabel() const
{ return key_.get() == 0 ? "" : key_->tagLabel(); }
uint16_t tag() const
{ return key_.get() == 0 ? 0xffff : key_->tag(); }
std::string key() const;
const char* familyName() const;
std::string groupName() const;
std::string tagName() const;
std::string tagLabel() const;
uint16_t tag() const;
//! Return the IFD id
IfdId ifdId() const
{ return key_.get() == 0 ? ifdIdNotSet : key_->ifdId(); }
IfdId ifdId() const;
//! Return the name of the IFD
const char* ifdName() const
{ return key_.get() == 0 ? "" : key_->ifdName(); }
const char* ifdName() const;
//! Return the related image item (deprecated)
std::string ifdItem() const
{ return key_.get() == 0 ? "" : key_->ifdItem(); }
std::string ifdItem() const;
//! Return the index (unique id of this key within the original IFD)
int idx() const
{ return key_.get() == 0 ? 0 : key_->idx(); }
int idx() const;
/*!
@brief Write value to a data buffer and return the number
of bytes written.
@ -191,41 +180,28 @@ namespace Exiv2 {
@param byteOrder Applicable byte order (little or big endian).
@return Number of characters written.
*/
long copy(byte* buf, ByteOrder byteOrder) const
{ return value_.get() == 0 ? 0 : value_->copy(buf, byteOrder); }
long copy(byte* buf, ByteOrder byteOrder) const;
std::ostream& write(std::ostream& os, const ExifData* pMetadata =0) const;
//! Return the type id of the value
TypeId typeId() const
{ return value_.get() == 0 ? invalidTypeId : value_->typeId(); }
TypeId typeId() const;
//! Return the name of the type
const char* typeName() const
{ return TypeInfo::typeName(typeId()); }
const char* typeName() const;
//! Return the size in bytes of one component of this type
long typeSize() const
{ return TypeInfo::typeSize(typeId()); }
long typeSize() const;
//! Return the number of components in the value
long count() const
{ return value_.get() == 0 ? 0 : value_->count(); }
long count() const;
//! Return the size of the value in bytes
long size() const
{ return value_.get() == 0 ? 0 : value_->size(); }
long size() const;
//! Return the value as a string.
std::string toString() const
{ return value_.get() == 0 ? "" : value_->toString(); }
std::string toString(long n) const
{ return value_.get() == 0 ? "" : value_->toString(n); }
long toLong(long n =0) const
{ return value_.get() == 0 ? -1 : value_->toLong(n); }
float toFloat(long n =0) const
{ return value_.get() == 0 ? -1 : value_->toFloat(n); }
Rational toRational(long n =0) const
{ return value_.get() == 0 ? Rational(-1, 1) : value_->toRational(n); }
Value::AutoPtr getValue() const
{ return value_.get() == 0 ? Value::AutoPtr(0) : value_->clone(); }
std::string toString() const;
std::string toString(long n) const;
long toLong(long n =0) const;
float toFloat(long n =0) const;
Rational toRational(long n =0) const;
Value::AutoPtr getValue() const;
const Value& value() const;
//! Return the size of the data area.
long sizeDataArea() const
{ return value_.get() == 0 ? 0 : value_->sizeDataArea(); }
long sizeDataArea() const;
/*!
@brief Return a copy of the data area of the value. The caller owns
this copy and %DataBuf ensures that it will be deleted.
@ -238,8 +214,7 @@ namespace Exiv2 {
%DataBuf if the value does not have a data area assigned or the
value is not set.
*/
DataBuf dataArea() const
{ return value_.get() == 0 ? DataBuf(0, 0) : value_->dataArea(); }
DataBuf dataArea() const;
//@}
private:
@ -286,6 +261,13 @@ namespace Exiv2 {
@return The number of bytes written.
*/
long writeFile(const std::string& path) const;
#ifdef EXV_UNICODE_PATH
/*!
@brief Like writeFile() but accepts a unicode path in an std::wstring.
@note This function is only available on Windows.
*/
long writeFile(const std::wstring& wpath) const;
#endif
/*!
@brief Return the MIME type of the thumbnail, either \c "image/tiff"
or \c "image/jpeg".
@ -296,6 +278,13 @@ namespace Exiv2 {
(".tif" or ".jpg").
*/
const char* extension() const;
#ifdef EXV_UNICODE_PATH
/*!
@brief Like extension() but returns the extension in a wchar_t.
@note This function is only available on Windows.
*/
const wchar_t* wextension() const;
#endif
//@}
private:
@ -348,6 +337,19 @@ namespace Exiv2 {
URational yres,
uint16_t unit
);
#ifdef EXV_UNICODE_PATH
/*!
@brief Like setJpegThumbnail() but accepts a unicode path in an
std::wstring.
@note This function is only available on Windows.
*/
void setJpegThumbnail(
const std::wstring& wpath,
URational xres,
URational yres,
uint16_t unit
);
#endif
/*!
@brief Set the Exif thumbnail to the JPEG image pointed to by \em buf,
and size \em size. Set XResolution, YResolution and
@ -386,6 +388,14 @@ namespace Exiv2 {
@note Additional existing Exif thumbnail tags are not modified.
*/
void setJpegThumbnail(const std::string& path);
#ifdef EXV_UNICODE_PATH
/*!
@brief Like setJpegThumbnail(const std::string& path) but accepts a
unicode path in an std::wstring.
@note This function is only available on Windows.
*/
void setJpegThumbnail(const std::wstring& wpath);
#endif
/*!
@brief Set the Exif thumbnail to the JPEG image pointed to by \em buf,
and size \em size.
@ -603,8 +613,7 @@ namespace Exiv2 {
This is just an inline wrapper for
ExifParser::encode(blob, 0, 0, byteOrder, exifData).
@param blob Container for the binary Exif data if "intrusive"
writing is necessary. Empty otherwise.
@param blob Container for the binary Exif data.
@param byteOrder Byte order to use.
@param exifData Exif metadata container.
*/

@ -19,7 +19,7 @@
* Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
*/
/*
File: utils.cpp
File: futils.cpp
Version: $Rev$
Author(s): Andreas Huggel (ahu) <ahuggel@gmx.net>
History: 08-Dec-03, ahu: created
@ -69,12 +69,23 @@ namespace Exiv2 {
bool fileExists(const std::string& path, bool ct)
{
struct stat buf;
int ret = stat(path.c_str(), &buf);
int ret = ::stat(path.c_str(), &buf);
if (0 != ret) return false;
if (ct && !S_ISREG(buf.st_mode)) return false;
return true;
} // fileExists
#ifdef EXV_UNICODE_PATH
bool fileExists(const std::wstring& wpath, bool ct)
{
struct _stat buf;
int ret = _wstat(wpath.c_str(), &buf);
if (0 != ret) return false;
if (ct && !S_ISREG(buf.st_mode)) return false;
return true;
} // fileExists
#endif
std::string strError()
{
int error = errno;

@ -61,6 +61,13 @@ namespace Exiv2 {
in case of an error.
*/
EXIV2API bool fileExists(const std::string& path, bool ct =false);
#ifdef EXV_UNICODE_PATH
/*!
@brief Like fileExists() but accepts a unicode path in an std::wstring.
@note This function is only available on Windows.
*/
EXIV2API bool fileExists(const std::wstring& wpath, bool ct =false);
#endif
/*!
@brief Return a system error message and the error code (errno).
See %strerror(3).

@ -57,6 +57,11 @@ namespace Exiv2 {
{
} // GifImage::GifImage
std::string GifImage::mimeType() const
{
return "image/gif";
}
void GifImage::setExifData(const ExifData& /*exifData*/)
{
// Todo: implement me!

@ -110,7 +110,7 @@ namespace Exiv2 {
//! @name Accessors
//@{
std::string mimeType() const { return "image/gif"; }
std::string mimeType() const;
//@}
}; // class GifImage

@ -60,6 +60,7 @@ EXIV2_RCSID("@(#) $Id$")
#include "bmpimage.hpp"
#include "jp2image.hpp"
#include "rw2image.hpp"
#include "pgfimage.hpp"
#include "xmpsidecar.hpp"
// + standard includes
@ -117,6 +118,7 @@ namespace {
{ ImageType::bmp, newBmpInstance, isBmpType, amNone, amNone, amNone, amNone },
{ ImageType::jp2, newJp2Instance, isJp2Type, amReadWrite, amReadWrite, amReadWrite, amNone },
{ ImageType::rw2, newRw2Instance, isRw2Type, amRead, amRead, amRead, amNone },
{ ImageType::pgf, newPgfInstance, isPgfType, amReadWrite, amReadWrite, amReadWrite, amReadWrite },
// End of list marker
{ ImageType::none, 0, 0, amNone, amNone, amNone, amNone }
};
@ -144,6 +146,10 @@ namespace Exiv2 {
{
}
Image::~Image()
{
}
void Image::clearMetadata()
{
clearExifData();
@ -153,6 +159,26 @@ namespace Exiv2 {
clearComment();
}
ExifData& Image::exifData()
{
return exifData_;
}
IptcData& Image::iptcData()
{
return iptcData_;
}
XmpData& Image::xmpData()
{
return xmpData_;
}
std::string& Image::xmpPacket()
{
return xmpPacket_;
}
void Image::setMetadata(const Image& image)
{
setExifData(image.exifData());
@ -228,6 +254,56 @@ namespace Exiv2 {
byteOrder_ = byteOrder;
}
ByteOrder Image::byteOrder() const
{
return byteOrder_;
}
int Image::pixelWidth() const
{
return pixelWidth_;
}
int Image::pixelHeight() const
{
return pixelHeight_;
}
const ExifData& Image::exifData() const
{
return exifData_;
}
const IptcData& Image::iptcData() const
{
return iptcData_;
}
const XmpData& Image::xmpData() const
{
return xmpData_;
}
std::string Image::comment() const
{
return comment_;
}
const std::string& Image::xmpPacket() const
{
return xmpPacket_;
}
BasicIo& Image::io() const
{
return *io_;
}
bool Image::writeXmpFromPacket() const
{
return writeXmpFromPacket_;
}
bool Image::good() const
{
if (io_->open() != 0) return false;
@ -285,6 +361,14 @@ namespace Exiv2 {
return getType(fileIo);
}
#ifdef EXV_UNICODE_PATH
int ImageFactory::getType(const std::wstring& wpath)
{
FileIo fileIo(wpath);
return getType(fileIo);
}
#endif
int ImageFactory::getType(const byte* data, long size)
{
MemIo memIo(data, size);
@ -311,6 +395,16 @@ namespace Exiv2 {
return image;
}
#ifdef EXV_UNICODE_PATH
Image::AutoPtr ImageFactory::open(const std::wstring& wpath)
{
BasicIo::AutoPtr io(new FileIo(wpath));
Image::AutoPtr image = open(io); // may throw
if (image.get() == 0) throw Error(11, ws2s(wpath));
return image;
}
#endif
Image::AutoPtr ImageFactory::open(const byte* data, long size)
{
BasicIo::AutoPtr io(new MemIo(data, size));
@ -347,6 +441,23 @@ namespace Exiv2 {
return image;
}
#ifdef EXV_UNICODE_PATH
Image::AutoPtr ImageFactory::create(int type,
const std::wstring& wpath)
{
std::auto_ptr<FileIo> fileIo(new FileIo(wpath));
// Create or overwrite the file, then close it
if (fileIo->open("w+b") != 0) {
throw Error(10, ws2s(wpath), "w+b", strError());
}
fileIo->close();
BasicIo::AutoPtr io(fileIo);
Image::AutoPtr image = create(type, io);
if (image.get() == 0) throw Error(13, type);
return image;
}
#endif
Image::AutoPtr ImageFactory::create(int type)
{
BasicIo::AutoPtr io(new MemIo);

@ -84,7 +84,7 @@ namespace Exiv2 {
uint16_t supportedMetadata,
BasicIo::AutoPtr io);
//! Virtual Destructor
virtual ~Image() {}
virtual ~Image();
//@}
//! @name Manipulators
@ -224,7 +224,7 @@ namespace Exiv2 {
@return modifiable ExifData instance containing Exif values
*/
virtual ExifData& exifData() { return exifData_; }
virtual ExifData& exifData();
/*!
@brief Returns an IptcData instance containing currently buffered
IPTC data.
@ -236,7 +236,7 @@ namespace Exiv2 {
@return modifiable IptcData instance containing IPTC values
*/
virtual IptcData& iptcData() { return iptcData_; }
virtual IptcData& iptcData();
/*!
@brief Returns an XmpData instance containing currently buffered
XMP data.
@ -248,11 +248,11 @@ namespace Exiv2 {
@return modifiable XmpData instance containing XMP values
*/
virtual XmpData& xmpData() { return xmpData_; }
virtual XmpData& xmpData();
/*!
@brief Return a modifiable reference to the raw XMP packet.
*/
virtual std::string& xmpPacket() { return xmpPacket_; }
virtual std::string& xmpPacket();
/*!
@brief Determine the source when writing XMP.
@ -286,7 +286,7 @@ namespace Exiv2 {
@brief Return the byte order in which the Exif metadata of the image is
encoded. Initially, it is not set (\em invalidByteOrder).
*/
ByteOrder byteOrder() const { return byteOrder_; }
ByteOrder byteOrder() const;
/*!
@brief Check if the Image instance is valid. Use after object
construction.
@ -307,11 +307,11 @@ namespace Exiv2 {
/*!
@brief Return the pixel width of the image.
*/
virtual int pixelWidth() const { return pixelWidth_; }
virtual int pixelWidth() const;
/*!
@brief Return the pixel height of the image.
*/
virtual int pixelHeight() const { return pixelHeight_; }
virtual int pixelHeight() const;
/*!
@brief Returns an ExifData instance containing currently buffered
Exif data.
@ -323,7 +323,7 @@ namespace Exiv2 {
@return read only ExifData instance containing Exif values
*/
virtual const ExifData& exifData() const { return exifData_; }
virtual const ExifData& exifData() const;
/*!
@brief Returns an IptcData instance containing currently buffered
IPTC data.
@ -335,7 +335,7 @@ namespace Exiv2 {
@return modifiable IptcData instance containing IPTC values
*/
virtual const IptcData& iptcData() const { return iptcData_; }
virtual const IptcData& iptcData() const;
/*!
@brief Returns an XmpData instance containing currently buffered
XMP data.
@ -347,15 +347,15 @@ namespace Exiv2 {
@return modifiable XmpData instance containing XMP values
*/
virtual const XmpData& xmpData() const { return xmpData_; }
virtual const XmpData& xmpData() const;
/*!
@brief Return a copy of the image comment. May be an empty string.
*/
virtual std::string comment() const { return comment_; }
virtual std::string comment() const;
/*!
@brief Return the raw XMP packet as a string.
*/
virtual const std::string& xmpPacket() const { return xmpPacket_; }
virtual const std::string& xmpPacket() const;
/*!
@brief Return a reference to the BasicIo instance being used for Io.
@ -370,7 +370,7 @@ namespace Exiv2 {
Image class will not see those changes until the readMetadata()
method is called.
*/
virtual BasicIo& io() const { return *io_; }
virtual BasicIo& io() const;
/*!
@brief Returns the access mode, i.e., the metadata functions, which
this image supports for the metadata type \em metadataId.
@ -384,7 +384,7 @@ namespace Exiv2 {
*/
bool supportsMetadata(MetadataId metadataId) const;
//! Return the flag indicating the source when writing XMP metadata.
bool writeXmpFromPacket() const { return writeXmpFromPacket_; }
bool writeXmpFromPacket() const;
//@}
protected:
@ -440,6 +440,13 @@ namespace Exiv2 {
unknown image type.
*/
static Image::AutoPtr open(const std::string& path);
#ifdef EXV_UNICODE_PATH
/*!
@brief Like open() but accepts a unicode path in an std::wstring.
@note This function is only available on Windows.
*/
static Image::AutoPtr open(const std::wstring& wpath);
#endif
/*!
@brief Create an Image subclass of the appropriate type by reading
the provided memory. %Image type is derived from the memory
@ -480,6 +487,13 @@ namespace Exiv2 {
@throw Error If the image type is not supported.
*/
static Image::AutoPtr create(int type, const std::string& path);
#ifdef EXV_UNICODE_PATH
/*!
@brief Like create() but accepts a unicode path in an std::wstring.
@note This function is only available on Windows.
*/
static Image::AutoPtr create(int type, const std::wstring& wpath);
#endif
/*!
@brief Create an Image subclass of the requested type by creating a
new image in memory.
@ -511,6 +525,13 @@ namespace Exiv2 {
@return %Image type or Image::none if the type is not recognized.
*/
static int getType(const std::string& path);
#ifdef EXV_UNICODE_PATH
/*!
@brief Like getType() but accepts a unicode path in an std::wstring.
@note This function is only available on Windows.
*/
static int getType(const std::wstring& wpath);
#endif
/*!
@brief Returns the image type of the provided data buffer.
@param data Pointer to a data buffer containing an image. The contents

@ -60,6 +60,28 @@ namespace {
const Exiv2::byte* data,
uint32_t sizeData
);
//! Unary predicate that matches an Iptcdatum with given record and dataset
class FindIptcdatum {
public:
//! Constructor, initializes the object with the record and dataset id
FindIptcdatum(uint16_t dataset, uint16_t record)
: dataset_(dataset), record_(record) {}
/*!
@brief Returns true if the record and dataset id of the argument
Iptcdatum is equal to that of the object.
*/
bool operator()(const Exiv2::Iptcdatum& iptcdatum) const
{
return dataset_ == iptcdatum.tag() && record_ == iptcdatum.record();
}
private:
// DATA
uint16_t dataset_;
uint16_t record_;
}; // class FindIptcdatum
}
// *****************************************************************************
@ -84,11 +106,111 @@ namespace Exiv2 {
{
}
long Iptcdatum::copy(byte* buf, ByteOrder byteOrder) const
{
return value_.get() == 0 ? 0 : value_->copy(buf, byteOrder);
}
std::ostream& Iptcdatum::write(std::ostream& os, const ExifData*) const
{
return os << value();
}
std::string Iptcdatum::key() const
{
return key_.get() == 0 ? "" : key_->key();
}
std::string Iptcdatum::recordName() const
{
return key_.get() == 0 ? "" : key_->recordName();
}
uint16_t Iptcdatum::record() const
{
return key_.get() == 0 ? 0 : key_->record();
}
const char* Iptcdatum::familyName() const
{
return key_.get() == 0 ? "" : key_->familyName();
}
std::string Iptcdatum::groupName() const
{
return key_.get() == 0 ? "" : key_->groupName();
}
std::string Iptcdatum::tagName() const
{
return key_.get() == 0 ? "" : key_->tagName();
}
std::string Iptcdatum::tagLabel() const
{
return key_.get() == 0 ? "" : key_->tagLabel();
}
uint16_t Iptcdatum::tag() const
{
return key_.get() == 0 ? 0 : key_->tag();
}
TypeId Iptcdatum::typeId() const
{
return value_.get() == 0 ? invalidTypeId : value_->typeId();
}
const char* Iptcdatum::typeName() const
{
return TypeInfo::typeName(typeId());
}
long Iptcdatum::typeSize() const
{
return TypeInfo::typeSize(typeId());
}
long Iptcdatum::count() const
{
return value_.get() == 0 ? 0 : value_->count();
}
long Iptcdatum::size() const
{
return value_.get() == 0 ? 0 : value_->size();
}
std::string Iptcdatum::toString() const
{
return value_.get() == 0 ? "" : value_->toString();
}
std::string Iptcdatum::toString(long n) const
{
return value_.get() == 0 ? "" : value_->toString(n);
}
long Iptcdatum::toLong(long n) const
{
return value_.get() == 0 ? -1 : value_->toLong(n);
}
float Iptcdatum::toFloat(long n) const
{
return value_.get() == 0 ? -1 : value_->toFloat(n);
}
Rational Iptcdatum::toRational(long n) const
{
return value_.get() == 0 ? Rational(-1, 1) : value_->toRational(n);
}
Value::AutoPtr Iptcdatum::getValue() const
{
return value_.get() == 0 ? Value::AutoPtr(0) : value_->clone();
}
const Value& Iptcdatum::value() const
{
if (value_.get() == 0) throw Error(8);
@ -193,25 +315,25 @@ namespace Exiv2 {
IptcData::const_iterator IptcData::findKey(const IptcKey& key) const
{
return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(),
FindMetadatumById(key.tag(), key.record()));
FindIptcdatum(key.tag(), key.record()));
}
IptcData::iterator IptcData::findKey(const IptcKey& key)
{
return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(),
FindMetadatumById(key.tag(), key.record()));
FindIptcdatum(key.tag(), key.record()));
}
IptcData::const_iterator IptcData::findId(uint16_t dataset, uint16_t record) const
{
return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(),
FindMetadatumById(dataset, record));
FindIptcdatum(dataset, record));
}
IptcData::iterator IptcData::findId(uint16_t dataset, uint16_t record)
{
return std::find_if(iptcMetadata_.begin(), iptcMetadata_.end(),
FindMetadatumById(dataset, record));
FindIptcdatum(dataset, record));
}
void IptcData::sortByKey()
@ -229,6 +351,59 @@ namespace Exiv2 {
return iptcMetadata_.erase(pos);
}
const char *IptcData::detectCharset() const
{
const_iterator pos = findKey(IptcKey("Iptc.Envelope.CharacterSet"));
if (pos != end()) {
const std::string value = pos->toString();
if (pos->value().ok()) {
if (value == "\033%G") return "UTF-8";
// other values are probably not practically relevant
}
}
bool ascii = true;
bool utf8 = true;
for (pos = begin(); pos != end(); ++pos) {
std::string value = pos->toString();
if (pos->value().ok()) {
int seqCount = 0;
std::string::iterator i;
for (i = value.begin(); i != value.end(); ++i) {
char c = *i;
if (seqCount) {
if ((c & 0xc0) != 0x80) {
utf8 = false;
break;
}
--seqCount;
}
else {
if (c & 0x80) ascii = false;
else continue; // ascii character
if ((c & 0xe0) == 0xc0) seqCount = 1;
else if ((c & 0xf0) == 0xe0) seqCount = 2;
else if ((c & 0xf8) == 0xf0) seqCount = 3;
else if ((c & 0xfc) == 0xf8) seqCount = 4;
else if ((c & 0xfe) == 0xfc) seqCount = 5;
else {
utf8 = false;
break;
}
}
}
if (seqCount) utf8 = false; // unterminated seq
if (!utf8) break;
}
}
if (ascii) return "ASCII";
if (utf8) return "UTF-8";
return NULL;
}
const byte IptcParser::marker_ = 0x1C; // Dataset marker
int IptcParser::decode(

@ -113,8 +113,7 @@ namespace Exiv2 {
//! @name Accessors
//@{
long copy(byte* buf, ByteOrder byteOrder) const
{ return value_.get() == 0 ? 0 : value_->copy(buf, byteOrder); }
long copy(byte* buf, ByteOrder byteOrder) const;
std::ostream& write(std::ostream& os, const ExifData* pMetadata =0) const;
/*!
@brief Return the key of the Iptcdatum. The key is of the form
@ -122,52 +121,38 @@ namespace Exiv2 {
is not necessarily unique, i.e., an IptcData object may contain
multiple metadata with the same key.
*/
std::string key() const { return key_.get() == 0 ? "" : key_->key(); }
std::string key() const;
/*!
@brief Return the name of the record (deprecated)
@return record name
*/
std::string recordName() const
{ return key_.get() == 0 ? "" : key_->recordName(); }
std::string recordName() const;
/*!
@brief Return the record id
@return record id
*/
uint16_t record() const
{ return key_.get() == 0 ? 0 : key_->record(); }
const char* familyName() const
{ return key_.get() == 0 ? "" : key_->familyName(); }
std::string groupName() const
{ return key_.get() == 0 ? "" : key_->groupName(); }
uint16_t record() const;
const char* familyName() const;
std::string groupName() const;
/*!
@brief Return the name of the tag (aka dataset)
@return tag name
*/
std::string tagName() const
{ return key_.get() == 0 ? "" : key_->tagName(); }
std::string tagLabel() const
{ return key_.get() == 0 ? "" : key_->tagLabel(); }
std::string tagName() const;
std::string tagLabel() const;
//! Return the tag (aka dataset) number
uint16_t tag() const
{ return key_.get() == 0 ? 0 : key_->tag(); }
TypeId typeId() const
{ return value_.get() == 0 ? invalidTypeId : value_->typeId(); }
const char* typeName() const { return TypeInfo::typeName(typeId()); }
long typeSize() const { return TypeInfo::typeSize(typeId()); }
long count() const { return value_.get() == 0 ? 0 : value_->count(); }
long size() const { return value_.get() == 0 ? 0 : value_->size(); }
std::string toString() const
{ return value_.get() == 0 ? "" : value_->toString(); }
std::string toString(long n) const
{ return value_.get() == 0 ? "" : value_->toString(n); }
long toLong(long n =0) const
{ return value_.get() == 0 ? -1 : value_->toLong(n); }
float toFloat(long n =0) const
{ return value_.get() == 0 ? -1 : value_->toFloat(n); }
Rational toRational(long n =0) const
{ return value_.get() == 0 ? Rational(-1, 1) : value_->toRational(n); }
Value::AutoPtr getValue() const
{ return value_.get() == 0 ? Value::AutoPtr(0) : value_->clone(); }
uint16_t tag() const;
TypeId typeId() const;
const char* typeName() const;
long typeSize() const;
long count() const;
long size() const;
std::string toString() const;
std::string toString(long n) const;
long toLong(long n =0) const;
float toFloat(long n =0) const;
Rational toRational(long n =0) const;
Value::AutoPtr getValue() const;
const Value& value() const;
//@}
@ -181,26 +166,6 @@ namespace Exiv2 {
//! Container type to hold all metadata
typedef std::vector<Iptcdatum> IptcMetadata;
//! Unary predicate that matches an Iptcdatum with given record and dataset
class EXIV2API FindMetadatumById {
public:
//! Constructor, initializes the object with the record and dataset id
FindMetadatumById(uint16_t dataset, uint16_t record)
: dataset_(dataset), record_(record) {}
/*!
@brief Returns true if the record and dataset id of the argument
Iptcdatum is equal to that of the object.
*/
bool operator()(const Iptcdatum& iptcdatum) const
{ return dataset_ == iptcdatum.tag() && record_ == iptcdatum.record(); }
private:
// DATA
uint16_t dataset_;
uint16_t record_;
}; // class FindMetadatumById
/*!
@brief A container for IPTC data. This is a top-level class of
the %Exiv2 library.
@ -304,6 +269,10 @@ namespace Exiv2 {
@brief Return the exact size of all contained IPTC metadata
*/
long size() const;
/*!
@brief Return the metadata charset name or 0
*/
const char *detectCharset() const;
//@}
private:

@ -138,6 +138,11 @@ namespace Exiv2
}
} // Jp2Image::Jp2Image
std::string Jp2Image::mimeType() const
{
return "image/jp2";
}
void Jp2Image::setComment(const std::string& /*comment*/)
{
// Todo: implement me!

@ -93,7 +93,7 @@ namespace Exiv2
//! @name Accessors
//@{
std::string mimeType() const { return "image/jp2"; }
std::string mimeType() const;
//@}
private:

@ -391,7 +391,7 @@ namespace Exiv2 {
// Append to psBlob
append(psBlob, psData.pData_, psData.size_);
// Check whether psBlob is complete
if (Photoshop::valid(&psBlob[0], psBlob.size())) {
if (psBlob.size() > 0 && Photoshop::valid(&psBlob[0], psBlob.size())) {
--search;
foundCompletePsData = true;
}
@ -449,33 +449,35 @@ namespace Exiv2 {
}
} // while there are segments to process
// Find actual IPTC data within the psBlob
Blob iptcBlob;
const byte *record = 0;
uint32_t sizeIptc = 0;
uint32_t sizeHdr = 0;
const byte* pCur = &psBlob[0];
const byte* pEnd = pCur + psBlob.size();
while ( pCur < pEnd
&& 0 == Photoshop::locateIptcIrb(pCur, static_cast<long>(pEnd - pCur),
&record, &sizeHdr, &sizeIptc)) {
if (psBlob.size() > 0) {
// Find actual IPTC data within the psBlob
Blob iptcBlob;
const byte *record = 0;
uint32_t sizeIptc = 0;
uint32_t sizeHdr = 0;
const byte* pCur = &psBlob[0];
const byte* pEnd = pCur + psBlob.size();
while ( pCur < pEnd
&& 0 == Photoshop::locateIptcIrb(pCur, static_cast<long>(pEnd - pCur),
&record, &sizeHdr, &sizeIptc)) {
#ifdef DEBUG
std::cerr << "Found IPTC IRB, size = " << sizeIptc << "\n";
std::cerr << "Found IPTC IRB, size = " << sizeIptc << "\n";
#endif
if (sizeIptc) {
append(iptcBlob, record + sizeHdr, sizeIptc);
if (sizeIptc) {
append(iptcBlob, record + sizeHdr, sizeIptc);
}
pCur = record + sizeHdr + sizeIptc + (sizeIptc & 1);
}
pCur = record + sizeHdr + sizeIptc + (sizeIptc & 1);
}
if ( iptcBlob.size() > 0
&& IptcParser::decode(iptcData_,
&iptcBlob[0],
static_cast<uint32_t>(iptcBlob.size()))) {
if ( iptcBlob.size() > 0
&& IptcParser::decode(iptcData_,
&iptcBlob[0],
static_cast<uint32_t>(iptcBlob.size()))) {
#ifndef SUPPRESS_WARNINGS
std::cerr << "Warning: Failed to decode IPTC metadata.\n";
std::cerr << "Warning: Failed to decode IPTC metadata.\n";
#endif
iptcData_.clear();
}
iptcData_.clear();
}
} // psBlob.size() > 0
if (rc != 0) {
#ifndef SUPPRESS_WARNINGS
@ -579,7 +581,7 @@ namespace Exiv2 {
// Append to psBlob
append(psBlob, psData.pData_, psData.size_);
// Check whether psBlob is complete
if (Photoshop::valid(&psBlob[0], psBlob.size())) {
if (psBlob.size() > 0 && Photoshop::valid(&psBlob[0], psBlob.size())) {
foundCompletePsData = true;
}
}
@ -718,7 +720,7 @@ namespace Exiv2 {
if (foundCompletePsData || iptcData_.count() > 0) {
// Set the new IPTC IRB, keeps existing IRBs but removes the
// IPTC block if there is no new IPTC data to write
DataBuf newPsData = Photoshop::setIptcIrb(&psBlob[0],
DataBuf newPsData = Photoshop::setIptcIrb(psBlob.size() > 0 ? &psBlob[0] : 0,
psBlob.size(),
iptcData_);
const long maxChunkSize = 0xffff - 16;
@ -835,6 +837,11 @@ namespace Exiv2 {
{
}
std::string JpegImage::mimeType() const
{
return "image/jpeg";
}
int JpegImage::writeHeader(BasicIo& outIo) const
{
// Jpeg header
@ -882,6 +889,11 @@ namespace Exiv2 {
{
}
std::string ExvImage::mimeType() const
{
return "image/x-exv";
}
int ExvImage::writeHeader(BasicIo& outIo) const
{
// Exv header

@ -294,7 +294,7 @@ namespace Exiv2 {
//@}
//! @name Accessors
//@{
std::string mimeType() const { return "image/jpeg"; }
std::string mimeType() const;
//@}
protected:
@ -355,7 +355,7 @@ namespace Exiv2 {
//@}
//! @name Accessors
//@{
std::string mimeType() const { return "image/x-exv"; }
std::string mimeType() const;
//@}
protected:

@ -46,6 +46,12 @@ EXIV2_RCSID("@(#) $Id$")
#include <string>
#include <cstring>
// *****************************************************************************
namespace {
//! Nikon en/decryption function
void ncrypt(Exiv2::byte* pData, uint32_t size, uint32_t count, uint32_t serial);
}
// *****************************************************************************
// class member definitions
namespace Exiv2 {
@ -118,168 +124,51 @@ namespace Exiv2 {
return tc;
} // TiffMnCreator::create
void MnHeader::setByteOrder(ByteOrder /*byteOrder*/)
{
}
TiffIfdMakernote::TiffIfdMakernote(uint16_t tag,
uint16_t group,
uint16_t mnGroup,
MnHeader* pHeader,
bool hasNext)
: TiffComponent(tag, group),
pHeader_(pHeader),
ifd_(tag, mnGroup, hasNext),
mnOffset_(0),
imageByteOrder_(invalidByteOrder)
{
}
TiffIfdMakernote::~TiffIfdMakernote()
{
delete pHeader_;
}
uint32_t TiffIfdMakernote::ifdOffset() const
{
if (!pHeader_) return 0;
return pHeader_->ifdOffset();
}
ByteOrder TiffIfdMakernote::byteOrder() const
{
assert(imageByteOrder_ != invalidByteOrder);
if (!pHeader_ || pHeader_->byteOrder() == invalidByteOrder) {
return imageByteOrder_;
}
return pHeader_->byteOrder();
}
uint32_t TiffIfdMakernote::mnOffset() const
{
return mnOffset_;
}
uint32_t TiffIfdMakernote::baseOffset() const
MnHeader::~MnHeader()
{
if (!pHeader_) return 0;
return pHeader_->baseOffset(mnOffset_);
}
bool TiffIfdMakernote::readHeader(const byte* pData,
uint32_t size,
ByteOrder byteOrder)
void MnHeader::setByteOrder(ByteOrder /*byteOrder*/)
{
if (!pHeader_) return true;
return pHeader_->read(pData, size, byteOrder);
}
void TiffIfdMakernote::setByteOrder(ByteOrder byteOrder)
uint32_t MnHeader::ifdOffset() const
{
if (pHeader_) pHeader_->setByteOrder(byteOrder);
return 0;
}
uint32_t TiffIfdMakernote::sizeHeader() const
ByteOrder MnHeader::byteOrder() const
{
if (!pHeader_) return 0;
return pHeader_->size();
return invalidByteOrder;
}
uint32_t TiffIfdMakernote::writeHeader(Blob& blob, ByteOrder byteOrder) const
uint32_t MnHeader::baseOffset(uint32_t /*mnOffset*/) const
{
if (!pHeader_) return 0;
return pHeader_->write(blob, byteOrder);
return 0;
}
TiffComponent* TiffIfdMakernote::doAddPath(uint16_t tag, TiffPath& tiffPath)
{
return ifd_.addPath(tag, tiffPath);
}
const byte OlympusMnHeader::signature_[] = {
'O', 'L', 'Y', 'M', 'P', 0x00, 0x01, 0x00
};
const uint32_t OlympusMnHeader::size_ = 8;
TiffComponent* TiffIfdMakernote::doAddChild(TiffComponent::AutoPtr tiffComponent)
OlympusMnHeader::OlympusMnHeader()
{
return ifd_.addChild(tiffComponent);
read(signature_, size_, invalidByteOrder);
}
TiffComponent* TiffIfdMakernote::doAddNext(TiffComponent::AutoPtr tiffComponent)
OlympusMnHeader::~OlympusMnHeader()
{
return ifd_.addNext(tiffComponent);
}
void TiffIfdMakernote::doAccept(TiffVisitor& visitor)
uint32_t OlympusMnHeader::size() const
{
if (visitor.go(TiffVisitor::geTraverse)) visitor.visitIfdMakernote(this);
if (visitor.go(TiffVisitor::geKnownMakernote)) ifd_.accept(visitor);
if ( visitor.go(TiffVisitor::geKnownMakernote)
&& visitor.go(TiffVisitor::geTraverse)) visitor.visitIfdMakernoteEnd(this);
return header_.size_;
}
uint32_t TiffIfdMakernote::doWrite(Blob& blob,
ByteOrder byteOrder,
int32_t offset,
uint32_t /*valueIdx*/,
uint32_t /*dataIdx*/,
uint32_t& imageIdx)
{
mnOffset_ = offset;
setImageByteOrder(byteOrder);
uint32_t len = writeHeader(blob, this->byteOrder());
len += ifd_.write(blob, this->byteOrder(),
offset - baseOffset() + len,
uint32_t(-1), uint32_t(-1),
imageIdx);
return len;
} // TiffIfdMakernote::doWrite
uint32_t TiffIfdMakernote::doWriteData(Blob& /*blob*/,
ByteOrder /*byteOrder*/,
int32_t /*offset*/,
uint32_t /*dataIdx*/,
uint32_t& /*imageIdx*/) const
{
assert(false);
return 0;
} // TiffIfdMakernote::doWriteData
uint32_t TiffIfdMakernote::doWriteImage(Blob& blob,
ByteOrder byteOrder) const
{
if (this->byteOrder() != invalidByteOrder) {
byteOrder = this->byteOrder();
}
uint32_t len = ifd_.writeImage(blob, byteOrder);
return len;
} // TiffIfdMakernote::doWriteImage
uint32_t TiffIfdMakernote::doSize() const
{
return sizeHeader() + ifd_.size();
} // TiffIfdMakernote::doSize
uint32_t TiffIfdMakernote::doCount() const
{
return ifd_.count();
} // TiffIfdMakernote::doCount
uint32_t TiffIfdMakernote::doSizeData() const
{
assert(false);
return 0;
} // TiffIfdMakernote::doSizeData
uint32_t TiffIfdMakernote::doSizeImage() const
uint32_t OlympusMnHeader::ifdOffset() const
{
return ifd_.sizeImage();
} // TiffIfdMakernote::doSizeImage
const byte OlympusMnHeader::signature_[] = {
'O', 'L', 'Y', 'M', 'P', 0x00, 0x01, 0x00
};
const uint32_t OlympusMnHeader::size_ = 8;
OlympusMnHeader::OlympusMnHeader()
{
read(signature_, size_, invalidByteOrder);
return size_;
}
bool OlympusMnHeader::read(const byte* pData,
@ -296,10 +185,10 @@ namespace Exiv2 {
return true;
} // OlympusMnHeader::read
uint32_t OlympusMnHeader::write(Blob& blob,
uint32_t OlympusMnHeader::write(IoWrapper& ioWrapper,
ByteOrder /*byteOrder*/) const
{
append(blob, signature_, size_);
ioWrapper.write(signature_, size_);
return size_;
} // OlympusMnHeader::write
@ -313,6 +202,25 @@ namespace Exiv2 {
read(signature_, size_, invalidByteOrder);
}
Olympus2MnHeader::~Olympus2MnHeader()
{
}
uint32_t Olympus2MnHeader::size() const
{
return header_.size_;
}
uint32_t Olympus2MnHeader::ifdOffset() const
{
return size_;
}
uint32_t Olympus2MnHeader::baseOffset(uint32_t mnOffset) const
{
return mnOffset;
}
bool Olympus2MnHeader::read(const byte* pData,
uint32_t size,
ByteOrder /*byteOrder*/)
@ -327,10 +235,10 @@ namespace Exiv2 {
return true;
} // Olympus2MnHeader::read
uint32_t Olympus2MnHeader::write(Blob& blob,
uint32_t Olympus2MnHeader::write(IoWrapper& ioWrapper,
ByteOrder /*byteOrder*/) const
{
append(blob, signature_, size_);
ioWrapper.write(signature_, size_);
return size_;
} // Olympus2MnHeader::write
@ -345,6 +253,30 @@ namespace Exiv2 {
read(signature_, size_, byteOrder_);
}
FujiMnHeader::~FujiMnHeader()
{
}
uint32_t FujiMnHeader::size() const
{
return header_.size_;
}
uint32_t FujiMnHeader::ifdOffset() const
{
return start_;
}
ByteOrder FujiMnHeader::byteOrder() const
{
return byteOrder_;
}
uint32_t FujiMnHeader::baseOffset(uint32_t mnOffset) const
{
return mnOffset;
}
bool FujiMnHeader::read(const byte* pData,
uint32_t size,
ByteOrder /*byteOrder*/)
@ -362,10 +294,10 @@ namespace Exiv2 {
return true;
} // FujiMnHeader::read
uint32_t FujiMnHeader::write(Blob& blob,
uint32_t FujiMnHeader::write(IoWrapper& ioWrapper,
ByteOrder /*byteOrder*/) const
{
append(blob, signature_, size_);
ioWrapper.write(signature_, size_);
return size_;
} // FujiMnHeader::write
@ -379,6 +311,20 @@ namespace Exiv2 {
read(signature_, size_, invalidByteOrder);
}
Nikon2MnHeader::~Nikon2MnHeader()
{
}
uint32_t Nikon2MnHeader::size() const
{
return size_;
}
uint32_t Nikon2MnHeader::ifdOffset() const
{
return start_;
}
bool Nikon2MnHeader::read(const byte* pData,
uint32_t size,
ByteOrder /*byteOrder*/)
@ -391,10 +337,10 @@ namespace Exiv2 {
return true;
} // Nikon2MnHeader::read
uint32_t Nikon2MnHeader::write(Blob& blob,
uint32_t Nikon2MnHeader::write(IoWrapper& ioWrapper,
ByteOrder /*byteOrder*/) const
{
append(blob, signature_, size_);
ioWrapper.write(signature_, size_);
return size_;
} // Nikon2MnHeader::write
@ -412,6 +358,30 @@ namespace Exiv2 {
start_ = size_;
}
Nikon3MnHeader::~Nikon3MnHeader()
{
}
uint32_t Nikon3MnHeader::size() const
{
return size_;
}
uint32_t Nikon3MnHeader::ifdOffset() const
{
return start_;
}
ByteOrder Nikon3MnHeader::byteOrder() const
{
return byteOrder_;
}
uint32_t Nikon3MnHeader::baseOffset(uint32_t mnOffset) const
{
return mnOffset + 10;
}
bool Nikon3MnHeader::read(const byte* pData,
uint32_t size,
ByteOrder /*byteOrder*/)
@ -427,16 +397,18 @@ namespace Exiv2 {
return true;
} // Nikon3MnHeader::read
uint32_t Nikon3MnHeader::write(Blob& blob,
uint32_t Nikon3MnHeader::write(IoWrapper& ioWrapper,
ByteOrder byteOrder) const
{
assert(buf_.size_ >= 10);
append(blob, buf_.pData_, 10);
ioWrapper.write(buf_.pData_, 10);
// Todo: This removes any gap between the header and
// makernote IFD. The gap should be copied too.
TiffHeader th(byteOrder);
return 10 + th.write(blob);
DataBuf buf = th.write();
ioWrapper.write(buf.pData_, buf.size_);
return 10 + buf.size_;
} // Nikon3MnHeader::write
void Nikon3MnHeader::setByteOrder(ByteOrder byteOrder)
@ -454,6 +426,20 @@ namespace Exiv2 {
read(signature_, size_, invalidByteOrder);
}
PanasonicMnHeader::~PanasonicMnHeader()
{
}
uint32_t PanasonicMnHeader::size() const
{
return size_;
}
uint32_t PanasonicMnHeader::ifdOffset() const
{
return start_;
}
bool PanasonicMnHeader::read(const byte* pData,
uint32_t size,
ByteOrder /*byteOrder*/)
@ -466,10 +452,10 @@ namespace Exiv2 {
return true;
} // PanasonicMnHeader::read
uint32_t PanasonicMnHeader::write(Blob& blob,
uint32_t PanasonicMnHeader::write(IoWrapper& ioWrapper,
ByteOrder /*byteOrder*/) const
{
append(blob, signature_, size_);
ioWrapper.write(signature_, size_);
return size_;
} // PanasonicMnHeader::write
@ -483,6 +469,20 @@ namespace Exiv2 {
read(signature_, size_, invalidByteOrder);
}
PentaxMnHeader::~PentaxMnHeader()
{
}
uint32_t PentaxMnHeader::size() const
{
return header_.size_;
}
uint32_t PentaxMnHeader::ifdOffset() const
{
return size_;
}
bool PentaxMnHeader::read(const byte* pData,
uint32_t size,
ByteOrder /*byteOrder*/)
@ -497,10 +497,10 @@ namespace Exiv2 {
return true;
} // PentaxMnHeader::read
uint32_t PentaxMnHeader::write(Blob& blob,
uint32_t PentaxMnHeader::write(IoWrapper& ioWrapper,
ByteOrder /*byteOrder*/) const
{
append(blob, signature_, size_);
ioWrapper.write(signature_, size_);
return size_;
} // PentaxMnHeader::write
@ -517,6 +517,20 @@ namespace Exiv2 {
read(signature1_, size_, invalidByteOrder);
}
SigmaMnHeader::~SigmaMnHeader()
{
}
uint32_t SigmaMnHeader::size() const
{
return size_;
}
uint32_t SigmaMnHeader::ifdOffset() const
{
return start_;
}
bool SigmaMnHeader::read(const byte* pData,
uint32_t size,
ByteOrder /*byteOrder*/)
@ -530,10 +544,10 @@ namespace Exiv2 {
return true;
} // SigmaMnHeader::read
uint32_t SigmaMnHeader::write(Blob& blob,
uint32_t SigmaMnHeader::write(IoWrapper& ioWrapper,
ByteOrder /*byteOrder*/) const
{
append(blob, signature1_, size_);
ioWrapper.write(signature1_, size_);
return size_;
} // SigmaMnHeader::write
@ -547,6 +561,20 @@ namespace Exiv2 {
read(signature_, size_, invalidByteOrder);
}
SonyMnHeader::~SonyMnHeader()
{
}
uint32_t SonyMnHeader::size() const
{
return size_;
}
uint32_t SonyMnHeader::ifdOffset() const
{
return start_;
}
bool SonyMnHeader::read(const byte* pData,
uint32_t size,
ByteOrder /*byteOrder*/)
@ -559,10 +587,10 @@ namespace Exiv2 {
return true;
} // SonyMnHeader::read
uint32_t SonyMnHeader::write(Blob& blob,
uint32_t SonyMnHeader::write(IoWrapper& ioWrapper,
ByteOrder /*byteOrder*/) const
{
append(blob, signature_, size_);
ioWrapper.write(signature_, size_);
return size_;
} // SonyMnHeader::write
@ -749,4 +777,180 @@ namespace Exiv2 {
return new TiffIfdMakernote(tag, group, mnGroup, 0, true);
}
//! Structure for an index into the array set of complex binary arrays.
struct NikonArrayIdx {
//! Key for comparisons
struct Key {
//! Constructor
Key(uint16_t tag, const char* ver) : tag_(tag), ver_(ver) {}
uint16_t tag_; //!< Tag number
const char* ver_; //!< Version string
};
//! Comparison operator for a key
bool operator==(const Key& key) const
{ return key.tag_ == tag_ && 0 == strncmp(key.ver_, ver_, 4); }
uint16_t tag_; //!< Tag number of the binary array
const char* ver_; //!< Version string
int idx_; //!< Index into the array set
};
//! Nikon binary array version lookup table
extern const NikonArrayIdx nikonArrayIdx[] = {
// NikonCb
{ 0x0097, "0100", 0 },
{ 0x0097, "0102", 1 },
{ 0x0097, "0103", 4 },
{ 0x0097, "0204", 3 },
{ 0x0097, "0205", 2 },
{ 0x0097, "0206", 3 },
{ 0x0097, "0207", 3 },
{ 0x0097, "0208", 3 },
{ 0x0097, "0209", 5 },
// NikonLd
{ 0x0098, "0100", 0 },
{ 0x0098, "0101", 1 },
{ 0x0098, "0201", 1 },
{ 0x0098, "0202", 1 },
{ 0x0098, "0203", 1 },
{ 0x0098, "0204", 2 }
};
int nikonSelector(uint16_t tag, const byte* pData, uint32_t size, TiffComponent* const /*pRoot*/)
{
if (size < 4) return -1;
const NikonArrayIdx* aix = find(nikonArrayIdx, NikonArrayIdx::Key(tag, reinterpret_cast<const char*>(pData)));
return aix == 0 ? -1 : aix->idx_;
}
/*!
@brief Structure for info about an encrypted complex binary array.
*/
struct NikonCryptInfo {
//! Key for comparisons
struct Key {
//! Constructor
Key(uint16_t tag, const char* ver) : tag_(tag), ver_(ver) {}
uint16_t tag_; //!< Tag number
const char* ver_; //!< Version string
};
//! Comparison operator for a key
bool operator==(const Key& key) const
{ return key.tag_ == tag_ && 0 == strncmp(key.ver_, ver_, 4); }
uint16_t tag_; //!< Tag number of the binary array
const char* ver_; //!< Version string
uint32_t start_; //!< Start of the encrypted data
};
//! Info about encrypted complex arrays. Non-encrypted arrays are not listed here.
extern const NikonCryptInfo nikonCryptInfo[] = {
// NikonCb
{ 0x0097, "0204", 284 },
{ 0x0097, "0205", 4 },
{ 0x0097, "0206", 284 },
{ 0x0097, "0207", 284 },
{ 0x0097, "0208", 284 },
{ 0x0097, "0209", 284 },
// NikonLd
{ 0x0098, "0201", 4 },
{ 0x0098, "0202", 4 },
{ 0x0098, "0203", 4 },
{ 0x0098, "0204", 4 }
};
DataBuf nikonCrypt(uint16_t tag, const byte* pData, uint32_t size, TiffComponent* const pRoot)
{
DataBuf buf;
if (size < 4) return buf;
const NikonCryptInfo* nci = find(nikonCryptInfo, NikonCryptInfo::Key(tag, reinterpret_cast<const char*>(pData)));
if (nci == 0 || size <= nci->start_) return buf;
// Find Exif.Nikon3.ShutterCount
TiffFinder finder(0x00a7, Group::nikon3mn);
pRoot->accept(finder);
TiffEntryBase* te = dynamic_cast<TiffEntryBase*>(finder.result());
if (!te || !te->pValue() || te->pValue()->count() == 0) return buf;
uint32_t count = static_cast<uint32_t>(te->pValue()->toLong());
// Find Exif.Nikon3.SerialNumber
finder.init(0x001d, Group::nikon3mn);
pRoot->accept(finder);
te = dynamic_cast<TiffEntryBase*>(finder.result());
if (!te || !te->pValue() || te->pValue()->count() == 0) return buf;
bool ok(false);
uint32_t serial = stringTo<uint32_t>(te->pValue()->toString(), ok);
if (!ok) {
// Find Exif.Image.Model
finder.init(0x0110, Group::ifd0);
pRoot->accept(finder);
te = dynamic_cast<TiffEntryBase*>(finder.result());
if (!te || !te->pValue() || te->pValue()->count() == 0) return buf;
std::string model = te->pValue()->toString();
if (model.find("D50") != std::string::npos) {
serial = 0x22;
}
else {
serial = 0x60;
}
}
buf.alloc(size);
memcpy(buf.pData_, pData, buf.size_);
ncrypt(buf.pData_ + nci->start_, buf.size_ - nci->start_, count, serial);
return buf;
}
}} // namespace Internal, Exiv2
// *****************************************************************************
// local definitions
namespace {
void ncrypt(Exiv2::byte* pData, uint32_t size, uint32_t count, uint32_t serial)
{
static const Exiv2::byte xlat[2][256] = {
{ 0xc1,0xbf,0x6d,0x0d,0x59,0xc5,0x13,0x9d,0x83,0x61,0x6b,0x4f,0xc7,0x7f,0x3d,0x3d,
0x53,0x59,0xe3,0xc7,0xe9,0x2f,0x95,0xa7,0x95,0x1f,0xdf,0x7f,0x2b,0x29,0xc7,0x0d,
0xdf,0x07,0xef,0x71,0x89,0x3d,0x13,0x3d,0x3b,0x13,0xfb,0x0d,0x89,0xc1,0x65,0x1f,
0xb3,0x0d,0x6b,0x29,0xe3,0xfb,0xef,0xa3,0x6b,0x47,0x7f,0x95,0x35,0xa7,0x47,0x4f,
0xc7,0xf1,0x59,0x95,0x35,0x11,0x29,0x61,0xf1,0x3d,0xb3,0x2b,0x0d,0x43,0x89,0xc1,
0x9d,0x9d,0x89,0x65,0xf1,0xe9,0xdf,0xbf,0x3d,0x7f,0x53,0x97,0xe5,0xe9,0x95,0x17,
0x1d,0x3d,0x8b,0xfb,0xc7,0xe3,0x67,0xa7,0x07,0xf1,0x71,0xa7,0x53,0xb5,0x29,0x89,
0xe5,0x2b,0xa7,0x17,0x29,0xe9,0x4f,0xc5,0x65,0x6d,0x6b,0xef,0x0d,0x89,0x49,0x2f,
0xb3,0x43,0x53,0x65,0x1d,0x49,0xa3,0x13,0x89,0x59,0xef,0x6b,0xef,0x65,0x1d,0x0b,
0x59,0x13,0xe3,0x4f,0x9d,0xb3,0x29,0x43,0x2b,0x07,0x1d,0x95,0x59,0x59,0x47,0xfb,
0xe5,0xe9,0x61,0x47,0x2f,0x35,0x7f,0x17,0x7f,0xef,0x7f,0x95,0x95,0x71,0xd3,0xa3,
0x0b,0x71,0xa3,0xad,0x0b,0x3b,0xb5,0xfb,0xa3,0xbf,0x4f,0x83,0x1d,0xad,0xe9,0x2f,
0x71,0x65,0xa3,0xe5,0x07,0x35,0x3d,0x0d,0xb5,0xe9,0xe5,0x47,0x3b,0x9d,0xef,0x35,
0xa3,0xbf,0xb3,0xdf,0x53,0xd3,0x97,0x53,0x49,0x71,0x07,0x35,0x61,0x71,0x2f,0x43,
0x2f,0x11,0xdf,0x17,0x97,0xfb,0x95,0x3b,0x7f,0x6b,0xd3,0x25,0xbf,0xad,0xc7,0xc5,
0xc5,0xb5,0x8b,0xef,0x2f,0xd3,0x07,0x6b,0x25,0x49,0x95,0x25,0x49,0x6d,0x71,0xc7 },
{ 0xa7,0xbc,0xc9,0xad,0x91,0xdf,0x85,0xe5,0xd4,0x78,0xd5,0x17,0x46,0x7c,0x29,0x4c,
0x4d,0x03,0xe9,0x25,0x68,0x11,0x86,0xb3,0xbd,0xf7,0x6f,0x61,0x22,0xa2,0x26,0x34,
0x2a,0xbe,0x1e,0x46,0x14,0x68,0x9d,0x44,0x18,0xc2,0x40,0xf4,0x7e,0x5f,0x1b,0xad,
0x0b,0x94,0xb6,0x67,0xb4,0x0b,0xe1,0xea,0x95,0x9c,0x66,0xdc,0xe7,0x5d,0x6c,0x05,
0xda,0xd5,0xdf,0x7a,0xef,0xf6,0xdb,0x1f,0x82,0x4c,0xc0,0x68,0x47,0xa1,0xbd,0xee,
0x39,0x50,0x56,0x4a,0xdd,0xdf,0xa5,0xf8,0xc6,0xda,0xca,0x90,0xca,0x01,0x42,0x9d,
0x8b,0x0c,0x73,0x43,0x75,0x05,0x94,0xde,0x24,0xb3,0x80,0x34,0xe5,0x2c,0xdc,0x9b,
0x3f,0xca,0x33,0x45,0xd0,0xdb,0x5f,0xf5,0x52,0xc3,0x21,0xda,0xe2,0x22,0x72,0x6b,
0x3e,0xd0,0x5b,0xa8,0x87,0x8c,0x06,0x5d,0x0f,0xdd,0x09,0x19,0x93,0xd0,0xb9,0xfc,
0x8b,0x0f,0x84,0x60,0x33,0x1c,0x9b,0x45,0xf1,0xf0,0xa3,0x94,0x3a,0x12,0x77,0x33,
0x4d,0x44,0x78,0x28,0x3c,0x9e,0xfd,0x65,0x57,0x16,0x94,0x6b,0xfb,0x59,0xd0,0xc8,
0x22,0x36,0xdb,0xd2,0x63,0x98,0x43,0xa1,0x04,0x87,0x86,0xf7,0xa6,0x26,0xbb,0xd6,
0x59,0x4d,0xbf,0x6a,0x2e,0xaa,0x2b,0xef,0xe6,0x78,0xb6,0x4e,0xe0,0x2f,0xdc,0x7c,
0xbe,0x57,0x19,0x32,0x7e,0x2a,0xd0,0xb8,0xba,0x29,0x00,0x3c,0x52,0x7d,0xa8,0x49,
0x3b,0x2d,0xeb,0x25,0x49,0xfa,0xa3,0xaa,0x39,0xa7,0xc5,0xa7,0x50,0x11,0x36,0xfb,
0xc6,0x67,0x4a,0xf5,0xa5,0x12,0x65,0x7e,0xb0,0xdf,0xaf,0x4e,0xb3,0x61,0x7f,0x2f }
};
Exiv2::byte key = 0;
for (int i = 0; i < 4; ++i) {
key ^= (count >> (i*8)) & 0xff;
}
Exiv2::byte ci = xlat[0][serial & 0xff];
Exiv2::byte cj = xlat[1][key];
Exiv2::byte ck = 0x60;
for (uint32_t i = 0; i < size; ++i) {
cj += ci * ck++;
pData[i] ^= cj;
}
}
}

@ -20,8 +20,10 @@
*/
/*!
@file makernote_int.hpp
@brief Internal Makernote TIFF composite class TiffIfdMakernote and classes
for various makernote headers.
@brief Makernote factory and registry, IFD makernote header, and camera
vendor specific makernote implementations.<BR>References:<BR>
[1] <a href="http://www.sno.phy.queensu.ca/~phil/exiftool/">ExifTool</a> by Phil Harvey<BR>
[2] <a href="http://www.cybercom.net/~dcoffin/dcraw/">Decoding raw digital photos in Linux</a> by Dave Coffin
@version $Rev$
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@ -32,7 +34,7 @@
// *****************************************************************************
// included header files
#include "tiffcomposite_int.hpp"
#include "tifffwd_int.hpp"
#include "types.hpp"
// + standard includes
@ -86,6 +88,18 @@ namespace Exiv2 {
const uint16_t olympfe8 = 296; //!< Olympus FE 8 tags
const uint16_t olympfe9 = 297; //!< Olympus FE 9 tags
const uint16_t olympri = 298; //!< Olympus raw info tags
const uint16_t nikonwt = 299; //!< Nikon World Time tags
const uint16_t nikonii = 300; //!< Nikon ISO Info tags
const uint16_t nikonld1 = 301; //!< Nikon Lens Data 1 tags
const uint16_t nikonld2 = 302; //!< Nikon Lens Data 2 tags
const uint16_t nikonld3 = 303; //!< Nikon Lens Data 3 tags
const uint16_t nikoncb1 = 304; //!< Nikon Color Balance 1 Tags
const uint16_t nikoncb2 = 305; //!< Nikon Color Balance 2 Tags
const uint16_t nikoncb2a = 306; //!< Nikon Color Balance 2 Tags
const uint16_t nikoncb2b = 307; //!< Nikon Color Balance 2 Tags
const uint16_t nikoncb3 = 308; //!< Nikon Color Balance 3 Tags
const uint16_t nikoncb4 = 309; //!< Nikon Color Balance 4 Tags
const uint16_t canonfi = 310; //!< Canon File Info
}
// *****************************************************************************
@ -169,7 +183,7 @@ namespace Exiv2 {
//! @name Creators
//@{
//! Virtual destructor.
virtual ~MnHeader() {}
virtual ~MnHeader();
//@}
//! @name Manipulators
//@{
@ -187,179 +201,29 @@ namespace Exiv2 {
//! Return the size of the header (in bytes).
virtual uint32_t size() const =0;
//! Write the header to a data buffer, return the number of bytes written.
virtual uint32_t write(Blob& blob,
ByteOrder byteOrder) const =0;
virtual uint32_t write(IoWrapper& ioWrapper,
ByteOrder byteOrder) const =0;
/*!
@brief Return the offset to the start of the Makernote IFD from
the start of the Makernote (= the start of the header).
*/
virtual uint32_t ifdOffset() const { return 0; }
virtual uint32_t ifdOffset() const;
/*!
@brief Return the byte order for the makernote. If the return value is
invalidByteOrder, this means that the byte order of the the
image should be used for the makernote.
*/
virtual ByteOrder byteOrder() const { return invalidByteOrder; }
virtual ByteOrder byteOrder() const;
/*!
@brief Return the base offset for the makernote IFD entries relative
to the start of the TIFF header. \em mnOffset is the offset
to the makernote from the start of the TIFF header.
*/
virtual uint32_t baseOffset(uint32_t /*mnOffset*/) const { return 0; }
virtual uint32_t baseOffset(uint32_t /*mnOffset*/) const;
//@}
}; // class MnHeader
/*!
@brief Tiff IFD Makernote. This is a concrete class suitable for all
IFD makernotes.
Contains a makernote header (which can be 0) and an IFD and
implements child mgmt functions to deal with the IFD entries. The
various makernote weirdnesses are taken care of in the makernote
header (and possibly in special purpose IFD entries).
*/
class TiffIfdMakernote : public TiffComponent {
friend class TiffReader;
public:
//! @name Creators
//@{
//! Default constructor
TiffIfdMakernote(uint16_t tag,
uint16_t group,
uint16_t mnGroup,
MnHeader* pHeader,
bool hasNext =true);
//! Virtual destructor
virtual ~TiffIfdMakernote();
//@}
//! @name Manipulators
//@{
/*!
@brief Read the header from a data buffer, return true if successful.
The default implementation simply returns true.
*/
bool readHeader(const byte* pData, uint32_t size, ByteOrder byteOrder);
/*!
@brief Set the byte order for the makernote.
*/
void setByteOrder(ByteOrder byteOrder);
/*!
@brief Set the byte order used for the image.
*/
void setImageByteOrder(ByteOrder byteOrder) { imageByteOrder_ = byteOrder; }
//@}
//! @name Accessors
//@{
//! Return the size of the header in bytes.
uint32_t sizeHeader() const;
//! Write the header to a data buffer, return the number of bytes written.
uint32_t writeHeader(Blob& blob, ByteOrder byteOrder) const;
/*!
@brief Return the offset to the makernote from the start of the
TIFF header.
*/
uint32_t mnOffset() const;
/*!
@brief Return the offset to the start of the Makernote IFD from
the start of the Makernote.
Returns 0 if there is no header.
*/
uint32_t ifdOffset() const;
/*!
@brief Return the byte order for the makernote. Requires the image
byte order to be set (setImageByteOrder()). Returns the byte
order for the image if there is no header or the byte order for
the header is \c invalidByteOrder.
*/
ByteOrder byteOrder() const;
/*!
@brief Return the byte order used for the image.
*/
ByteOrder imageByteOrder() const { return imageByteOrder_; }
/*!
@brief Return the base offset for use with the makernote IFD entries
relative to the start of the TIFF header.
Returns 0 if there is no header.
*/
uint32_t baseOffset() const;
//@}
protected:
//! @name Manipulators
//@{
virtual TiffComponent* doAddPath(uint16_t tag, TiffPath& tiffPath);
virtual TiffComponent* doAddChild(TiffComponent::AutoPtr tiffComponent);
virtual TiffComponent* doAddNext(TiffComponent::AutoPtr tiffComponent);
virtual void doAccept(TiffVisitor& visitor);
//@}
//! @name Write support (Manipulators)
//@{
/*!
@brief Implements write(). Write the Makernote header, TIFF directory,
values and additional data to the blob, return the number of
bytes written.
*/
virtual uint32_t doWrite(Blob& blob,
ByteOrder byteOrder,
int32_t offset,
uint32_t valueIdx,
uint32_t dataIdx,
uint32_t& imageIdx);
//@}
//! @name Write support (Accessors)
//@{
/*!
@brief This class does not really implement writeData(), it only has
write(). This method must not be called; it commits suicide.
*/
virtual uint32_t doWriteData(Blob& blob,
ByteOrder byteOrder,
int32_t offset,
uint32_t dataIdx,
uint32_t& imageIdx) const;
/*!
@brief Implements writeImage(). Write the image data of the IFD of
the Makernote. Return the number of bytes written.
*/
virtual uint32_t doWriteImage(Blob& blob,
ByteOrder byteOrder) const;
/*!
@brief Implements size(). Return the size of the Makernote header,
TIFF directory, values and additional data.
*/
virtual uint32_t doSize() const;
/*!
@brief Implements count(). Return the number of entries in the IFD
of the Makernote. Does not count entries which are marked as
deleted.
*/
virtual uint32_t doCount() const;
/*!
@brief This class does not really implement sizeData(), it only has
size(). This method must not be called; it commits suicide.
*/
virtual uint32_t doSizeData() const;
/*!
@brief Implements sizeImage(). Return the total image data size of the
makernote IFD.
*/
virtual uint32_t doSizeImage() const;
//@}
private:
// DATA
MnHeader* pHeader_; //!< Makernote header
TiffDirectory ifd_; //!< Makernote IFD
uint32_t mnOffset_; //!< Makernote offset
ByteOrder imageByteOrder_; //!< Byte order for the image
}; // class TiffIfdMakernote
//! Header of an Olympus Makernote
class OlympusMnHeader : public MnHeader {
public:
@ -368,7 +232,7 @@ namespace Exiv2 {
//! Default constructor
OlympusMnHeader();
//! Virtual destructor.
virtual ~OlympusMnHeader() {}
virtual ~OlympusMnHeader();
//@}
//! @name Manipulators
//@{
@ -378,9 +242,9 @@ namespace Exiv2 {
//@}
//! @name Accessors
//@{
virtual uint32_t size() const { return header_.size_; }
virtual uint32_t write(Blob& blob, ByteOrder byteOrder) const;
virtual uint32_t ifdOffset() const { return size_; }
virtual uint32_t size() const;
virtual uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const;
virtual uint32_t ifdOffset() const;
//@}
private:
@ -398,7 +262,7 @@ namespace Exiv2 {
//! Default constructor
Olympus2MnHeader();
//! Virtual destructor.
virtual ~Olympus2MnHeader() {}
virtual ~Olympus2MnHeader();
//@}
//! @name Manipulators
//@{
@ -408,10 +272,10 @@ namespace Exiv2 {
//@}
//! @name Accessors
//@{
virtual uint32_t size() const { return header_.size_; }
virtual uint32_t write(Blob& blob, ByteOrder byteOrder) const;
virtual uint32_t ifdOffset() const { return size_; }
virtual uint32_t baseOffset(uint32_t mnOffset) const { return mnOffset; }
virtual uint32_t size() const;
virtual uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const;
virtual uint32_t ifdOffset() const;
virtual uint32_t baseOffset(uint32_t mnOffset) const;
//@}
private:
@ -429,7 +293,7 @@ namespace Exiv2 {
//! Default constructor
FujiMnHeader();
//! Virtual destructor.
virtual ~FujiMnHeader() {}
virtual ~FujiMnHeader();
//@}
//! @name Manipulators
//@{
@ -440,11 +304,11 @@ namespace Exiv2 {
//@}
//! @name Accessors
//@{
virtual uint32_t size() const { return header_.size_; }
virtual uint32_t write(Blob& blob, ByteOrder byteOrder) const;
virtual uint32_t ifdOffset() const { return start_; }
virtual ByteOrder byteOrder() const { return byteOrder_; }
virtual uint32_t baseOffset(uint32_t mnOffset) const { return mnOffset; }
virtual uint32_t size() const;
virtual uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const;
virtual uint32_t ifdOffset() const;
virtual ByteOrder byteOrder() const;
virtual uint32_t baseOffset(uint32_t mnOffset) const;
//@}
private:
@ -464,7 +328,7 @@ namespace Exiv2 {
//! Default constructor
Nikon2MnHeader();
//! Virtual destructor.
virtual ~Nikon2MnHeader() {}
virtual ~Nikon2MnHeader();
//@}
//! @name Manipulators
//@{
@ -474,9 +338,9 @@ namespace Exiv2 {
//@}
//! @name Accessors
//@{
virtual uint32_t size() const { return size_; }
virtual uint32_t write(Blob& blob, ByteOrder byteOrder) const;
virtual uint32_t ifdOffset() const { return start_; }
virtual uint32_t size() const;
virtual uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const;
virtual uint32_t ifdOffset() const;
//@}
private:
@ -495,7 +359,7 @@ namespace Exiv2 {
//! Default constructor
Nikon3MnHeader();
//! Virtual destructor.
virtual ~Nikon3MnHeader() {}
virtual ~Nikon3MnHeader();
//@}
//! @name Manipulators
//@{
@ -506,11 +370,11 @@ namespace Exiv2 {
//@}
//! @name Accessors
//@{
virtual uint32_t size() const { return size_; }
virtual uint32_t write(Blob& blob, ByteOrder byteOrder) const;
virtual uint32_t ifdOffset() const { return start_; }
virtual ByteOrder byteOrder() const { return byteOrder_; }
virtual uint32_t baseOffset(uint32_t mnOffset) const { return mnOffset + 10; }
virtual uint32_t size() const;
virtual uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const;
virtual uint32_t ifdOffset() const;
virtual ByteOrder byteOrder() const;
virtual uint32_t baseOffset(uint32_t mnOffset) const;
//@}
private:
@ -530,7 +394,7 @@ namespace Exiv2 {
//! Default constructor
PanasonicMnHeader();
//! Virtual destructor.
virtual ~PanasonicMnHeader() {}
virtual ~PanasonicMnHeader();
//@}
//! @name Manipulators
//@{
@ -540,9 +404,9 @@ namespace Exiv2 {
//@}
//! @name Accessors
//@{
virtual uint32_t size() const { return size_; }
virtual uint32_t write(Blob& blob, ByteOrder byteOrder) const;
virtual uint32_t ifdOffset() const { return start_; }
virtual uint32_t size() const;
virtual uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const;
virtual uint32_t ifdOffset() const;
//@}
private:
@ -561,7 +425,7 @@ namespace Exiv2 {
//! Default constructor
PentaxMnHeader();
//! Virtual destructor.
virtual ~PentaxMnHeader() {}
virtual ~PentaxMnHeader();
//@}
//! @name Manipulators
//@{
@ -571,9 +435,9 @@ namespace Exiv2 {
//@}
//! @name Accessors
//@{
virtual uint32_t size() const { return header_.size_; }
virtual uint32_t write(Blob& blob, ByteOrder byteOrder) const;
virtual uint32_t ifdOffset() const { return size_; }
virtual uint32_t size() const;
virtual uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const;
virtual uint32_t ifdOffset() const;
//@}
private:
@ -591,7 +455,7 @@ namespace Exiv2 {
//! Default constructor
SigmaMnHeader();
//! Virtual destructor.
virtual ~SigmaMnHeader() {}
virtual ~SigmaMnHeader();
//@}
//! @name Manipulators
//@{
@ -601,9 +465,9 @@ namespace Exiv2 {
//@}
//! @name Accessors
//@{
virtual uint32_t size() const { return size_; }
virtual uint32_t write(Blob& blob, ByteOrder byteOrder) const;
virtual uint32_t ifdOffset() const { return start_; }
virtual uint32_t size() const;
virtual uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const;
virtual uint32_t ifdOffset() const;
//@}
private:
@ -623,7 +487,7 @@ namespace Exiv2 {
//! Default constructor
SonyMnHeader();
//! Virtual destructor.
virtual ~SonyMnHeader() {}
virtual ~SonyMnHeader();
//@}
//! @name Manipulators
//@{
@ -633,9 +497,9 @@ namespace Exiv2 {
//@}
//! @name Accessors
//@{
virtual uint32_t size() const { return size_; }
virtual uint32_t write(Blob& blob, ByteOrder byteOrder) const;
virtual uint32_t ifdOffset() const { return start_; }
virtual uint32_t size() const;
virtual uint32_t write(IoWrapper& ioWrapper, ByteOrder byteOrder) const;
virtual uint32_t ifdOffset() const;
//@}
private:
@ -771,6 +635,35 @@ namespace Exiv2 {
uint16_t group,
uint16_t mnGroup);
/*!
@brief Function to select cfg + def of a Nikon complex binary array.
@param tag Tag number of the binary array
@param pData Pointer to the raw array data.
@param size Size of the array data.
@param pRoot Pointer to the root component of the TIFF tree.
@return An index into the array set, -1 if no match was found.
*/
int nikonSelector(uint16_t tag, const byte* pData, uint32_t size, TiffComponent* const pRoot);
/*!
@brief Encrypt and decrypt Nikon data.
Checks the version of the Nikon data array and en/decrypts (portions of) it as
needed. (The Nikon encryption algorithm is symmetric.)
@note This function requires access to other components of the composite, it
should only be called after all other components are read.
@param tag Tag number of the binary array
@param pData Pointer to the start of the data to en/decrypt.
@param size Size of the data buffer.
@param pRoot Pointer to the root element of the composite.
@return En/decrypted data. Ownership of the memory is passed to the caller.
The buffer may be empty in case no decryption was needed.
*/
DataBuf nikonCrypt(uint16_t tag, const byte* pData, uint32_t size, TiffComponent* const pRoot);
}} // namespace Internal, Exiv2
#endif // #ifndef MAKERNOTE_INT_HPP_

@ -274,15 +274,9 @@ namespace Exiv2 {
This method is provided mostly for convenient and versatile output of
the value which can (to some extent) be formatted through standard
stream manipulators. Do not attempt to write to the value through
this reference.
<b>Example:</b> <br>
@code
ExifData::const_iterator i = exifData.findKey(key);
if (i != exifData.end()) {
std::cout << i->key() << " " << std::hex << i->value() << "\n";
}
@endcode
this reference. An Error is thrown if the value is not set; as an
alternative to catching it, one can use count() to check if there
is any data before calling this method.
@return A constant reference to the value.
@throw Error if the value is not set.
@ -302,23 +296,6 @@ namespace Exiv2 {
}; // class Metadatum
//! Unary predicate that matches a Exifdatum with a given key
class EXIV2API FindMetadatumByKey {
public:
//! Constructor, initializes the object with the key to look for
FindMetadatumByKey(const std::string& key) : key_(key) {}
/*!
@brief Returns true if the key of the argument metadatum is equal
to that of the object.
*/
bool operator()(const Metadatum& metadatum) const
{ return key_ == metadatum.key(); }
private:
std::string key_;
}; // class FindMetadatumByKey
/*!
@brief Output operator for Metadatum types, writing the interpreted
tag value.

@ -59,6 +59,11 @@ namespace Exiv2 {
{
} // MrwImage::MrwImage
std::string MrwImage::mimeType() const
{
return "image/x-minolta-mrw";
}
int MrwImage::pixelWidth() const
{
ExifData::const_iterator imageWidth = exifData_.findKey(Exiv2::ExifKey("Exif.Image.ImageWidth"));

@ -104,7 +104,7 @@ namespace Exiv2 {
//! @name Accessors
//@{
std::string mimeType() const { return "image/x-minolta-mrw"; }
std::string mimeType() const;
int pixelWidth() const;
int pixelHeight() const;
//@}

File diff suppressed because it is too large Load Diff

@ -110,6 +110,28 @@ namespace Exiv2 {
public:
//! Return read-only list of built-in Nikon3 tags
static const TagInfo* tagList();
//! Return read-only list of built-in World time tags
static const TagInfo* tagListWt();
//! Return read-only list of built-in ISO info tags
static const TagInfo* tagListIi();
//! Return read-only list of built-in Color Balance 1 tags
static const TagInfo* tagListCb1();
//! Return read-only list of built-in Color Balance 2 tags
static const TagInfo* tagListCb2();
//! Return read-only list of built-in Color Balance 2a tags
static const TagInfo* tagListCb2a();
//! Return read-only list of built-in Color Balance 2b tags
static const TagInfo* tagListCb2b();
//! Return read-only list of built-in Color Balance 3 tags
static const TagInfo* tagListCb3();
//! Return read-only list of built-in Color Balance 4 tags
static const TagInfo* tagListCb4();
//! Return read-only list of built-in Lens Data 1 tags
static const TagInfo* tagListLd1();
//! Return read-only list of built-in Lens Data 2 tags
static const TagInfo* tagListLd2();
//! Return read-only list of built-in Lens Data 3 tags
static const TagInfo* tagListLd3();
//! @name Print functions for Nikon3 %MakerNote tags
//@{
@ -131,17 +153,46 @@ namespace Exiv2 {
static std::ostream& print0x0089(std::ostream& os, const Value& value, const ExifData* metadata);
//! Print number of lens stops
static std::ostream& print0x008b(std::ostream& os, const Value& value, const ExifData*);
//! Print number of lens data
static std::ostream& print0x0098(std::ostream& os, const Value& value, const ExifData*);
//! Print lens name
static std::ostream& printLensId(std::ostream& os, const Value& value, const ExifData* metadata, const std::string& group);
static std::ostream& printLensId1(std::ostream& os, const Value& value, const ExifData* metadata);
static std::ostream& printLensId2(std::ostream& os, const Value& value, const ExifData* metadata);
static std::ostream& printLensId3(std::ostream& os, const Value& value, const ExifData* metadata);
//! Print sensor pixel size
static std::ostream& print0x009a(std::ostream& os, const Value& value, const ExifData*);
//! Print retouch history
static std::ostream& print0x009e(std::ostream& os, const Value& value, const ExifData*);
//! Print Exif.NikonIi.ISO(2)
static std::ostream& printIiIso(std::ostream& os, const Value& value, const ExifData*);
//@}
private:
//! Tag information
static const TagInfo tagInfo_[];
//! World Time tag information
static const TagInfo tagInfoWt_[];
//! ISO info tag information
static const TagInfo tagInfoIi_[];
//! Color Balance 1 tag information
static const TagInfo tagInfoCb1_[];
//! Color Balance 2 tag information
static const TagInfo tagInfoCb2_[];
//! Color Balance 2a tag information
static const TagInfo tagInfoCb2a_[];
//! Color Balance 2b tag information
static const TagInfo tagInfoCb2b_[];
//! Color Balance 3 tag information
static const TagInfo tagInfoCb3_[];
//! Color Balance 4 tag information
static const TagInfo tagInfoCb4_[];
//! Lens Data 1 tag information
static const TagInfo tagInfoLd1_[];
//! Lens Data 2 tag information
static const TagInfo tagInfoLd2_[];
//! Lens Data 3 tag information
static const TagInfo tagInfoLd3_[];
}; // class Nikon3MakerNote

@ -63,6 +63,11 @@ namespace Exiv2 {
{
} // OrfImage::OrfImage
std::string OrfImage::mimeType() const
{
return "image/x-olympus-orf";
}
int OrfImage::pixelWidth() const
{
ExifData::const_iterator imageWidth = exifData_.findKey(Exiv2::ExifKey("Exif.Image.ImageWidth"));
@ -232,10 +237,10 @@ namespace Exiv2 {
return true;
} // OrfHeader::read
uint32_t OrfHeader::write(Blob& blob) const
DataBuf OrfHeader::write() const
{
// Todo: Implement me!
return 0;
return DataBuf();
}
}} // namespace Internal, Exiv2

@ -103,7 +103,7 @@ namespace Exiv2 {
//! @name Accessors
//@{
std::string mimeType() const { return "image/x-olympus-orf"; }
std::string mimeType() const;
int pixelWidth() const;
int pixelHeight() const;
//@}

@ -63,7 +63,7 @@ namespace Exiv2 {
//! @name Accessors
//@{
uint32_t write(Blob& blob) const;
DataBuf write() const;
//@}
}; // class OrfHeader

@ -610,7 +610,10 @@ namespace Exiv2 {
{ 0x07f2, "smc PENTAX-DA* 16-50mm F2.8 ED AL [IF] SDM (SDM not used)" },
{ 0x07f3, "smc PENTAX-DA 70mm F2.4 Limited" },
{ 0x07f4, "smc PENTAX-DA 21mm F3.2 AL Limited" },
{ 0x08ea, "smc PENTAX-DA* 300 mm F4ED [IF] SDM" },
{ 0x08e2, "smc PENTAX-DA* 55mm F1.4 SDM" },
{ 0x08e3, "smc PENTAX DA* 60-250mm F4 [IF] SDM"},
{ 0x08e8, "smc PENTAX-DA 17-70mm F4 AL [IF] SDM" },
{ 0x08ea, "smc PENTAX-DA* 300mm F4 ED [IF] SDM" },
{ 0x08eb, "smc PENTAX-DA* 200mm F2.8 ED [IF] SDM" },
{ 0x08f1, "smc PENTAX-DA* 50-135mm F2.8 ED [IF] SDM" },
{ 0x08f2, "smc PENTAX-DA* 16-50mm F2.8 ED AL [IF] SDM" },

@ -0,0 +1,331 @@
// ***************************************************************** -*- C++ -*-
/*
* Copyright (C) 2004-2009 Andreas Huggel <ahuggel@gmx.net>
*
* This program is part of the Exiv2 distribution.
*
* 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
* of the License, 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 this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
*/
/*
File: pgfimage.cpp
Version: $Rev$
Author(s): Gilles Caulier (cgilles) <caulier dot gilles at gmail dot com>
History: 16-Jun-09, gc: submitted
Credits: See header file
*/
// *****************************************************************************
#include "rcsid.hpp"
EXIV2_RCSID("@(#) $Id$")
// *****************************************************************************
#define DEBUG 1
// *****************************************************************************
// included header files
#ifdef _MSC_VER
# include "exv_msvc.h"
#else
# include "exv_conf.h"
#endif
#include "pgfimage.hpp"
#include "image.hpp"
#include "pngimage.hpp"
#include "basicio.hpp"
#include "error.hpp"
#include "futils.hpp"
// + standard includes
#include <string>
#include <cstring>
#include <iostream>
#include <cassert>
// Signature from front of PGF file
const unsigned char pgfSignature[3] = { 0x50, 0x47, 0x46 };
const unsigned char pgfBlank[] = { 0x50,0x47,0x46,0x36,0x10,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,
0x00,0x00,0x18,0x03,0x03,0x00,0x00,0x00,0x14,0x00,0x67,0x08,0x20,0x00,0xc0,0x01,
0x00,0x00,0x37,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x37,0x00,
0x00,0x78,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x37,0x00,0x00,0x78,0x00,0x00,
0x00,0x00,0x01,0x00,0x00,0x00,0x37,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x01,0x00,
0x00,0x00,0x37,0x00,0x00,0x78,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x37,0x00,
0x00,0x78,0x00,0x00,0x00,0x00,0x01,0x00,0x00,0x00
};
// *****************************************************************************
// class member definitions
namespace Exiv2 {
PgfImage::PgfImage(BasicIo::AutoPtr io, bool create)
: Image(ImageType::pgf, mdExif | mdIptc| mdXmp | mdComment, io)
{
if (create)
{
if (io_->open() == 0)
{
#ifdef DEBUG
std::cerr << "Exiv2::PgfImage:: Creating PGF image to memory\n";
#endif
IoCloser closer(*io_);
if (io_->write(pgfBlank, sizeof(pgfBlank)) != sizeof(pgfBlank))
{
#ifdef DEBUG
std::cerr << "Exiv2::PgfImage:: Failed to create PGF image on memory\n";
#endif
}
}
}
} // PgfImage::PgfImage
void PgfImage::readMetadata()
{
#ifdef DEBUG
std::cerr << "Exiv2::PgfImage::readMetadata: Reading PGF file " << io_->path() << "\n";
#endif
if (io_->open() != 0)
{
throw Error(9, io_->path(), strError());
}
IoCloser closer(*io_);
// Ensure that this is the correct image type
if (!isPgfType(*io_, true))
{
if (io_->error() || io_->eof()) throw Error(14);
throw Error(3, "PGF");
}
clearMetadata();
readPgfMagicNumber(*io_);
uint32_t headerSize = readPgfHeaderSize(*io_);
readPgfHeaderStructure(*io_, &pixelWidth_, &pixelHeight_);
// And now, the most interresting, the user data byte array where metadata are stored as small image.
long size = 8 + headerSize - io_->tell();
#ifdef DEBUG
std::cout << "Exiv2::PgfImage::readMetadata: Found Image data (" << size << " bytes)\n";
#endif
if (size < 0) throw Error(20);
if (size == 0) return;
DataBuf imgData(size);
std::memset(imgData.pData_, 0x0, imgData.size_);
long bufRead = io_->read(imgData.pData_, imgData.size_);
if (io_->error()) throw Error(14);
if (bufRead != imgData.size_) throw Error(20);
Image::AutoPtr image = Exiv2::ImageFactory::open(imgData.pData_, imgData.size_);
image->readMetadata();
exifData() = image->exifData();
iptcData() = image->iptcData();
xmpData() = image->xmpData();
} // PgfImage::readMetadata
void PgfImage::writeMetadata()
{
if (io_->open() != 0)
{
throw Error(9, io_->path(), strError());
}
IoCloser closer(*io_);
BasicIo::AutoPtr tempIo(io_->temporary()); // may throw
assert (tempIo.get() != 0);
doWriteMetadata(*tempIo); // may throw
io_->close();
io_->transfer(*tempIo); // may throw
} // PgfImage::writeMetadata
void PgfImage::doWriteMetadata(BasicIo& outIo)
{
if (!io_->isopen()) throw Error(20);
if (!outIo.isopen()) throw Error(21);
#ifdef DEBUG
std::cout << "Exiv2::PgfImage::doWriteMetadata: Writing PGF file " << io_->path() << "\n";
std::cout << "Exiv2::PgfImage::doWriteMetadata: tmp file created " << outIo.path() << "\n";
#endif
// Ensure that this is the correct image type
if (!isPgfType(*io_, true))
{
if (io_->error() || io_->eof()) throw Error(20);
throw Error(22);
}
// Ensure PGF version.
byte mnb = readPgfMagicNumber(*io_);
readPgfHeaderSize(*io_);
int w, h;
DataBuf header = readPgfHeaderStructure(*io_, &w, &h);
Image::AutoPtr img = ImageFactory::create(ImageType::png);
img->setExifData(exifData_);
img->setIptcData(iptcData_);
img->setXmpData(xmpData_);
img->writeMetadata();
int imgSize = img->io().size();
DataBuf imgBuf = img->io().read(imgSize);
#ifdef DEBUG
std::cout << "Exiv2::PgfImage::doWriteMetadata: Creating image to host metadata (" << imgSize << " bytes)\n";
#endif
//---------------------------------------------------------------
// Write PGF Signature.
if (outIo.write(pgfSignature, 3) != 3) throw Error(21);
// Write Magic number.
if (outIo.putb(mnb) == EOF) throw Error(21);
// Write new Header size.
uint32_t newHeaderSize = header.size_ + imgSize;
DataBuf buffer(4);
memcpy (buffer.pData_, &newHeaderSize, 4);
if (outIo.write(buffer.pData_, 4) != 4) throw Error(21);
#ifdef DEBUG
std::cout << "Exiv2::PgfImage: new PGF header size : " << newHeaderSize << " bytes\n";
printf("%x\n", buffer.pData_[0]);
printf("%x\n", buffer.pData_[1]);
printf("%x\n", buffer.pData_[2]);
printf("%x\n", buffer.pData_[3]);
#endif
// Write Header data.
if (outIo.write(header.pData_, header.size_) != header.size_) throw Error(21);
// Write new metadata byte array.
if (outIo.write(imgBuf.pData_, imgBuf.size_) != imgBuf.size_) throw Error(21);
// Copy the rest of PGF image data.
DataBuf buf(4096);
long readSize = 0;
while ((readSize=io_->read(buf.pData_, buf.size_)))
{
if (outIo.write(buf.pData_, readSize) != readSize) throw Error(21);
}
if (outIo.error()) throw Error(21);
} // PgfImage::doWriteMetadata
byte PgfImage::readPgfMagicNumber(BasicIo& iIo)
{
byte b = iIo.getb();
if (iIo.error()) throw Error(14);
if (b < 0x36) // 0x36 = '6'.
{
// Not right Magick version.
#ifdef DEBUG
std::cout << "Exiv2::PgfImage::readMetadata: wrong Magick number\n";
#endif
}
return b;
} // PgfImage::readPgfMagicNumber
uint32_t PgfImage::readPgfHeaderSize(BasicIo& iIo)
{
DataBuf buffer(4);
long bufRead = iIo.read(buffer.pData_, buffer.size_);
if (iIo.error()) throw Error(14);
if (bufRead != buffer.size_) throw Error(20);
uint32_t headerSize = 0;
memcpy (&headerSize, buffer.pData_, 4); // TODO : check endianness.
if (headerSize <= 0 ) throw Error(22);
#ifdef DEBUG
std::cout << "Exiv2::PgfImage: PGF header size : " << headerSize << " bytes\n";
#endif
return headerSize;
} // PgfImage::readPgfHeaderSize
DataBuf PgfImage::readPgfHeaderStructure(BasicIo& iIo, int* width, int* height)
{
DataBuf header(16);
long bufRead = iIo.read(header.pData_, header.size_);
if (iIo.error()) throw Error(14);
if (bufRead != header.size_) throw Error(20);
memcpy(width, &header.pData_[0], 4); // TODO : check endianness.
memcpy(height, &header.pData_[4], 4); // TODO : check endianness.
/* NOTE: properties not yet used
byte nLevels = buffer.pData_[8];
byte quality = buffer.pData_[9];
byte bpp = buffer.pData_[10];
byte channels = buffer.pData_[11];
*/
byte mode = header.pData_[12];
if (mode == 2) // Indexed color image. We pass color table (256 * 3 bytes).
{
header.alloc(16 + 256*3);
bufRead = iIo.read(&header.pData_[16], 256*3);
if (iIo.error()) throw Error(14);
if (bufRead != 256*3) throw Error(20);
}
return header;
} // PgfImage::readPgfHeaderStructure
// *************************************************************************
// free functions
Image::AutoPtr newPgfInstance(BasicIo::AutoPtr io, bool create)
{
Image::AutoPtr image(new PgfImage(io, create));
if (!image->good())
{
image.reset();
}
return image;
}
bool isPgfType(BasicIo& iIo, bool advance)
{
const int32_t len = 3;
byte buf[len];
iIo.read(buf, len);
if (iIo.error() || iIo.eof())
{
return false;
}
int rc = memcmp(buf, pgfSignature, 3);
if (!advance || rc != 0)
{
iIo.seek(-len, BasicIo::cur);
}
return rc == 0;
}
} // namespace Exiv2

@ -0,0 +1,137 @@
// ***************************************************************** -*- C++ -*-
/*
* Copyright (C) 2004-2009 Andreas Huggel <ahuggel@gmx.net>
*
* This program is part of the Exiv2 distribution.
*
* 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
* of the License, 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 this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, 5th Floor, Boston, MA 02110-1301 USA.
*/
/*!
@file pgfimage.hpp
@brief PGF image, implemented using the following references:
<a href="http://www.libpgf.org/uploads/media/PGF_stamm_wscg02.pdf">PGF specification</a> from libpgf web site<br>
@version $Rev$
@author Andreas Huggel (ahu)
<a href="mailto:ahuggel@gmx.net">ahuggel@gmx.net</a>
@author Gilles Caulier (cgilles)
<a href="mailto:caulier dot gilles at gmail dot com">caulier dot gilles at gmail dot com</a>
@date 16-Jun-09, gc: submitted
*/
#ifndef PGFIMAGE_HPP_
#define PGFIMAGE_HPP_
// *****************************************************************************
// included header files
#include "image.hpp"
#include "basicio.hpp"
#include "types.hpp"
// + standard includes
#include <string>
// *****************************************************************************
// namespace extensions
namespace Exiv2
{
// *****************************************************************************
// class definitions
// Add PGF to the supported image formats
namespace ImageType
{
const int pgf = 17; //!< PGF image type (see class PgfImage)
}
/*!
@brief Class to access PGF images. Exif and IPTC metadata are supported
directly.
*/
class EXIV2API PgfImage : public Image {
public:
//! @name Creators
//@{
/*!
@brief Constructor that can either open an existing PGF image or create
a new image from scratch. If a new image is to be created, any
existing data is overwritten. Since the constructor can not return
a result, callers should check the good() method after object
construction to determine success or failure.
@param io An auto-pointer that owns a BasicIo instance used for
reading and writing image metadata. \b Important: The constructor
takes ownership of the passed in BasicIo instance through the
auto-pointer. Callers should not continue to use the BasicIo
instance after it is passed to this method. Use the Image::io()
method to get a temporary reference.
@param create Specifies if an existing image should be read (false)
or if a new file should be created (true).
*/
PgfImage(BasicIo::AutoPtr io, bool create);
//@}
//! @name Manipulators
//@{
void readMetadata();
void writeMetadata();
//@}
//! @name Accessors
//@{
std::string mimeType() const { return "image/pgf"; }
//@}
private:
//! @name NOT implemented
//@{
//! Copy constructor
PgfImage(const PgfImage& rhs);
//! Assignment operator
PgfImage& operator=(const PgfImage& rhs);
/*!
@brief Provides the main implementation of writeMetadata() by
writing all buffered metadata to the provided BasicIo.
@param oIo BasicIo instance to write to (a temporary location).
@return 4 if opening or writing to the associated BasicIo fails
*/
EXV_DLLLOCAL void doWriteMetadata(BasicIo& oIo);
//! Read Magick number. Only version >= 6 is supported.
byte readPgfMagicNumber(BasicIo& iIo);
//! Read PGF Header size encoded in 32 bits integer.
uint32_t readPgfHeaderSize(BasicIo& iIo);
//! Read header structure.
DataBuf readPgfHeaderStructure(BasicIo& iIo, int* width, int* height);
//@}
}; // class PgfImage
// *****************************************************************************
// template, inline and free functions
// These could be static private functions on Image subclasses but then
// ImageFactory needs to be made a friend.
/*!
@brief Create a new PgfImage instance and return an auto-pointer to it.
Caller owns the returned object and the auto-pointer ensures that
it will be deleted.
*/
EXIV2API Image::AutoPtr newPgfInstance(BasicIo::AutoPtr io, bool create);
//! Check if the file iIo is a PGF image.
EXIV2API bool isPgfType(BasicIo& iIo, bool advance);
} // namespace Exiv2
#endif // #ifndef PGFIMAGE_HPP_

@ -175,10 +175,10 @@ namespace Exiv2 {
const byte* compressionMethod = data.pData_ + keysize + 2;
// language description string after the compression technique spec
std::string languageText((const char*)(data.pData_ + keysize + 3));
unsigned int languageTextSize = languageText.size();
unsigned int languageTextSize = static_cast<unsigned int>(languageText.size());
// translated keyword string after the language description
std::string translatedKeyText((const char*)(data.pData_ + keysize + 3 + languageTextSize +1));
unsigned int translatedKeyTextSize = translatedKeyText.size();
unsigned int translatedKeyTextSize = static_cast<unsigned int>(translatedKeyText.size());
if ( compressionFlag[0] == 0x00 )
{
@ -472,14 +472,14 @@ namespace Exiv2 {
std::string PngChunk::zlibCompress(const std::string& text)
{
uLongf compressedLen = text.size() * 2; // just a starting point
uLongf compressedLen = static_cast<uLongf>(text.size() * 2); // just a starting point
int zlibResult;
DataBuf arr;
do {
arr.alloc(compressedLen);
zlibResult = compress2((Bytef*)arr.pData_, &compressedLen,
(const Bytef*)text.data(), text.size(),
(const Bytef*)text.data(), static_cast<uLong>(text.size()),
Z_BEST_COMPRESSION);
switch (zlibResult) {
@ -533,11 +533,11 @@ namespace Exiv2 {
}
// Determine length of the chunk data
byte length[4];
ul2Data(length, chunkData.size(), bigEndian);
ul2Data(length, static_cast<uint32_t>(chunkData.size()), bigEndian);
// Calculate CRC on chunk type and chunk data
std::string crcData = chunkType + chunkData;
uLong tmp = crc32(0L, Z_NULL, 0);
tmp = crc32(tmp, (const Bytef*)crcData.data(), crcData.size());
tmp = crc32(tmp, (const Bytef*)crcData.data(), static_cast<uInt>(crcData.size()));
byte crc[4];
ul2Data(crc, tmp, bigEndian);
// Assemble the chunk
@ -569,12 +569,12 @@ namespace Exiv2 {
}
// Determine length of the chunk data
byte length[4];
ul2Data(length, chunkData.size(), bigEndian);
ul2Data(length, static_cast<uint32_t>(chunkData.size()), bigEndian);
// Calculate CRC on chunk type and chunk data
std::string chunkType = "iTXt";
std::string crcData = chunkType + chunkData;
uLong tmp = crc32(0L, Z_NULL, 0);
tmp = crc32(tmp, (const Bytef*)crcData.data(), crcData.size());
tmp = crc32(tmp, (const Bytef*)crcData.data(), static_cast<uInt>(crcData.size()));
byte crc[4];
ul2Data(crc, tmp, bigEndian);
// Assemble the chunk

@ -95,6 +95,11 @@ namespace Exiv2 {
}
} // PngImage::PngImage
std::string PngImage::mimeType() const
{
return "image/png";
}
void PngImage::readMetadata()
{
#ifdef DEBUG
@ -282,7 +287,7 @@ namespace Exiv2 {
{
// Update Comment data to a new PNG chunk
std::string chunk = PngChunk::makeMetadataChunk(comment_, mdComment);
if (outIo.write((const byte*)chunk.data(), chunk.size()) != (long)chunk.size())
if (outIo.write((const byte*)chunk.data(), static_cast<long>(chunk.size())) != (long)chunk.size())
{
throw Error(21);
}
@ -299,7 +304,7 @@ namespace Exiv2 {
std::string rawExif = std::string(exifHeader, 6)
+ std::string((const char*)&blob[0], blob.size());
std::string chunk = PngChunk::makeMetadataChunk(rawExif, mdExif);
if (outIo.write((const byte*)chunk.data(), chunk.size()) != (long)chunk.size())
if (outIo.write((const byte*)chunk.data(), static_cast<long>(chunk.size())) != (long)chunk.size())
{
throw Error(21);
}
@ -314,7 +319,7 @@ namespace Exiv2 {
{
std::string rawIptc((const char*)newPsData.pData_, newPsData.size_);
std::string chunk = PngChunk::makeMetadataChunk(rawIptc, mdIptc);
if (outIo.write((const byte*)chunk.data(), chunk.size()) != (long)chunk.size())
if (outIo.write((const byte*)chunk.data(), static_cast<long>(chunk.size())) != (long)chunk.size())
{
throw Error(21);
}
@ -331,7 +336,7 @@ namespace Exiv2 {
if (xmpPacket_.size() > 0) {
// Update XMP data to a new PNG chunk
std::string chunk = PngChunk::makeMetadataChunk(xmpPacket_, mdXmp);
if (outIo.write((const byte*)chunk.data(), chunk.size()) != (long)chunk.size()) {
if (outIo.write((const byte*)chunk.data(), static_cast<long>(chunk.size())) != (long)chunk.size()) {
throw Error(21);
}
}

@ -90,7 +90,7 @@ namespace Exiv2
//! @name Accessors
//@{
std::string mimeType() const { return "image/png"; }
std::string mimeType() const;
//@}
private:

@ -372,6 +372,9 @@ namespace {
PreviewProperties prop = Loader::getProperties();
prop.mimeType_ = "image/jpeg";
prop.extension_ = ".jpg";
#ifdef EXV_UNICODE_PATH
prop.wextension_ = EXV_WIDEN(".jpg");
#endif
return prop;
}
@ -385,7 +388,7 @@ namespace {
}
IoCloser closer(io);
const byte *base = io.mmap();
const Exiv2::byte* base = io.mmap();
return DataBuf(base + offset_, size_);
}
@ -401,7 +404,7 @@ namespace {
throw Error(9, io.path(), strError());
}
IoCloser closer(io);
const byte *base = io.mmap();
const Exiv2::byte* base = io.mmap();
try {
Image::AutoPtr image = ImageFactory::open(base + offset_, size_);
@ -447,6 +450,9 @@ namespace {
PreviewProperties prop = Loader::getProperties();
prop.mimeType_ = "image/jpeg";
prop.extension_ = ".jpg";
#ifdef EXV_UNICODE_PATH
prop.wextension_ = EXV_WIDEN(".jpg");
#endif
return prop;
}
@ -556,6 +562,9 @@ namespace {
PreviewProperties prop = Loader::getProperties();
prop.mimeType_ = "image/tiff";
prop.extension_ = ".tif";
#ifdef EXV_UNICODE_PATH
prop.wextension_ = EXV_WIDEN(".tif");
#endif
return prop;
}
@ -610,7 +619,7 @@ namespace {
}
IoCloser closer(io);
const byte *base = io.mmap();
const Exiv2::byte* base = io.mmap();
const Value &sizes = preview["Exif.Image." + sizeTag_].value();
@ -624,7 +633,7 @@ namespace {
else {
// FIXME: the buffer is probably copied twice, it should be optimized
DataBuf buf(size_);
byte *pos = buf.pData_;
Exiv2::byte* pos = buf.pData_;
for (int i = 0; i < sizes.count(); i++) {
uint32_t offset = dataValue.toLong(i);
uint32_t size = sizes.toLong(i);
@ -637,11 +646,11 @@ namespace {
}
// write new image
Blob blob;
MemIo mio;
const IptcData emptyIptc;
const XmpData emptyXmp;
TiffParser::encode(blob, 0, 0, Exiv2::littleEndian, preview, emptyIptc, emptyXmp);
return DataBuf((blob.size() > 0 ? &blob[0] : 0), static_cast<long>(blob.size()));
TiffParser::encode(mio, 0, 0, Exiv2::littleEndian, preview, emptyIptc, emptyXmp);
return DataBuf(mio.mmap(), mio.size());
}
} // namespace
@ -692,6 +701,16 @@ namespace Exiv2 {
return Exiv2::writeFile(buf, name);
}
#ifdef EXV_UNICODE_PATH
long PreviewImage::writeFile(const std::wstring& wpath) const
{
std::wstring name = wpath + wextension();
// Todo: Creating a DataBuf here unnecessarily copies the memory
DataBuf buf(pData_, size_);
return Exiv2::writeFile(buf, name);
}
#endif
DataBuf PreviewImage::copy() const
{
return DataBuf(pData_, size_);
@ -717,6 +736,13 @@ namespace Exiv2 {
return properties_.extension_;
}
#ifdef EXV_UNICODE_PATH
std::wstring PreviewImage::wextension() const
{
return properties_.wextension_;
}
#endif
uint32_t PreviewImage::width() const
{
return properties_.width_;

@ -56,6 +56,10 @@ namespace Exiv2 {
std::string mimeType_;
//! Preview image extension.
std::string extension_;
#ifdef EXV_UNICODE_PATH
//! Unicode preview image extension in an std::wstring
std::wstring wextension_;
#endif
//! Preview image size in bytes.
uint32_t size_;
//! Preview image width in pixels or 0 for unknown width.
@ -115,6 +119,13 @@ namespace Exiv2 {
@return The number of bytes written.
*/
long writeFile(const std::string& path) const;
#ifdef EXV_UNICODE_PATH
/*!
@brief Like writeFile() but accepts a unicode path in an std::wstring.
@note This function is only available on Windows.
*/
long writeFile(const std::wstring& wpath) const;
#endif
/*!
@brief Return the MIME type of the preview image, usually either
\c "image/tiff" or \c "image/jpeg".
@ -125,6 +136,14 @@ namespace Exiv2 {
(".tif" or ".jpg").
*/
std::string extension() const;
#ifdef EXV_UNICODE_PATH
/*!
@brief Like extension() but returns the unicode encoded extension in
an std::wstring.
@note This function is only available on Windows.
*/
std::wstring wextension() const;
#endif
/*!
@brief Return the width of the preview image in pixels.
*/

@ -1246,6 +1246,11 @@ namespace Exiv2 {
return pt;
}
uint16_t XmpKey::tag() const
{
return 0;
}
std::string XmpKey::ns() const
{
return XmpProperties::ns(p_->prefix_);

@ -270,7 +270,7 @@ namespace Exiv2 {
virtual std::string tagName() const;
virtual std::string tagLabel() const;
//! Properties don't have a tag number. Return 0.
virtual uint16_t tag() const { return 0; }
virtual uint16_t tag() const;
AutoPtr clone() const;

@ -137,6 +137,11 @@ namespace Exiv2 {
{
} // PsdImage::PsdImage
std::string PsdImage::mimeType() const
{
return "image/x-photoshop";
}
void PsdImage::setComment(const std::string& /*comment*/)
{
// not supported
@ -574,11 +579,11 @@ namespace Exiv2 {
if (out.write(buf, 2) != 2) throw Error(21);
us2Data(buf, 0, bigEndian); // NULL resource name
if (out.write(buf, 2) != 2) throw Error(21);
ul2Data(buf, blob.size(), bigEndian);
ul2Data(buf, static_cast<uint32_t>(blob.size()), bigEndian);
if (out.write(buf, 4) != 4) throw Error(21);
// Write encoded Exif data
if (out.write(&blob[0], blob.size()) != static_cast<long>(blob.size())) throw Error(21);
resLength += blob.size() + 12;
if (out.write(&blob[0], static_cast<long>(blob.size())) != static_cast<long>(blob.size())) throw Error(21);
resLength += static_cast<long>(blob.size()) + 12;
if (blob.size() & 1) // even padding
{
buf[0] = 0;
@ -619,13 +624,13 @@ namespace Exiv2 {
if (out.write(buf, 2) != 2) throw Error(21);
us2Data(buf, 0, bigEndian); // NULL resource name
if (out.write(buf, 2) != 2) throw Error(21);
ul2Data(buf, xmpPacket.size(), bigEndian);
ul2Data(buf, static_cast<uint32_t>(xmpPacket.size()), bigEndian);
if (out.write(buf, 4) != 4) throw Error(21);
// Write XMPPacket
if (out.write(reinterpret_cast<const byte*>(xmpPacket.data()), static_cast<long>(xmpPacket.size()))
!= static_cast<long>(xmpPacket.size())) throw Error(21);
if (out.error()) throw Error(21);
resLength += xmpPacket.size() + 12;
resLength += static_cast<uint32_t>(xmpPacket.size()) + 12;
if (xmpPacket.size() & 1) // even padding
{
buf[0] = 0;

@ -107,7 +107,7 @@ namespace Exiv2 {
but Apple, as of Tiger (10.4.8), maps this official MIME type to a
dynamic UTI, rather than "com.adobe.photoshop-image" as it should.
*/
std::string mimeType() const { return "image/x-photoshop"; }
std::string mimeType() const;
//@}
private:

@ -59,6 +59,11 @@ namespace Exiv2 {
{
} // RafImage::RafImage
std::string RafImage::mimeType() const
{
return "image/x-fuji-raf";
}
int RafImage::pixelWidth() const
{
Exiv2::ExifData::const_iterator widthIter = exifData_.findKey(Exiv2::ExifKey("Exif.Photo.PixelXDimension"));

@ -103,7 +103,7 @@ namespace Exiv2 {
//! @name Accessors
//@{
std::string mimeType() const { return "image/x-fuji-raf"; }
std::string mimeType() const;
int pixelWidth() const;
int pixelHeight() const;
//@}

@ -62,6 +62,11 @@ namespace Exiv2 {
{
} // Rw2Image::Rw2Image
std::string Rw2Image::mimeType() const
{
return "image/x-raw";
}
int Rw2Image::pixelWidth() const
{
ExifData::const_iterator imageWidth =
@ -273,10 +278,10 @@ namespace Exiv2 {
{
}
uint32_t Rw2Header::write(Blob& blob) const
DataBuf Rw2Header::write() const
{
// Todo: Implement me!
return 0;
return DataBuf();
}
}} // namespace Internal, Exiv2

@ -101,7 +101,7 @@ namespace Exiv2 {
//! @name Accessors
//@{
std::string mimeType() const { return "image/x-raw"; }
std::string mimeType() const;
int pixelWidth() const;
int pixelHeight() const;
//@}

@ -60,8 +60,8 @@ namespace Exiv2 {
//! @name Accessors
//@{
//! Not yet implemented. Does nothing and returns 0.
uint32_t write(Blob& blob) const;
//! Not yet implemented. Does nothing and returns an empty buffer.
DataBuf write() const;
//@}
}; // class Rw2Header

@ -53,6 +53,10 @@ EXIV2_RCSID("@(#) $Id$")
# include <iconv.h>
#endif
#if defined WIN32 && !defined __CYGWIN__
# include <windows.h>
#endif
// *****************************************************************************
// local declarations
namespace {
@ -108,6 +112,7 @@ namespace Exiv2 {
{ canonSiIfdId, "Makernote", "CanonSi", CanonMakerNote::tagListSi },
{ canonCfIfdId, "Makernote", "CanonCf", CanonMakerNote::tagListCf },
{ canonPiIfdId, "Makernote", "CanonPi", CanonMakerNote::tagListPi },
{ canonFiIfdId, "Makernote", "CanonFi", CanonMakerNote::tagListFi },
{ canonPaIfdId, "Makernote", "CanonPa", CanonMakerNote::tagListPa },
{ fujiIfdId, "Makernote", "Fujifilm", FujiMakerNote::tagList },
{ minoltaIfdId, "Makernote", "Minolta", MinoltaMakerNote::tagList },
@ -119,6 +124,17 @@ namespace Exiv2 {
{ nikon2IfdId, "Makernote", "Nikon2", Nikon2MakerNote::tagList },
{ nikon3IfdId, "Makernote", "Nikon3", Nikon3MakerNote::tagList },
{ nikonPvIfdId, "Makernote", "NikonPreview", ExifTags::ifdTagList },
{ nikonWtIfdId, "Makernote", "NikonWt", Nikon3MakerNote::tagListWt },
{ nikonIiIfdId, "Makernote", "NikonIi", Nikon3MakerNote::tagListIi },
{ nikonCb1IfdId, "Makernote", "NikonCb1", Nikon3MakerNote::tagListCb1 },
{ nikonCb2IfdId, "Makernote", "NikonCb2", Nikon3MakerNote::tagListCb2 },
{ nikonCb2aIfdId, "Makernote", "NikonCb2a", Nikon3MakerNote::tagListCb2a },
{ nikonCb2bIfdId, "Makernote", "NikonCb2b", Nikon3MakerNote::tagListCb2b },
{ nikonCb3IfdId, "Makernote", "NikonCb3", Nikon3MakerNote::tagListCb3 },
{ nikonCb4IfdId, "Makernote", "NikonCb4", Nikon3MakerNote::tagListCb4 },
{ nikonLd1IfdId, "Makernote", "NikonLd1", Nikon3MakerNote::tagListLd1 },
{ nikonLd2IfdId, "Makernote", "NikonLd2", Nikon3MakerNote::tagListLd2 },
{ nikonLd3IfdId, "Makernote", "NikonLd3", Nikon3MakerNote::tagListLd3 },
{ olympusIfdId, "Makernote", "Olympus", OlympusMakerNote::tagList },
{ olympus2IfdId, "Makernote", "Olympus2", OlympusMakerNote::tagList },
{ olympusCsIfdId, "Makernote", "OlympusCs", OlympusMakerNote::tagListCs },
@ -1234,7 +1250,7 @@ namespace Exiv2 {
"data or a restart marker. This tag should not exist in an "
"uncompressed file. Since data padding is unnecessary in the vertical "
"direction, the number of lines recorded in this valid image height tag "
"will in fact be the same as that recorded in the SOF."),
"will in fact be the same as that recorded in the SOF."),
exifIfdId, imgConfig, unsignedLong, printValue),
TagInfo(0xa004, "RelatedSoundFile", N_("Related Sound File"),
N_("This tag is used to record the name of an audio file related "
@ -1891,16 +1907,36 @@ namespace Exiv2 {
idx_ = idx;
}
std::string ExifKey::key() const
{
return key_;
}
const char* ExifKey::familyName() const
{
return familyName_;
}
std::string ExifKey::groupName() const
{
return ifdItem();
}
std::string ExifKey::tagName() const
{
return ExifTags::tagName(tag_, ifdId_);
}
std::string ExifKey::tagLabel() const
{
std::string ExifKey::tagLabel() const
{
return ExifTags::tagLabel(tag_, ifdId_);
}
uint16_t ExifKey::tag() const
{
return tag_;
}
ExifKey::AutoPtr ExifKey::clone() const
{
return AutoPtr(clone_());
@ -2097,7 +2133,7 @@ namespace Exiv2 {
go = false;
}
if (go) {
// Todo: What if outbytesleft == 0
if (outptr > outbuf && *(outptr-1) == '\0') outptr--;
os << std::string(outbuf, outptr-outbuf);
}
}
@ -2107,11 +2143,30 @@ namespace Exiv2 {
if (!go) {
os << value;
}
#else // !(EXV_HAVE_ICONV && EXV_HAVE_PRINTUCS2)
return os;
#elif defined WIN32 && !defined __CYGWIN__ // !(EXV_HAVE_ICONV && EXV_HAVE_PRINTUCS2)
// in Windows the WideCharToMultiByte function can be used
if (value.typeId() == unsignedByte) {
DataBuf ib(value.size());
value.copy(ib.pData_, invalidByteOrder);
int out_size = WideCharToMultiByte(CP_UTF8, 0, reinterpret_cast<LPWSTR>(ib.pData_),
ib.size_ / sizeof(WCHAR), NULL, 0, NULL, NULL);
if (out_size >= 0) {
DataBuf ob(out_size + 1);
WideCharToMultiByte(CP_UTF8, 0, reinterpret_cast<LPWSTR>(ib.pData_),
ib.size_ / sizeof(WCHAR), reinterpret_cast<char*>(ob.pData_),
ob.size_, NULL, NULL);
os << std::string(reinterpret_cast<char*>(ob.pData_));
}
else {
os << value;
}
}
return os;
#else
os << value;
#endif // EXV_HAVE_ICONV && EXV_HAVE_PRINTUCS2
return os;
#endif // EXV_HAVE_ICONV && EXV_HAVE_PRINTUCS2
} // printUcs2
std::ostream& printExifUnit(std::ostream& os, const Value& value, const ExifData* metadata)
@ -2543,7 +2598,7 @@ namespace Exiv2 {
return os << value;
}
std::string stringValue = value.toString();
std::string stringValue = value.toString();
if (stringValue[19] == 'Z') {
stringValue = stringValue.substr(0, 19);
}

@ -406,16 +406,16 @@ namespace Exiv2 {
//! @name Accessors
//@{
virtual std::string key() const { return key_; }
virtual const char* familyName() const { return familyName_; }
virtual std::string key() const;
virtual const char* familyName() const;
/*!
@brief Return the name of the group (the second part of the key).
For Exif keys, the group name is the IFD item.
*/
virtual std::string groupName() const { return ifdItem(); }
virtual std::string groupName() const;
virtual std::string tagName() const;
virtual std::string tagLabel() const;
virtual uint16_t tag() const { return tag_; }
virtual uint16_t tag() const;
AutoPtr clone() const;
//! Return the IFD id

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save