Tuesday, May 24, 2011

How to crop all frames in UPK

Resizing images in UPK Developer 3.6.1

On the LinkIn group Oracle UPK and Oracle Tutor Professionals there was the question how I managed to crop all frames of a topic. In this article I will write my solution, as it can be done.

I provide this information as this functionality is not provided in the UPK developer but sometimes badly needed.

Beware : After this point you are on your own as I can not give guarantee on the final result.

All information is provided as is.


What you need

For this action you need some additional software :

  • A text editor, eg Notepad plus plus
  • A picture program that can batch proces images: xnview
  • a text search program, I use fgrep, a GNU Utility

Before you start


Again : I still see this as a hazardous operation! I do not give any guarantee!

  • Export your course to an odarc file. If something went wrong you can copy this file, rename it to something.odarc.zip and unzip the odarc file.
  • UPK seems to be VERY picky on capitals in the tags of the XML files. So if you copy-paste a line into the XML file make sure copy exactly the same capitalisation into the xml files. It won't hurt UPK itself but after opening the topic it will die with strange errors

Where do you find the frames?

First thing is to find the directory where the images (png's) of the frames are stored. This directory is located at something like :

C:\Documents and Settings\yourlogin\Local Settings\Application Data\SUPDev5\D\Content\W

In this directory you find more directories with long alphanumeric names like
923f26ac73154f96a101389772ef29a6
where the images are stored ánd, very helpful, some xml files.

2 xml files are important : manifest.mfx and topic.xml .

Part of the magic is finding the right directory. This you can find by finding the name of the topic in the file manifest.mfx by doing a text search on the title of the topic. It is important to name your topic uniquely.

This I do with a little batch file which uses fgrep but can also be accomplished with the search utility in the (windows) file explorer however this may take some more time.

When you know the directory, you can open manifest.mfx and topic.xml in the text editor. In manifest.mfx you see the topic title. Is this the right title you can carry on.

In topic.xml you look up the line < ScreenResolution Width="1024" Height="768" />. This is the resolution in which you recorded your topic. It is grayed out btw in you topic editor!


Rescale your images

Open also up xnview (or another image editor) and navigate to the right directory. Now you see the images of your topic. In XnView you can batch proces the images, like cropping or resizing.


Steps batch processing

  • Warning : This can not be undone, so backupping the directory is wise. (see : Before you start)
  • If you want to resize (crop, zoom) select ALL images
  • Pres < ctrl> +U to open up batch mode.
  • In the screen in the second tab you can tell which things must be done.
  • Important : remember the resulting Height and Width of the images
  • Perform the batch processing

New height and width

  • Type the resulting Height and Width in the file topic.xml< ScreenResolution Width="new width" Height="new height" />
  • Save the file topic.xml

Open topic

now you can open your topic in the topic editor. It is important to look through the whole topic as action area's can be moved outside the frame.

  • Action area's outside the image: you can double klik on the black spots of the action area and resize and move into the frame
  • Connect, if you want, the balloons with the action area
  • If your image seems distorted then possibly the screenresolution in the file topic.xml is not right and you must look at an individual image to find the right screenresolution.

Good luck