Merged revisions 521:529 from branches/Exiv2-0_6_041212, added modify-test.sh and related test data

v0.27.3
Andreas Huggel 21 years ago
parent a8f6bc2f84
commit 76cd23a980

@ -2,7 +2,7 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)
AC_INIT(Exiv2, 0.6.1, ahuggel@gmx.net)
AC_INIT(Exiv2, 0.6.2, ahuggel@gmx.net)
AC_CONFIG_SRCDIR([src/exif.cpp])
AC_CONFIG_HEADER([./config/config.h])
AC_CONFIG_AUX_DIR([./config])

@ -1,3 +1,27 @@
Changes from version 0.6.1 to 0.6.2
-----------------------------------
* Exiv2 utility
- [feature] New -M option to run modification commands directly
from the command line.
- 0000421: [tools] Command parser fails if no type is specified with a
modify command.
- 0000416: [exif] Fix Exiv2 modify action to use non-intrusive writing
whenever possible.
- 0000418: [feature] Add Exiv2 option to specify path of extracted.
and inserted files. (Suggested by Brian Pugh)
* Exiv2 library
- 0000408: [build environment] 0.6.1 does not build on OS X: Add libtool
support for automatic library creation (see README).
(Reported by Thomas Lunde and others)
- 0000409: [build environment] compiling emits type warnings. (Thomas Lunde
and others)
- 0000410: [build environment] config.h must be installed, -DHAVE_CONFIG_H
flag should not be necessary. (Daniel Foote and others)
- 0000411: [exif] Support non-standard Ifd layout. (Jeffrey J. Early)
Changes from version 0.6 to 0.6.1
---------------------------------
@ -8,7 +32,7 @@ Changes from version 0.6 to 0.6.1
* Exiv2 library
* Fixed bug #407: Writing metadata to image after modifications may
loose thumbnail
lose thumbnail. Thanks to Jeffrey J. Early for pointing out this bug.
* Added CommentValue

