ImagePortfolio
written by Martin D. Flynn  (martin_flynn@next.com)

Overview

ImagePortfolio is designed to provide visual management of your TIFF and EPS files (and most GIF files).  Multiple TIFF and EPS files may be dragged into a portfolio window for easy viewing.  Each image will maintain the same aspect ratio, but will be scaled down to fit the confines of the image cell so that many images can be viewed simultaneously.  The displayed images may then be selected and cut, pasted, or dragged into other applications accepting TIFF and/or EPS files.  Additionally, the list of file paths which comprise the contents of a portfolio may also be saved to a file for later retrieval.

Permission is granted to freely redistribute the ImagePortfolio program and source code, and to use fragments of this code in your own applications if you find them to be useful.  The ImagePortfolio application and code come with no warranty of any kind, and the user assumes all responsibility for its use.

Operation

Creating a new portfolio window:
A new portfolio window may be created by selecting the 'New Portfolio...' option on the 'Files' submenu.

Opening TIFF and EPS files:
There are several ways to display TIFF or EPS files in a portfolio window.
- First, multiple TIFF and EPS files, or directories containing TIFF and EPS files, may be selected and dragged from the Workspace Manager and dropped into a portfolio window.  Directories will be searched recursively to find all image files.  If the list of files dragged into the window include a previously saved ImagePortfolio file (with extension '.portfolio'), then the list of images specified in the file will also be added to portfolio window (the ImagePortfolio file must be one of the actual selected files in order for its contents to be added.  If it is found within a selected directory, its contents will not be added).  This method of adding images to a portfolio window specifically looks for files with extension ".tiff", ".eps", ".ps", ".icon", or ".gif", and ignores all others.  To cause all files to be examined for image file content, press and hold the 'Control' shift while dropping the list of files into the portfolio window.  This will cause the search process to execute more slowly, but all possible images will be added to the window (except for GIF image files, which still require the ".gif" extension).
- Second, TIFF images can be cut/copied from other applications and pasted into a portfolio window.  When doing so, a save panel window will be displayed which will allow you to save the image to a file on disk.  When saved, the TIFF file will be added to the portfolio window.  This can be useful for such things as making a file copy of an image in an Interface Builder nib file by copying the image to the pasteboard, then pasting it to a portfolio window. 
- Third, a previously saved ImagePortfolio file (with extension '.portfolio') can be opened from the File submenu and a new portfolio window with the images specified in the file will be created.  Only images which still exist and are readable will be added to the window, all others will be ignored.
- Fourth, A group of image files can be dragged from the Workspace Manager and dropped on the ImagePortfolio application icon (ImagePortfolio must be running at the time).  As the mouse cursor enters the application icon, the arrow cursor will change to a copy cursor.  The mouse button may then be released.  A new portfolio window will be openned with the images specified.  (Note: If the ImagePortfolio icon is in the Workspace dock, the dock may first need to be sent to the back by Alt-clicking on the NeXT emblem at the top of the dock.)

If multiple images are being opened, the process may be stopped at any time by pressing the 'Stop' button.  The portfolio window will then contain only the images which were added up to that point in time.

Cutting/Copying/Dragging images for export to other applications:
Again there are several ways to copy images from a portfolio window into other applications.  All methods include selecting the images you wish to copy by clicking and dragging across images with the mouse.  Multiple images may also be selected by holding down the shift-key while making your selection.
- First, the icon in the upper left corner of the window can be grabbed with the mouse and dragged into any application, including the Workspace Manager, that accepts image files.
- Second, holding the alternate-shift key down and grabbing an image from within one of the image cells will allow you to drag that image into another application that accepts image files.
- Third, the selected images can be copied to the pasteboard with the Command-Copy key (or Command-Cut key) and copied to another portfolio window, or into any application accepting TIFF images.  If copying into another application accepting TIFF images,  then only the first selected image will be available to be pasted into the application.

Showing the non-scaled image:
The images shown in a portfolio window have been scaled down to fit the bounds of the image cell.  To see what the image looks like at its regular size, just double click on the desired image in the portfolio window.  The selected image will appear at its normal size in its own window.   To display the various representations, select the desired representation from the popup menu.  A popup menu title of "device" indicates that the representation is device independent.  You may also select whether to draw the image with, or without, the alpha component (ie. NX_SOVER, or NX_COPY).  Small images may be dragged off of the panel for easier viewing of the image transparency.

Resizing the reduced scale images:
Grabbing and dragging the resize bar with the mouse will change the number of images displayed in a window.  To change the size of the scaled images without changing the number of images displayed in the window, grab and drag the resize bar with the 'Alternate' key pressed.  When the mouse is released, the images will be rescaled to fit inside the new size window.  Note that the reduced image sizes cannot be changed while images are being loaded into the window.

Changing the image title font:
The image title font can be changed by using the 'Font' submenu.

Saving the displayed list of TIFF/EPS images:
The list of file paths which comprise the contents of a portfolio may also be saved to a file for later retrieval.   To do so, either select the 'Save' (command-s) or 'Save As...' (command-S) option on the File menu.  The list of image file paths, displayed image cell size, and current number of viewed rows and columns, will be saved to the file.

Sorting the displayed images by name:
The images shown in a portfolio window can be sorted by name by selecting the 'Sort by Name' option on the Edit menu.  Additional images added to the portfolio window will be appended to the end of the list and not automatically resorted.  To resort after additional images have been added, reselect the 'Sort by Name' menu option.  A Shellsort method is used to sort the images.  Also, with Command-Shift dragging you can move individual images around in the portfolio window and drop them between other images in the window.

Saving preference defaults:
The image cell size, current number of viewed rows and columns, and the current font for a selected portfolio window can be saved to the defaults table by displaying the 'Preferences...' panel and selecting 'Set Default'.  Subsequent new portfolio windows created will have the last saved default attributes.