From b90eec9a5081fb78617f2f326ddf9a46c24bf14d Mon Sep 17 00:00:00 2001 From: brad Date: Sat, 13 Nov 2004 00:22:05 +0000 Subject: [PATCH] added exivsimple (win32 only dll) and write2-test projects to msvc build --- msvc/exiv2.sln | 257 +++++++++++++----------- msvc/exivsimple/exivsimple.cpp | 298 ++++++++++++++++++++++++++++ msvc/exivsimple/exivsimple.h | 42 ++++ msvc/exivsimple/exivsimple.vcproj | 175 ++++++++++++++++ msvc/exivsimple/stdafx.cpp | 8 + msvc/exivsimple/stdafx.h | 13 ++ msvc/write2-test/write2-test.vcproj | 146 ++++++++++++++ 7 files changed, 819 insertions(+), 120 deletions(-) create mode 100644 msvc/exivsimple/exivsimple.cpp create mode 100644 msvc/exivsimple/exivsimple.h create mode 100644 msvc/exivsimple/exivsimple.vcproj create mode 100644 msvc/exivsimple/stdafx.cpp create mode 100644 msvc/exivsimple/stdafx.h create mode 100644 msvc/write2-test/write2-test.vcproj diff --git a/msvc/exiv2.sln b/msvc/exiv2.sln index 4660b7c7..901b40a1 100644 --- a/msvc/exiv2.sln +++ b/msvc/exiv2.sln @@ -1,120 +1,137 @@ -Microsoft Visual Studio Solution File, Format Version 8.00 -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} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "exiv2lib", "exiv2lib\exiv2lib.vcproj", "{831EF580-92C8-4CA8-B0CE-3D906280A54D}" - ProjectSection(ProjectDependencies) = postProject - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "exiv2", "exiv2\exiv2.vcproj", "{07293CAC-00DA-493E-90C9-5D010C2B1B53}" - ProjectSection(ProjectDependencies) = postProject - {831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "exifcomment", "exifcomment\exifcomment.vcproj", "{0BDCE87F-A5FE-49AE-BE6D-A2A3E2BB69CE}" - ProjectSection(ProjectDependencies) = postProject - {831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "addmoddel", "addmoddel\addmoddel.vcproj", "{271E59C4-81F9-4231-85D3-E7DDB2E2BC08}" - ProjectSection(ProjectDependencies) = postProject - {831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "taglist", "taglist\taglist.vcproj", "{2CDD0F47-E4B8-4C48-AD56-64C0A67EC89B}" - ProjectSection(ProjectDependencies) = postProject - {831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "utiltest", "utiltest\utiltest.vcproj", "{7E0025E8-CFBE-4941-BEB7-825F14A87EE1}" - ProjectSection(ProjectDependencies) = postProject - {831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "metacopy", "metacopy\metacopy.vcproj", "{F59D0AD2-6948-474B-B506-AD14EC9BE551}" - ProjectSection(ProjectDependencies) = postProject - {831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ifd-test", "ifd-test\ifd-test.vcproj", "{F96ACB3E-B41C-44FA-BB88-954171D5D0BA}" - ProjectSection(ProjectDependencies) = postProject - {831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "makernote-test", "makernote-test\makernote-test.vcproj", "{AB0BA03E-2B09-4DCE-966F-3F5CCA01355C}" - ProjectSection(ProjectDependencies) = postProject - {831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "iptcprint", "iptcprint\iptcprint.vcproj", "{52034F65-28AA-4E3F-A44D-C91F6F0922F8}" - ProjectSection(ProjectDependencies) = postProject - {831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D} - EndProjectSection -EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "iptctest", "iptctest\iptctest.vcproj", "{C8F41CDA-76AA-4053-A8DE-F80892C1C2FC}" - ProjectSection(ProjectDependencies) = postProject - {831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D} - EndProjectSection -EndProject -Global - GlobalSection(SolutionConfiguration) = preSolution - Debug = Debug - Release = Release - 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}.Release.ActiveCfg = Release|Win32 - {8391174F-52D5-4111-A0FE-E87135301CFB}.Release.Build.0 = Release|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}.Release.ActiveCfg = Release|Win32 - {831EF580-92C8-4CA8-B0CE-3D906280A54D}.Release.Build.0 = Release|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}.Release.ActiveCfg = Release|Win32 - {07293CAC-00DA-493E-90C9-5D010C2B1B53}.Release.Build.0 = Release|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}.Release.ActiveCfg = Release|Win32 - {0BDCE87F-A5FE-49AE-BE6D-A2A3E2BB69CE}.Release.Build.0 = Release|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}.Release.ActiveCfg = Release|Win32 - {271E59C4-81F9-4231-85D3-E7DDB2E2BC08}.Release.Build.0 = Release|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}.Release.ActiveCfg = Release|Win32 - {2CDD0F47-E4B8-4C48-AD56-64C0A67EC89B}.Release.Build.0 = Release|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}.Release.ActiveCfg = Release|Win32 - {7E0025E8-CFBE-4941-BEB7-825F14A87EE1}.Release.Build.0 = Release|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}.Release.ActiveCfg = Release|Win32 - {F59D0AD2-6948-474B-B506-AD14EC9BE551}.Release.Build.0 = Release|Win32 - {F96ACB3E-B41C-44FA-BB88-954171D5D0BA}.Debug.ActiveCfg = Debug|Win32 - {F96ACB3E-B41C-44FA-BB88-954171D5D0BA}.Debug.Build.0 = Debug|Win32 - {F96ACB3E-B41C-44FA-BB88-954171D5D0BA}.Release.ActiveCfg = Release|Win32 - {F96ACB3E-B41C-44FA-BB88-954171D5D0BA}.Release.Build.0 = Release|Win32 - {AB0BA03E-2B09-4DCE-966F-3F5CCA01355C}.Debug.ActiveCfg = Debug|Win32 - {AB0BA03E-2B09-4DCE-966F-3F5CCA01355C}.Debug.Build.0 = Debug|Win32 - {AB0BA03E-2B09-4DCE-966F-3F5CCA01355C}.Release.ActiveCfg = Release|Win32 - {AB0BA03E-2B09-4DCE-966F-3F5CCA01355C}.Release.Build.0 = Release|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}.Release.ActiveCfg = Release|Win32 - {52034F65-28AA-4E3F-A44D-C91F6F0922F8}.Release.Build.0 = Release|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}.Release.ActiveCfg = Release|Win32 - {C8F41CDA-76AA-4053-A8DE-F80892C1C2FC}.Release.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - EndGlobalSection - GlobalSection(ExtensibilityAddIns) = postSolution - EndGlobalSection -EndGlobal +Microsoft Visual Studio Solution File, Format Version 8.00 +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} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "exiv2lib", "exiv2lib\exiv2lib.vcproj", "{831EF580-92C8-4CA8-B0CE-3D906280A54D}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "exiv2", "exiv2\exiv2.vcproj", "{07293CAC-00DA-493E-90C9-5D010C2B1B53}" + ProjectSection(ProjectDependencies) = postProject + {831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "exifcomment", "exifcomment\exifcomment.vcproj", "{0BDCE87F-A5FE-49AE-BE6D-A2A3E2BB69CE}" + ProjectSection(ProjectDependencies) = postProject + {831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "addmoddel", "addmoddel\addmoddel.vcproj", "{271E59C4-81F9-4231-85D3-E7DDB2E2BC08}" + ProjectSection(ProjectDependencies) = postProject + {831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "taglist", "taglist\taglist.vcproj", "{2CDD0F47-E4B8-4C48-AD56-64C0A67EC89B}" + ProjectSection(ProjectDependencies) = postProject + {831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "utiltest", "utiltest\utiltest.vcproj", "{7E0025E8-CFBE-4941-BEB7-825F14A87EE1}" + ProjectSection(ProjectDependencies) = postProject + {831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "metacopy", "metacopy\metacopy.vcproj", "{F59D0AD2-6948-474B-B506-AD14EC9BE551}" + ProjectSection(ProjectDependencies) = postProject + {831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ifd-test", "ifd-test\ifd-test.vcproj", "{F96ACB3E-B41C-44FA-BB88-954171D5D0BA}" + ProjectSection(ProjectDependencies) = postProject + {831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "makernote-test", "makernote-test\makernote-test.vcproj", "{AB0BA03E-2B09-4DCE-966F-3F5CCA01355C}" + ProjectSection(ProjectDependencies) = postProject + {831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "iptcprint", "iptcprint\iptcprint.vcproj", "{52034F65-28AA-4E3F-A44D-C91F6F0922F8}" + ProjectSection(ProjectDependencies) = postProject + {831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "iptctest", "iptctest\iptctest.vcproj", "{C8F41CDA-76AA-4053-A8DE-F80892C1C2FC}" + ProjectSection(ProjectDependencies) = postProject + {831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "exivsimple", "exivsimple\exivsimple.vcproj", "{EB7F30DE-DD77-4311-BB66-FFDF972052C7}" + ProjectSection(ProjectDependencies) = postProject + {831EF580-92C8-4CA8-B0CE-3D906280A54D} = {831EF580-92C8-4CA8-B0CE-3D906280A54D} + EndProjectSection +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "write2-test", "write2-test\write2-test.vcproj", "{BBDB5742-0A55-4C2C-973C-E876AAED6ABE}" + ProjectSection(ProjectDependencies) = postProject + EndProjectSection +EndProject +Global + GlobalSection(SolutionConfiguration) = preSolution + Debug = Debug + Release = Release + 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}.Release.ActiveCfg = Release|Win32 + {8391174F-52D5-4111-A0FE-E87135301CFB}.Release.Build.0 = Release|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}.Release.ActiveCfg = Release|Win32 + {831EF580-92C8-4CA8-B0CE-3D906280A54D}.Release.Build.0 = Release|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}.Release.ActiveCfg = Release|Win32 + {07293CAC-00DA-493E-90C9-5D010C2B1B53}.Release.Build.0 = Release|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}.Release.ActiveCfg = Release|Win32 + {0BDCE87F-A5FE-49AE-BE6D-A2A3E2BB69CE}.Release.Build.0 = Release|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}.Release.ActiveCfg = Release|Win32 + {271E59C4-81F9-4231-85D3-E7DDB2E2BC08}.Release.Build.0 = Release|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}.Release.ActiveCfg = Release|Win32 + {2CDD0F47-E4B8-4C48-AD56-64C0A67EC89B}.Release.Build.0 = Release|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}.Release.ActiveCfg = Release|Win32 + {7E0025E8-CFBE-4941-BEB7-825F14A87EE1}.Release.Build.0 = Release|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}.Release.ActiveCfg = Release|Win32 + {F59D0AD2-6948-474B-B506-AD14EC9BE551}.Release.Build.0 = Release|Win32 + {F96ACB3E-B41C-44FA-BB88-954171D5D0BA}.Debug.ActiveCfg = Debug|Win32 + {F96ACB3E-B41C-44FA-BB88-954171D5D0BA}.Debug.Build.0 = Debug|Win32 + {F96ACB3E-B41C-44FA-BB88-954171D5D0BA}.Release.ActiveCfg = Release|Win32 + {F96ACB3E-B41C-44FA-BB88-954171D5D0BA}.Release.Build.0 = Release|Win32 + {AB0BA03E-2B09-4DCE-966F-3F5CCA01355C}.Debug.ActiveCfg = Debug|Win32 + {AB0BA03E-2B09-4DCE-966F-3F5CCA01355C}.Debug.Build.0 = Debug|Win32 + {AB0BA03E-2B09-4DCE-966F-3F5CCA01355C}.Release.ActiveCfg = Release|Win32 + {AB0BA03E-2B09-4DCE-966F-3F5CCA01355C}.Release.Build.0 = Release|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}.Release.ActiveCfg = Release|Win32 + {52034F65-28AA-4E3F-A44D-C91F6F0922F8}.Release.Build.0 = Release|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}.Release.ActiveCfg = Release|Win32 + {C8F41CDA-76AA-4053-A8DE-F80892C1C2FC}.Release.Build.0 = Release|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}.Release.ActiveCfg = Release|Win32 + {EB7F30DE-DD77-4311-BB66-FFDF972052C7}.Release.Build.0 = Release|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}.Release.ActiveCfg = Release|Win32 + {BBDB5742-0A55-4C2C-973C-E876AAED6ABE}.Release.Build.0 = Release|Win32 + EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + EndGlobalSection + GlobalSection(ExtensibilityAddIns) = postSolution + EndGlobalSection +EndGlobal diff --git a/msvc/exivsimple/exivsimple.cpp b/msvc/exivsimple/exivsimple.cpp new file mode 100644 index 00000000..12ef5117 --- /dev/null +++ b/msvc/exivsimple/exivsimple.cpp @@ -0,0 +1,298 @@ +// exivsimple.cpp : Defines the entry point for the DLL application. +// + +#include "stdafx.h" +#include "exivsimple.h" +#include "exif.hpp" +#include "iptc.hpp" +#include + +struct ExivImage +{ + Exiv2::IptcData iptcData; + Exiv2::ExifData exifData; + std::string fileName; +}; + +// Returns 0 if failed. +EXIVSIMPLE_API HIMAGE OpenImage(const char *file) +{ + assert(file); + + ExivImage *image = new ExivImage; + image->fileName = file; + + // rc of 3 just means no iptc or exif data (not a real error) + int rc = image->iptcData.read( file ); + if (rc==0 || rc==3) + rc = image->exifData.read( file ); + + if (rc!=0 && rc!=3) { + delete image; + image = 0; + } + + return (HIMAGE)image; +} + +EXIVSIMPLE_API void FreeImage(HIMAGE img) +{ + if (img) { + ExivImage *image = (ExivImage*)img; + delete image; + } +} + +EXIVSIMPLE_API int SaveImage(HIMAGE img) +{ + assert(img); + ExivImage *image = (ExivImage*)img; + + int rc = image->iptcData.write(image->fileName); + if (rc==0) + rc = image->exifData.write(image->fileName); + + return rc; +} + +// This is weird because iptc and exif have not been "unified". Once +// the API is turned inside out, this DLL should not have to know +// about either... just generic images, keys, values, etc. +// buffsize should be the total size of *buff (including space full null) +// Note that if there is more than one entry (for some IPTC datasets) this +// returns the first one found. Currently no way to get the others. +EXIVSIMPLE_API int ReadMeta(HIMAGE img, const char *key, char *buff, int buffsize) +{ + assert(img && key && buff); + if (img==0 || key==0 || buff==0 || buffsize==0) return -1; + ExivImage *image = (ExivImage*)img; + int rc = 2; + + try { + Exiv2::IptcKey iptcKey(key); + rc = 1; + Exiv2::IptcData::const_iterator iter = image->iptcData.findKey(iptcKey); + if (iter != image->iptcData.end()) { + strncpy(buff, iter->value().toString().c_str(), buffsize); + buff[buffsize-1] = 0; + rc = 0; + } + } + catch(const Exiv2::Error&) { + } + + if (rc) { + // No iptc value, so try exif + try { + Exiv2::ExifKey exifKey(key); + rc = 1; + Exiv2::ExifData::const_iterator iter = image->exifData.findKey(exifKey); + if (iter != image->exifData.end()) { + strncpy(buff, iter->value().toString().c_str(), buffsize); + buff[buffsize-1] = 0; + rc = 0; + } + } + catch(const Exiv2::Error&) { + } + } + + return rc; +} + +// Overwrites existing value if found, otherwise creates a new one +// Passing invalidTypeId causes the type to be guessed. +// Guessing types is accurate for IPTC but not for EXIF. +EXIVSIMPLE_API int ModifyMeta(HIMAGE img, const char *key, const char *val, DllTypeId type) +{ + assert(img && key && val); + if (img==0 || key==0 || val==0) return -1; + ExivImage *image = (ExivImage*)img; + int rc = 2; + + std::string data(val); + // if data starts and ends with quotes, remove them + if (data.at(0) == '\"' && data.at(data.size()-1) == '\"') { + data = data.substr(1, data.size()-2); + } + + try { + Exiv2::IptcKey iptcKey(key); + rc = 1; + + if (type == invalidTypeId) + type = (DllTypeId)Exiv2::IptcDataSets::dataSetType(iptcKey.tag(), iptcKey.record()); + Exiv2::Value::AutoPtr value = Exiv2::Value::create((Exiv2::TypeId)type); + value->read(data); + + Exiv2::IptcData::iterator iter = image->iptcData.findKey(iptcKey); + if (iter != image->iptcData.end()) { + iter->setValue(value.get()); + rc = 0; + } + else { + rc = image->iptcData.add(iptcKey, value.get()); + } + } + catch(const Exiv2::Error&) { + } + + if (rc) { + // Failed with iptc, so try exif + try { + Exiv2::ExifKey exifKey(key); + rc = 1; + + // No way to get value type for exif... alwayst string?? + if (type == invalidTypeId) + type = asciiString; + Exiv2::Value::AutoPtr value = Exiv2::Value::create((Exiv2::TypeId)type); + value->read(data); + + Exiv2::ExifData::iterator iter = image->exifData.findKey(exifKey); + if (iter != image->exifData.end()) { + iter->setValue(value.get()); + rc = 0; + } + else { + image->exifData.add(exifKey, value.get()); + rc = 0; + } + } + catch(const Exiv2::Error&) { + } + } + + return rc; +} + +// Always creates a new metadata entry. +// Passing invalidTypeId causes the type to be guessed. +// Guessing types is accurate for IPTC but not for EXIF. +EXIVSIMPLE_API int AddMeta(HIMAGE img, const char *key, const char *val, DllTypeId type) +{ + assert(img && key && val); + if (img==0 || key==0 || val==0) return -1; + ExivImage *image = (ExivImage*)img; + int rc = 2; + + std::string data(val); + // if data starts and ends with quotes, remove them + if (data.at(0) == '\"' && data.at(data.size()-1) == '\"') { + data = data.substr(1, data.size()-2); + } + + try { + Exiv2::IptcKey iptcKey(key); + rc = 1; + + if (type == invalidTypeId) + type = (DllTypeId)Exiv2::IptcDataSets::dataSetType(iptcKey.tag(), iptcKey.record()); + Exiv2::Value::AutoPtr value = Exiv2::Value::create((Exiv2::TypeId)type); + value->read(data); + + rc = image->iptcData.add(iptcKey, value.get()); + } + catch(const Exiv2::Error&) { + } + + if (rc) { + // Failed with iptc, so try exif + try { + Exiv2::ExifKey exifKey(key); + rc = 1; + + // No way to get value type for exif... alwayst string?? + if (type == invalidTypeId) + type = asciiString; + Exiv2::Value::AutoPtr value = Exiv2::Value::create((Exiv2::TypeId)type); + value->read(data); + + image->exifData.add(exifKey, value.get()); + rc = 0; + } + catch(const Exiv2::Error&) { + } + } + + return rc; +} + +// If multiple entires exist, this only remove the first one +// found. Call multiple times to remove many. +EXIVSIMPLE_API int RemoveMeta(HIMAGE img, const char *key) +{ + assert(img && key); + if (img==0 || key==0) return -1; + ExivImage *image = (ExivImage*)img; + int rc = 2; + + try { + Exiv2::IptcKey iptcKey(key); + rc = 1; + Exiv2::IptcData::iterator iter = image->iptcData.findKey(iptcKey); + if (iter != image->iptcData.end()) { + image->iptcData.erase(iter); + rc = 0; + } + } + catch(const Exiv2::Error&) { + } + + if (rc) { + // No iptc value, so try exif + try { + Exiv2::ExifKey exifKey(key); + rc = 1; + Exiv2::ExifData::iterator iter = image->exifData.findKey(exifKey); + if (iter != image->exifData.end()) { + image->exifData.erase(iter); + rc = 0; + } + } + catch(const Exiv2::Error&) { + } + } + + return rc; +} + +EXIVSIMPLE_API int EnumMeta(HIMAGE img, METAENUMPROC proc, void *user) +{ + assert(img && proc); + if (img==0 || proc==0) return -1; + ExivImage *image = (ExivImage*)img; + bool more = true; + + Exiv2::IptcData::const_iterator iend = image->iptcData.end(); + for (Exiv2::IptcData::const_iterator i = image->iptcData.begin(); + i != iend && more; ++i) { + more = proc(i->key().c_str(), i->value().toString().c_str(), user); + } + + Exiv2::ExifData::const_iterator eend = image->exifData.end(); + for (Exiv2::ExifData::const_iterator e = image->exifData.begin(); + e != eend && more; ++e) { + more = proc(e->key().c_str(), e->value().toString().c_str(), user); + } + + return 0; +} + + +BOOL APIENTRY DllMain( HANDLE hModule, + DWORD ul_reason_for_call, + LPVOID lpReserved + ) +{ + switch (ul_reason_for_call) + { + case DLL_PROCESS_ATTACH: + case DLL_THREAD_ATTACH: + case DLL_THREAD_DETACH: + case DLL_PROCESS_DETACH: + break; + } + return TRUE; +} + diff --git a/msvc/exivsimple/exivsimple.h b/msvc/exivsimple/exivsimple.h new file mode 100644 index 00000000..a2ac2429 --- /dev/null +++ b/msvc/exivsimple/exivsimple.h @@ -0,0 +1,42 @@ +// The following ifdef block is the standard way of creating macros which make exporting +// from a DLL simpler. All files within this DLL are compiled with the EXIVSIMPLE_EXPORTS +// symbol defined on the command line. this symbol should not be defined on any project +// that uses this DLL. This way any other project whose source files include this file see +// EXIVSIMPLE_API functions as being imported from a DLL, whereas this DLL sees symbols +// defined with this macro as being exported. +#ifdef EXIVSIMPLE_EXPORTS +#define EXIVSIMPLE_API __declspec(dllexport) +#else +#define EXIVSIMPLE_API __declspec(dllimport) +#endif + +DECLARE_HANDLE (HIMAGE); + +#ifdef __cplusplus +extern "C" +{ +#endif + +// These types should match those in types.hpp. For all of the functions +// that take a type, passing invalidTypeId causes the type to be guessed. +// Guessing types is accurate for IPTC but not for EXIF. +enum DllTypeId { invalidTypeId, unsignedByte, asciiString, unsignedShort, + unsignedLong, unsignedRational, invalid6, undefined, + signedShort, signedLong, signedRational, + string, date, time, + lastTypeId }; + +typedef bool (CALLBACK* METAENUMPROC)(const char *key, const char *value, void *user); + +EXIVSIMPLE_API HIMAGE OpenImage(const char *file); +EXIVSIMPLE_API void FreeImage(HIMAGE img); +EXIVSIMPLE_API int SaveImage(HIMAGE img); +EXIVSIMPLE_API int ReadMeta(HIMAGE img, const char *key, char *buff, int buffsize); +EXIVSIMPLE_API int EnumMeta(HIMAGE img, METAENUMPROC proc, void *user); +EXIVSIMPLE_API int AddMeta(HIMAGE img, const char *key, const char *val, DllTypeId type); +EXIVSIMPLE_API int ModifyMeta(HIMAGE img, const char *key, const char *val, DllTypeId type); +EXIVSIMPLE_API int RemoveMeta(HIMAGE img, const char *key); + +#ifdef __cplusplus +} +#endif diff --git a/msvc/exivsimple/exivsimple.vcproj b/msvc/exivsimple/exivsimple.vcproj new file mode 100644 index 00000000..d737b677 --- /dev/null +++ b/msvc/exivsimple/exivsimple.vcproj @@ -0,0 +1,175 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/msvc/exivsimple/stdafx.cpp b/msvc/exivsimple/stdafx.cpp new file mode 100644 index 00000000..ce3748c6 --- /dev/null +++ b/msvc/exivsimple/stdafx.cpp @@ -0,0 +1,8 @@ +// stdafx.cpp : source file that includes just the standard includes +// exivsimple.pch will be the pre-compiled header +// stdafx.obj will contain the pre-compiled type information + +#include "stdafx.h" + +// TODO: reference any additional headers you need in STDAFX.H +// and not in this file diff --git a/msvc/exivsimple/stdafx.h b/msvc/exivsimple/stdafx.h new file mode 100644 index 00000000..1ad3b783 --- /dev/null +++ b/msvc/exivsimple/stdafx.h @@ -0,0 +1,13 @@ +// stdafx.h : include file for standard system include files, +// or project specific include files that are used frequently, but +// are changed infrequently +// + +#pragma once + + +#define WIN32_LEAN_AND_MEAN // Exclude rarely-used stuff from Windows headers +// Windows Header Files: +#include + +// TODO: reference additional headers your program requires here diff --git a/msvc/write2-test/write2-test.vcproj b/msvc/write2-test/write2-test.vcproj new file mode 100644 index 00000000..5b35022e --- /dev/null +++ b/msvc/write2-test/write2-test.vcproj @@ -0,0 +1,146 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +