Inside the wp3

The structure of Photo Story's project file is very simple.  What you may not know is that it is simply a windows .cab file.  It contains all of the images in your project, any music tracks you have used, and an xml file that defines the whole project.  This article will explain how you can actually make modifications to your .wp3 file from outside of Photo Story 3.

You might ask, "Why would I want to do this?"  Well, there are several answers that I can think of why I would want to do this.  First, knowledge.  I have always been one to ask how and why something works, instead of just being satisfied that it does what I expect.  That's not a good enough reason for someone looking to get something done.  And that's why most of us are using Photo Story in the first place.  We want a professional product done quickly.  Maybe you're looking to do something that isn't easily done with the wizard interface.  Maybe you're looking to do something that is not possible with the wizard interface.  Maybe your only backup of an image or song is inside your Photo Story project! Whatever the case, this guide should explain things to you so that you can understand the wp3 format and modify your project.

Opening the cabinet

In order to get at the .xml file to modify it, you'll need to open the .wp3 to extract the files that make up the project.  Microsoft offers a command-line program to extract and compress .cab files.  You can download it from:

http://download.microsoft.com/download/platformsdk/cab/2.0/w98nt42kmexp/en-us/cabsdk.exe

There are other .cab extractors with GUI interfaces (CabPack comes to mind).  We'll use microsoft's command line utility here.

C:\cabsdk\BIN>extract cc_vac.wp3 /E /L tmp
Microsoft (R) Diamond Extraction Tool - Version (32) 1.00.0601 (03/18/97)
Copyright (c) Microsoft Corp 1994-1997. All rights reserved.

Cabinet cc_vac.wp3

Extracting tmp\project.xml
Extracting tmp\0.JPG
Extracting tmp\SoundTrack0.wma
Extracting tmp\1.JPG
Extracting tmp\2.JPG
Extracting tmp\3.JPG
Extracting tmp\4.JPG
Extracting tmp\5.JPG
Extracting tmp\6.JPG
Extracting tmp\7.JPG
Extracting tmp\8.JPG
Extracting tmp\9.JPG
Extracting tmp\10.JPG
Extracting tmp\11.JPG
Extracting tmp\12.JPG
Extracting tmp\13.JPG
Extracting tmp\14.JPG
Extracting tmp\15.JPG
Extracting tmp\16.JPG

C:\cabsdk\BIN>

I won't go into all the possible command line switches, (you can type extract /? for that), but you'll notice that I used the syntax: extract <wp3 name> /E /L <folder to extract to>.  The /E command tells extract to actually write the files, not just view the archive.  /L tells it the Location .that you'd like it to put the files in.

As you can see, everything is here!  You now have complete access to your project's individual files.  Note that changing these files does nothing to your actual project until you compress them again.  You're looking at a copy of your project's files.

Project.xml - The Rosetta Stone

The file that pulls everything together is the project.xml.  It defines everything about your project.  Motion, transitions, slide text, font color... everything!  It's fairly easy to understand and read.  Let's take a look!

One of the best ways to view this .xml, in my opinion, is to use Internet Explorer.  It formats XML nicely.  If you browse to your temporary folder in Windows, and right click on project.xml, your context menu should allow you to Open With... Internet Explorer.

When viewed in Internet Explorer, the .xml file looks something like the below image.  About the only confusing or cryptic piece to it are the various GUIDs that define things like the transitions and codec version.  We'll go into that later.  Most items, however, are very easy to undestand.

At the most basic (or at least the top-level), we have the following xml:

<?xml version="1.0" ?>
+ <MSPhotoStoryProject xmlns="MSPhotoStory" schemaVersion="2.0" appVersion="3.0.1114.0" linkOnly="0" defaultImageDuration="5" visualUnitCount="17" codecVersion="{50564D57-0000-0010-8000-00AA00389B71}" sessionSeed="643296">

The first item that jumps out at me is the defaultImageDuration.  In one simple edit, you could have any of your non-customized durations changed form 5 seconds, to whatever you wish!  You'll notice later that each image has a duration defined.  This default duration applies to new images.  Lets go deeper.  The following describes a single slide.  You will have a "Visual Unit" entry for each image in the project (as defined by visualUnitCount above).

- <VisualUnit duration="4" type="1">
  <Transition duration="0.5" withPrevImage="0" type="{829BBF89-7707-4567-A0B8-9BF9631C79AD}" />
- <Image path="0.JPG" comments="0.JPG" lastModified="3/24/2004 09:06:14 AM" width="640" height="480" noNarration="-1" useManualDuration="-1" narrationTips="">
- <Edit>
- <TextOverlay text="College and Career 2004" verticalAlignment="8" horizontalAlignment="1" fontReferenceWidth="312" fontReferenceHeight="234">
  <Font faceName="Microsoft Sans Serif" width="0" height="-21" weight="400" strikeout="0" italic="0" underline="0" charset="0" clipprecision="2" escapement="0" orientation="0" outprecision="3" pitchandfamily="34" quality="1" color="16777215" />
  </TextOverlay>
  </Edit>
- <Motion manual="0" workingImageWidth="640" workingImageHeight="480">
  <Rect upperLeftX="0" upperLeftY="0" width="640" height="480" weight="100" />
  <Rect upperLeftX="0" upperLeftY="0" width="640" height="480" weight="100" />
  </Motion>
- <Motion2 manual="0">
  <RelativeRect left="0" top="0" width="1" height="1" />
  <RelativeRect left="0" top="0" width="1" height="1" />
  <RelativeRect left="0" top="0" width="1" height="1" />
  <RelativeRect left="0" top="0" width="1" height="1" />
  </Motion2>
  <Transition2 type="1" useManualDuration="0" duration="1" />
- <MusicTrack type="1" volume="100" colorIndex="0">
  <SoundTrack comments="04 Brother Love's Traveling Salvation Show.wma" path="SoundTrack0.wma" />
  </MusicTrack>
  </Image>
  </VisualUnit>

An Example (more to come in the future)

So what can you do with this?  Expect to see more mini-guides on what you can do in the future.  Here are some quick examples to get you started.

Exact Colors

In the Windows Movie Makers forums, there is a thread (that inspired this article), in which the contributors were discussing how to change the font color from the default colors in Photo Story, to one of several million colors available with the RRGGBB hex color scheme.  Notice in the XML above that the text "College and Career 2004" has been overlaid on a slide.  The font color (inside the <TextOverlay><Font /></TextOverlay> tag) is 16777215, or white.  This can be changed by simply editing the project.xml and substituting another color.  Forum member PapaJohn was kind enough to provide a link to Color Online which allows you to do color conversions to hex.  If you load up windows calculator, you can paste the hex value into calculator (use scientific mode, hex radio button selected), and then change the radio button to decimal.  A long process, but it will get you the exact color you are looking for.  Another forum member posted this list:

Name Decimal Hex

Black

0

000000

Maroon

128

000080

Green

32768

008000

Olive

32896

008080

Navy

8388608

800000

Purple

8388736

800080

Teal

8421376

808000

Gray

8421504

808080

Silver

12632256

C0C0C0

Red

255

0000FF

Lime

65280

00FF00

Yellow

65535

00FFFF

Blue

16711680

FF0000

Fuchsia

16711935

FF00FF

Aqua

16776960

FFFF00

White

16777215

FFFFFF

Putting it Back Together

Notice that I typed the below command from the folder directly above the tmp folder that I extracted the files to.  When i finished I had a second project new_cc_vac.wp3 (you can name it the same one and it updates the contents, but I like to have a backup).

C:\cabsdk\BIN>CABARC.EXE n new_cc_vac.wp3 tmp\*.*

Microsoft (R) Cabinet Tool - Version 1.00.0601 (03/18/97)
Copyright (c) Microsoft Corp 1996-1997. All rights reserved.

Creating new cabinet 'new_cc_vac.wp3' with compression 'MSZIP':
-- adding tmp\0.JPG
-- adding tmp\1.JPG
-- adding tmp\10.JPG
-- adding tmp\11.JPG
-- adding tmp\12.JPG
-- adding tmp\13.JPG
-- adding tmp\14.JPG
-- adding tmp\15.JPG
-- adding tmp\16.JPG
-- adding tmp\2.JPG
-- adding tmp\3.JPG
-- adding tmp\4.JPG
-- adding tmp\5.JPG
-- adding tmp\6.JPG
-- adding tmp\7.JPG
-- adding tmp\8.JPG
-- adding tmp\9.JPG
-- adding tmp\project.xml
-- adding tmp\SoundTrack0.wma

Completed successfully

C:\cabsdk\BIN>dir
Volume in drive C has no label.
Volume Serial Number is B0FA-0EF5

Directory of C:\cabsdk\BIN

11/15/2004 13:59 <DIR> .
11/15/2004 13:59 <DIR> ..
03/20/1997 02:01 114,688 CABARC.EXE
03/20/1997 02:01 65,536 CABINET.DLL
09/16/2004 15:33 7,011,971 cc_vac.wp3
03/20/1997 02:01 101,376 EXTRACT.EXE
03/20/1997 02:01 152,576 MAKECAB.EXE
11/15/2004 13:59 7,011,998
new_cc_vac.wp3
11/15/2004 13:55 <DIR> tmp
6 File(s) 14,458,145 bytes
3 Dir(s) 29,170,102,272 bytes free

C:\cabsdk\BIN>

Before and After