Instructions
Below are the instructions for creating a dynamic Aperture Web Gallery. This has been tested on a Powermac G5 and a Macbook.
Requirements
- Mac OS X Tiger with Developer Tools (1 required Automator Action is installed as part of the Developer Tools.)
- Aperture
- Apache Webserver
- PHP
- Downloads 1 - 3 below
- Knowledge of php, html or css to allow you to modify the template (you don't have to though).
Downloads
- This AperturePHPGalleryRelease1 zip file containing the php pages, PDF guide and workflow.
- This IPTC to EXIF Automator Action from Sal Salighon - http://automator.us/aperture/ex06actioninstaller.zip
- This Automator FTP action from Editkid
- PHP, if required, can be downloaded from http://www.entropy.ch
- MySQL, if required, can be downloaded from http://www.mysql.com
Installation and Setup
- Unzip the AperturetoWeb zip file.
- Create a folder called 'Aperture' in the root of your Macintosh HD Inside this folder create 2 further folders called 'images' and 'thumbs'.
Webserver
- Copy the folder Webserver from the downloaded zip file to your webserver and rename it Aperture. It should contain the following files and folders.
- Connections
- global.css
- images
- index.php
- thumbs
- viewerDynamic.php
- viewerTags.php
- xfrd.jpg
- yourname.jpg
- Optional for now - but change them at some point
- Replace yourname.jpeg with a file of the same name as $user ="yourname"; in step 4 of MySQL (see below).
- Replace xfrd.jpg with an image with some text in it. If you replace this image modify this line in index.php, viewerTags.php and viewerDynamic.php replacing japan with the text contained in the new image.
if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "form1") && ($HTTP_POST_VARS["spamVerify"] == "japan")) {
PHP
- Install it if you have not done so already. Mark at entropy.ch provides a great installer that should work out of the box. Once you install PHP as per his instructions, you are ready to move on.
MySQL
- Install it if you have not done so already. Get an installer from mysql.com
- Create a mysql database called aperture.
- Create a user and set a password
- Modify the file in Connections/aperture.php script in a text editor.
- Ensure the database in this line the one you created in step 2.
$database_aperture = "aperture";
- Ensure the mysql user in this line matches the one you created in step3.
$username_aperture = "user";
- Ensure the password in this line matches the one you created in step 3.
$password_aperture = "password";
- Enter your name e.g. "Alex" in this line
$user ="yourname";
- Enter your domain in this line e.g http://127.0.0.1/ if you are using a localhost or http://www.yourdomain.com/
$domain ="yourdomain";
- Enter your image host in this line. eg. http://127.0.0.1/aperture/ or http://www.yourdomain.com/aperture/
$imagehost = "http://127.0.0.1/aperture/";
- Copy the text in maketable.txt and run this against the mysql database.
Automator
Important - if you have an Intel Mac - open Automator using Rosetta as one of the actions, CSV To SQL is not Universal Binary
- Install the EXIF to IPTC, FTP and ensure the CSV to SQL automator actions, installed as part of Xcode is present. If it isn't, install it.
- Set up the actions as shown in the PDF included in the ApertureToWeb zip file. Try opening the included automator action and modify the fields with your own username and passwords.
- Save the workflow as an application. Again, If you have an Intel Mac, press Apple + I and check the open with Rosetta box.
Here is some of the code you will want to copy and paste into the actions should the workflow not load for you.
- Step 10
Before
<?php require_once('Connections/aperture.php'); ?><?php mysql_select_db($database_aperture);
Per Row
INSERT INTO `library` (`ID`,`GALLERYNAME`,`DISPLAY`,`NAME`,`IPTC_Byline`,`IPTC_Byline_Title`,`IPTC_Caption`,`IPTC_Category`,`IPTC_City`,`IPTC_Contact`,`IPTC_Copyright_Notice`,`IPTC_Country`,`IPTC_Credit`,`IPTC_Headline`,`IPTC_Keywords`,`IPTC_Location_Code`,`IPTC_Location_Name`,`IPTC_Original_Transmission`,`IPTC_Province_State`,`IPTC_Source`,`IPTC_Special_Instructions`,`IPTC_Writer_Editor`,`EXIF_Aperture_Value`,`EXIF_Capture_Day_of_Month`,`EXIF_Capture_Day_of_Week`,`EXIF_Capture_Hour_of_Day`,`EXIF_Capture_Month_of_Year`,`EXIF_Capture_Year`,`EXIF_Color_Model`,`EXIF_Color_Space`,`EXIF_Contrast`,`EXIF_Depth`,`EXIF_Version`,`EXIF_Exposure_Bias_Value`,`EXIF_Exposure_Mode`,`EXIF_Exposure_Program`,`EXIF_Flash`,`EXIF_Flash_Pix_Version`,`EXIF_Focal_Length`,`EXIF_ISO_Speed_Rating`,`EXIF_Image_Date`,`EXIF_Make`,`EXIF_Max_Aperture_Value`,`EXIF_Metering_Mode`,`EXIF_Model`,`EXIF_Pixel_Height`,`EXIF_Pixel_Width`,`EXIF_Profile_Name`,`EXIF_Saturation`,`EXIF_Scene_Capture_Type`,`EXIF_Sharpness`,`EXIF_Shutter_Speed`,`EXIF_Software`,`EXIF_White_Balance`) VALUES ('','REPLACEME','yes', '%{1}@','%{2}@','%{3}@','%{4}@','%{5}@','%{6}@','%{7}@','%{8}@','%{9}@','%{10}@', '%{11}@','%{12}@','%{13}@','%{14}@','%{15}@','%{16}@','%{17}@','%{18}@','%{19}@','%{20}@', '%{21}@','%{22}@','%{23}@','%{24}@','%{25}@','%{26}@','%{27}@','%{28}@','%{29}@','%{30}@', '%{31}@','%{32}@','%{33}@','%{34}@','%{35}@','%{36}@','%{37}@','%{38}@','%{39}@','%{40}@', '%{41}@','%{42}@','%{43}@','%{44}@','%{45}@','%{46}@','%{47}@','%{48}@','%{49}@','%{50}@','' );
After
echo "Data Inserted!";?>
- Step 50
HOST='server.com'
USER='username'
PASSWD='password'
FILE='ApertureInsertFinal.php'
ftp -n $HOST <<END_SCRIPT
quote USER $USER
quote PASS $PASSWD
cd public_html
cd aperture
delete $FILE
quit
END_SCRIPT
exit 0
Aperture
- In Presets - Image Export, create a setting called JPEG - Webgallery with the following settings
- JPEG, do not include metadata
- Fit within Pixels, Width 850, Height 1200
- Create a new album.
- Pop a few images in it (try 5 or 10 to start with)
- Make sure they have an IPTC caption and a few keywords
Run the Action
- Double click ApertureWeb.app
- Follow the prompts and select the gallery created in the previous step.
- Follow the onscreen prompts and enter the name for your new web gallery when requested.
Your gallery should now be complete and you can assess it at localhost or online at your webserver.
Modify the PHP pages
Open the PHP page, dynamicviewer.php in a text editor and look at the metadata information. Uncomment and additional lines of metadata that you wish to use and save the file.
How about creating a new style sheet to make the gallery unique? Should be pretty easy if you look at the code!
Finally, here are a few galleries created using this method.
Posted by Alex on Saturday, July 1st 2006 at 19:32:00
There are no comments yet. You can be the first to leave one!
{Add a comment}
You can add comments to these photos. Fill out the fields below. Email addresses will not be published.