@ -208,11 +208,11 @@ install-header:
else :; fi; \
done
install-lib: install-header
install-lib: lib install-header
$(INSTALL_DIRS) $(libdir)
@$(LIBTOOL) --mode=install $(INSTALL_DATA) $(LIBRARY) $(libdir)/$(LIBRARY)
install: install-lib
install: $(EXIV2BIN) install-lib
$(INSTALL_DIRS) $(bindir)
@$(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $(EXIV2EXE) $(bindir)/$(EXIV2EXE)

@ -35,10 +35,12 @@ add Iptc.Application2.Credit String "mee too! (1)"
add Iptc.Application2.Credit mee too! (2)
del Iptc.Application2.Headline
set Iptc.Application2.Headline Filename
add Exif.Image.WhitePoint Short 32 12 4 5 6
set Exif.Image.DateTime Ascii "Zwanzig nach fuenf"
set Exif.Image.DateTime Ascii "Zwanzig nach fuenf"
set Exif.Image.Artist Ascii nobody
set Exif.Image.Artist "Vincent van Gogh"
set Exif.Image.Artist "Vincent van Gogh"
set Exif.Photo.UserComment Comment charset=Ascii This is an ASCII Exif comment

@ -8,7 +8,7 @@
@date 07-Feb-04, ahu: created
*/
/*!
@mainpage Exif and Iptc metadata manipulation library and tools v0.6
@mainpage Exif and Iptc metadata manipulation library and tools v0.6.2
@section overview Exiv2 Overview
@ -80,18 +80,18 @@
<div class="fragment"><pre><span class="stringliteral">$ svn checkout svn://dev.robotbattle.com/exiv2/trunk .</span></pre></div>
<p>To download the test data and test drivers for version 0.6 from
the repository, change to your local exiv2-0.6 directory and use the
<p>To download the test data and test drivers for version 0.6.2 from
the repository, change to your local exiv2-0.6.2 directory and use the
following command:
</p>
<div class="fragment"><pre><span class="stringliteral">$ svn export svn://dev.robotbattle.com/exiv2/tags/Exiv2-0_6_041212/test</span></pre></div>
<div class="fragment"><pre><span class="stringliteral">$ svn export svn://dev.robotbattle.com/exiv2/tags/0.6.2/test</span></pre></div>
<P>If you'd like to contribute code, please <A HREF="mailto:ahuggel@gmx.net">contact me</A>.
@section license License
<P>Copyright (C) 2004 Andreas Huggel <ahuggel@gmx.net></P>
<P>Copyright (C) 2004, 2005 Andreas Huggel <ahuggel@gmx.net></P>
<P>%Exiv2 is free software; you can redistribute it and/or modify it under the
terms of the <a href="../gpl-license.html">GNU General Public License</a> as

@ -736,8 +736,8 @@ namespace {
}
std::string value;
Exiv2::TypeId type = Exiv2::invalidTypeId;
bool explicitType = true;
Exiv2::TypeId type = defaultType;
bool explicitType = false;
if (cmdId != del) {
// Get type and value
std::string::size_type typeStart
@ -749,29 +749,24 @@ namespace {
if ( keyEnd == std::string::npos
|| typeStart == std::string::npos
|| typeEnd == std::string::npos
|| valStart == std::string::npos) {
throw Exiv2::Error(Exiv2::toString(num)
+ ": Invalid command line");
+ ": Invalid command line ");
}
std::string typeStr(line.substr(typeStart, typeEnd-typeStart));
type = Exiv2::TypeInfo::typeId(typeStr);
if (type != Exiv2::invalidTypeId) {
valStart = line.find_first_not_of(delim, typeEnd+1);
if (valStart == std::string::npos) {
throw Exiv2::Error(Exiv2::toString(num)
+ ": Invalid command line");
if (typeEnd != std::string::npos) {
std::string typeStr(line.substr(typeStart, typeEnd-typeStart));
Exiv2::TypeId tmpType = Exiv2::TypeInfo::typeId(typeStr);
if (tmpType != Exiv2::invalidTypeId) {
valStart = line.find_first_not_of(delim, typeEnd+1);
if (valStart == std::string::npos) {
throw Exiv2::Error(Exiv2::toString(num)
+ ": Invalid command line ");
}
type = tmpType;
explicitType = true;
}
}
else {
type = defaultType;
explicitType = false;
}
if (type == Exiv2::invalidTypeId) {
throw Exiv2::Error(Exiv2::toString(num)
+ ": Invalid type");
}
value = line.substr(valStart, valEnd+1-valStart);
std::string::size_type last = value.length()-1;

@ -1,6 +1,6 @@
// ******************************************************************* -*- C -*-
/* ***************************************************************** -*- C -*- */
/*!
@file exv_msvc.hpp
@file exv_msvc.h
@brief Configuration settings for MSVC
@version $Rev$
@author Andreas Huggel (ahu)
@ -23,13 +23,13 @@
#define PACKAGE_NAME "Exiv2"
/* Define to the full name and version of this package. */
#define PACKAGE_STRING "Exiv2 0.6.1"
#define PACKAGE_STRING "Exiv2 0.6.2"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "exiv2"
/* Define to the version of this package. */
#define PACKAGE_VERSION "0.6.1"
#define PACKAGE_VERSION "0.6.2"
/* Define to `int' if <sys/types.h> does not define pid_t. */
#define pid_t int

@ -15,8 +15,8 @@ SHELL = /bin/sh
.PHONY: all test clean distclean maintainer-clean
# Add test drivers to this list
TESTS = addmoddel.sh exifdata-test.sh exiv2-test.sh ifd-test.sh \
imagetest.sh iotest.sh iptctest.sh makernote-test.sh write-test.sh \
TESTS = addmoddel.sh exifdata-test.sh exiv2-test.sh ifd-test.sh imagetest.sh \
iotest.sh iptctest.sh makernote-test.sh modify-test.sh write-test.sh \
write2-test.sh
test:

@ -3,7 +3,7 @@ tmp/
Exiv2 version ------------------------------------------------------------
../../src/exiv2
Exiv2 0.6.1, Copyright (C) 2004, 2005 Andreas Huggel.
Exiv2 0.6.2, Copyright (C) 2004, 2005 Andreas Huggel.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

@ -0,0 +1,62 @@
File 1/1: exiv2-empty.jpg
Add Iptc.Application2.Credit "mee too! (1)" (String)
Add Iptc.Application2.Credit "mee too! (2)" (String)
Del Iptc.Application2.Headline
Add Exif.Image.WhitePoint "32 12 4 5 6" (Short)
Set Iptc.Application2.Headline "Headline" (String)
Set Exif.Image.DateTime "Zwanzig nach fuenf" (Ascii)
Set Exif.Image.Artist "nobody" (Ascii)
Set Exif.Image.Artist "Vincent van Gogh" (Ascii)
Set Exif.Photo.UserComment "charset=Ascii This is an ASCII Exif comment" (Comment)
File 1/1: exiv2-gc.jpg
Set Exif.Image.Software "Exiv2 utility!!" (Ascii)
File 1/1: exiv2-empty.jpg
0x006e Application2 String 12 Credit mee too! (1)
0x0069 Application2 String 8 Headline Headline
File 1/2: exiv2-empty.jpg
0x0132 IFD0 DateTime Zwanzig nach fuenf
0x013b IFD0 Artist Vincent van Gogh
0x013e IFD0 WhitePoint 32 12 4 5 6
0x8769 IFD0 ExifTag 108
0x9286 Exif UserComment This is an ASCII Exif comment
File 2/2: exiv2-gc.jpg
0x010e IFD0 ImageDescription Exif JPEG
0x010f IFD0 Make Camera
0x0110 IFD0 Model DC-4300
0x0112 IFD0 Orientation top, left
0x011a IFD0 XResolution 72
0x011b IFD0 YResolution 72
0x0128 IFD0 ResolutionUnit inch
0x0131 IFD0 Software Exiv2 utility!!
0x0132 IFD0 DateTime 2004:06:08 16:04:50
0x0213 IFD0 YCbCrPositioning Co-sited
0x8769 IFD0 ExifTag 6480
0x829a Exif ExposureTime 1/95 s
0x829d Exif FNumber F9.1
0x8822 Exif ExposureProgram Landscape mode
0x8827 Exif ISOSpeedRatings 100
0x9000 Exif ExifVersion 48 50 49 48
0x9003 Exif DateTimeOriginal 2004:06:08 16:04:50
0x9004 Exif DateTimeDigitized 2004:06:08 16:04:50
0x9101 Exif ComponentsConfiguration YCbCr
0x9201 Exif ShutterSpeedValue 6.6
0x9202 Exif ApertureValue 6.4
0x9204 Exif ExposureBiasValue 0
0x9205 Exif MaxApertureValue 3.1
0x9207 Exif MeteringMode Matrix
0x9208 Exif LightSource Unknown
0x9209 Exif Flash No
0xa000 Exif FlashpixVersion 48 49 48 48
0xa001 Exif ColorSpace sRGB
0xa002 Exif PixelXDimension 1600
0xa003 Exif PixelYDimension 2400
0xa005 Exif InteroperabilityTag 6738
0xa300 Exif FileSource Digital still camera
0x0001 Iop InteroperabilityIndex R98
0x0002 Iop InteroperabilityVersion 48 49 48 48
0x0100 IFD1 ImageWidth 133
0x0101 IFD1 ImageLength 200
0x0103 IFD1 Compression JPEG
0x0112 IFD1 Orientation top, left
0x0201 IFD1 JPEGInterchangeFormat 0
0x0202 IFD1 JPEGInterchangeFormatLength 6144

@ -0,0 +1,14 @@
# Commands for Modify unit tests
add Iptc.Application2.Credit String "mee too! (1)"
add Iptc.Application2.Credit mee too! (2)
del Iptc.Application2.Headline
add Exif.Image.WhitePoint Short 32 12 4 5 6
set Iptc.Application2.Headline Headline
set Exif.Image.DateTime Ascii "Zwanzig nach fuenf"
set Exif.Image.Artist Ascii nobody
set Exif.Image.Artist "Vincent van Gogh"
set Exif.Photo.UserComment Comment charset=Ascii This is an ASCII Exif comment

@ -0,0 +1 @@
set Exif.Image.Software Ascii "Exiv2 utility!!"

@ -0,0 +1,31 @@
#! /bin/sh
# Test driver for write unit tests to build Exif metadata from scratch
results="./tmp/modify-test.out"
good="./data/modify-test.out"
diffargs="--strip-trailing-cr"
tmpfile=tmp/ttt
touch $tmpfile
diff -q $diffargs $tmpfile $tmpfile 2>/dev/null
if [ $? -ne 0 ] ; then
diffargs=""
fi
(
LD_LIBRARY_PATH=../../src:$LD_LIBRARY_PATH
binpath="../../src"
cp -f ./data/exiv2-empty.jpg ./tmp
cp -f ./data/exiv2-gc.jpg ./tmp
cd ./tmp
$binpath/exiv2 -v -m ../data/modifycmd1.txt exiv2-empty.jpg
$binpath/exiv2 -v -m ../data/modifycmd2.txt exiv2-gc.jpg
$binpath/exiv2 -v -pi exiv2-empty.jpg
$binpath/exiv2 -v -pt exiv2-empty.jpg exiv2-gc.jpg
) > $results
diff -q $diffargs $results $good
rc=$?
if [ $rc -eq 0 ] ; then
echo "All testcases passed."
else
diff $diffargs $results $good
fi
Loading…
Cancel
Save