iPhotoToGallery not working as expected

carlsson

Joined: 2005-03-17
Posts: 1
Posted: Thu, 2005-03-17 10:47

I use iPhotoToGallery, a plugin for Apple's iPhoto application. It work's great except for one, very important, thing: The comments are not exported.

I've emailed Zach about it but he haven't answered, so I try here, maybe someone knows about it!

TIA!
:roll:

 
starli

Joined: 2004-08-14
Posts: 8
Posted: Tue, 2005-05-03 17:57
carlsson wrote:
The comments are not exported.

I'm new to mac and iphoto but I installed this plugin today and tried it with some few uploads.

The comments ARE exported, but only into a custom field called "Description" in your gallery.

But, it seems that you cannot easily rename your old description-field to a new one without "loosing" all comments.. seems that gallery stores the field-entries by name, not by an ID ... maybe I missed something yet, as said, I'm also just playing around with it the first time and searching for a solution (I think there will exist scripts which does this anyway) .. but first I will take a look in the MacOS-Development-Folder if it's possible to tweak the binary of the plugin to rename this ;-)

(using Gallery 1.4.4, iPhoto 5.02)

 
starli

Joined: 2004-08-14
Posts: 8
Posted: Wed, 2005-05-04 17:41

I tweaked gallery_remote2.php and it's working now.

HowTo:

- in gallery_remote2.php
- go to function "processFile"
- near the end of this function you'll find:

			// add the extra fields
			$myExtraFields = array();
			foreach ($gallery->album->getExtraFields() as $field) {
				global $HTTP_POST_VARS;
				//$fieldname = "extrafield_$field";
				//echo "Looking for extra field $fieldname\n";

				// The way it should be done now
				$value = $HTTP_POST_VARS[("extrafield.".$field)];
				//echo "Got extra field $field = $value\n";
				if ($value) {
					if (get_magic_quotes_gpc()) {
						$value = stripslashes($value);
					}
					//echo "Setting field $field\n";
					$myExtraFields[$field] = $value;
				}

				// Deprecated
				$value = $HTTP_POST_VARS[("extrafield_".$field)];
*
				//echo "Got extra field $field = $value\n";
				if ($value) {
					if (get_magic_quotes_gpc()) {
						$value = stripslashes($value);
					}
					//echo "Setting field $field\n";
					$myExtraFields[$field] = $value;
				}
			}

- insert this at the marked (*) position:

 if ($field == "Beschreibung") {
 $value = $HTTP_POST_VARS[("extrafield_Description")];
 }

- and replace "Beschreibung" to the name of the custom field you want to have the iPhoto-Comment filled in.

You may have to copy the code to the "extrafields." section above as well if the iphoto-plugin uses "extrafields.Description" instead of "extrafields_Description" in on of the next releases...

 
starli

Joined: 2004-08-14
Posts: 8
Posted: Thu, 2005-05-05 16:54

Now this seems to be a real serious problem: Titles and/or comments with Umlauts, Accents, ... are really not exported or at least not set in the gallery..

*sigh*

 
TvE
TvE's picture

Joined: 2004-07-03
Posts: 76
Posted: Sat, 2005-06-25 11:33

Read this:
http://gallery.menalto.com/modules.php?op=modload&name=News&file=article&sid=160&mode=nested&order=0&thold=0

PS.: These characters "ä á à ê" work fine with Gallery 2 beta 3 and iPhotoToGallery 0.62.
The have to be in the title since the Comments are not IMPORTED to Gallery (they are EXPORTED from iPhoto)

 
TvE
TvE's picture

Joined: 2004-07-03
Posts: 76
Posted: Sun, 2005-06-26 22:01
starli wrote:
I tweaked gallery_remote2.php and it's working now.

HowTo:

- in gallery_remote2.php
- go to function "processFile"
- near the end of this function you'll find:

			// add the extra fields
			$myExtraFields = array();
			foreach ($gallery->album->getExtraFields() as $field) {
				global $HTTP_POST_VARS;
				//$fieldname = "extrafield_$field";
				//echo "Looking for extra field $fieldname\n";

				// The way it should be done now
				$value = $HTTP_POST_VARS[("extrafield.".$field)];
				//echo "Got extra field $field = $value\n";
				if ($value) {
					if (get_magic_quotes_gpc()) {
						$value = stripslashes($value);
					}
					//echo "Setting field $field\n";
					$myExtraFields[$field] = $value;
				}

				// Deprecated
				$value = $HTTP_POST_VARS[("extrafield_".$field)];
*
				//echo "Got extra field $field = $value\n";
				if ($value) {
					if (get_magic_quotes_gpc()) {
						$value = stripslashes($value);
					}
					//echo "Setting field $field\n";
					$myExtraFields[$field] = $value;
				}
			}

- insert this at the marked (*) position:

 if ($field == "Beschreibung") {
 $value = $HTTP_POST_VARS[("extrafield_Description")];
 }

- and replace "Beschreibung" to the name of the custom field you want to have the iPhoto-Comment filled in.

You may have to copy the code to the "extrafields." section above as well if the iphoto-plugin uses "extrafields.Description" instead of "extrafields_Description" in on of the next releases...

Hmm - where do you find the same functionality in the 2B3 version of Gallery, it looks very different that what is described above!

 
TvE
TvE's picture

Joined: 2004-07-03
Posts: 76
Posted: Sun, 2005-06-26 22:03
starli wrote:
I tweaked gallery_remote2.php and it's working now.

HowTo:

- in gallery_remote2.php
- go to function "processFile"
- near the end of this function you'll find:

			// add the extra fields
			$myExtraFields = array();
			foreach ($gallery->album->getExtraFields() as $field) {
				global $HTTP_POST_VARS;
				//$fieldname = "extrafield_$field";
				//echo "Looking for extra field $fieldname\n";

				// The way it should be done now
				$value = $HTTP_POST_VARS[("extrafield.".$field)];
				//echo "Got extra field $field = $value\n";
				if ($value) {
					if (get_magic_quotes_gpc()) {
						$value = stripslashes($value);
					}
					//echo "Setting field $field\n";
					$myExtraFields[$field] = $value;
				}

				// Deprecated
				$value = $HTTP_POST_VARS[("extrafield_".$field)];
*
				//echo "Got extra field $field = $value\n";
				if ($value) {
					if (get_magic_quotes_gpc()) {
						$value = stripslashes($value);
					}
					//echo "Setting field $field\n";
					$myExtraFields[$field] = $value;
				}
			}

- insert this at the marked (*) position:

 if ($field == "Beschreibung") {
 $value = $HTTP_POST_VARS[("extrafield_Description")];
 }

- and replace "Beschreibung" to the name of the custom field you want to have the iPhoto-Comment filled in.

You may have to copy the code to the "extrafields." section above as well if the iphoto-plugin uses "extrafields.Description" instead of "extrafields_Description" in on of the next releases...

Hmm - where do you find the same functionality in the 2B3 version of Gallery, it looks very different that what is described above!