Go Back   The macosxhints Forums > OS X Help Requests > Applications



Reply
 
Thread Tools Rating: Thread Rating: 12 votes, 5.00 average. Display Modes
Old 02-03-2005, 01:56 PM   #1
lull
Prospect
 
Join Date: Mar 2003
Location: San Jose
Posts: 44
Angry iPhoto 5 Albums for Rotating Backgrounds?

I've been using iPhoto 4 Albums to organize collections of images that I like to use for wallpapers. I had the "Desktop and Screen Saver" preferences set up to change the image every 15 minutes. I don't know what exactly the problem is, but (I think) since I updated to iPhoto 5 it was changing to background pictures that were no longer in the Album that I had selected. I went in and double-checked, then seeing that I was right I thought maybe it had to do with upgrading to iPhoto 5. I created a new album, dragged all the images from the originally selected album into this new one, and now System Prefs won't let me even check the "Change picture" option! It's just all grey! Has anybody else seen this? I am now unable to select "Change Picture" for any of my iPhoto 5 albums.
lull is offline   Reply With Quote
Old 02-03-2005, 09:23 PM   #2
Caius
All Star
 
Join Date: Oct 2004
Location: Leeds, UK
Posts: 757
I think its dependant on the number of pictures in the album. Haven't tested this theory but I just went and tested this on my iMac with iPhoto 4 and X.3.7 and it only lets me do that on my smaller albums.

Edit

It seems that with iPhoto 4.x (can't remember which version), the number of pictures dictates whether the option to have the picture auto change active or not. That could just be my iMac going screwy again. (Too many system hacks methinks.)

With my PB however, I cannot get it to allow me to use the auto changing desktop feature. Thats running 10.3.7 and iPhoto 5.0.1

Strange...
__________________
http://caius.name/

Last edited by Caius; 02-03-2005 at 10:38 PM.
Caius is offline   Reply With Quote
Old 02-07-2005, 10:48 AM   #3
sanderdejong
Triple-A Player
 
Join Date: Feb 2002
Location: Netherlands
Posts: 85
I had an album in iPhoto 4 with > 900 pictures and auto rotate + random desktop image: no problemo.

I upgraded to iPhoto 5: still no problem with the desktop images.

I then upgraded to 5.01, due to a few crashes of 5.00 and now I can no longer use an iPhoto album. What I can do: select a map with pictures (but you have to export the pictures in the iPhoto album first to that map). Not a nice workaround with > 900 pictures, this takes a lot of time.

Edit:
iphoto map = on top of the list of photo collections in desktop background preferences. Corresponds with an OS X folder/directory.
iphoto album = at bottom of the list of photo collections in desktop background preferences. Corresponds with an album in iPhoto.
end edit

Last edited by sanderdejong; 02-08-2005 at 03:21 AM.
sanderdejong is offline   Reply With Quote
Old 02-07-2005, 12:13 PM   #4
lull
Prospect
 
Join Date: Mar 2003
Location: San Jose
Posts: 44
A Map?

That's handy info about the versions. I wonder if Apple is aware of the problem...

I'm not sure what you mean about selecting a map, but I think you and I did the same thing with exporting the images to a new folder. I actually found that this works better because I can resize the images to a proper desktop size so that my puny powerbook doesn't have to scale down 6mp pictures on the fly. Regardless, it'll be nice when they fix it again.
lull is offline   Reply With Quote
Old 02-20-2005, 12:25 AM   #5
griffman
MVP
 
Join Date: Dec 2001
Location: Portland, OR
Posts: 1,472
This just bit me tonight -- it sure seems like a 5.0.1 bug. Sigh.

-rob.
griffman is offline   Reply With Quote
Old 02-22-2005, 08:25 PM   #6
proffesor
Prospect
 
Join Date: Sep 2004
Posts: 3
More info

Hey guys, I was hit by this bug too. It really sucks.

At first I thought it was number of pics too, but that is not it.

Older versions of iPhoto kept a record of Albums in the directory:
iPhoto Library/Albums/
with one subfolder for each album. Each subfolder contained symlinks (shortcuts) the various images it contained.

The new version of iPhoto does not maintain these directories which System Preferences uses to change the desktop picture automatically. (it does not delete these folders automatically, which is why the old ones still work).

I have written a script to parse the iPhoto's AlbumData.xml file and create a similar directory structure that System Preferences likes.

I will post it, but be forwarned:

it is perl, and it requires XML::Parser. So you can't just plop it on your machine and run it (unless you have already installed XML::Parser).

Also, it is my first time writing code for XML::Parser, so it is VERY hard to understand what the code does. Sorry, I didn't know any better and wanted to fix the problem.

This fixes the problem for the time being.

-Seth
proffesor is offline   Reply With Quote
Old 02-22-2005, 08:28 PM   #7
proffesor
Prospect
 
Join Date: Sep 2004
Posts: 3
A script to fix this problem

Hey, I was bitten by this bug, and didn't like it. Upon investigation, I discovered that iPhoto no longer creates symlinks in its Albums directory for each album and its images.

I hacked together a perl script parses the xml file and creates directories and symlinks in the Albums folder in order to restore the "Change Picture every..." Function in System Prefs.

You have to run it every time you change your albums (you could automate it from cron, or alias iPhoto to a script that runs iPhoto, and runs fixPhoto.pl when iPhoto returns.)

Ok... to use:

1) install XML::Parser with CPAN
2) run fixPhoto.pl passing it the location and name of AlbumData.xml as a parameter
./fixPhoto.pl ~/Pictures/iPhoto\ Library/AlbumData.xml
(you should be able to copy and paste that line into your terminal. Make sure it has a '\' in front of the space.)

Notes:
- it makes a backup of Albums/ in a new directory called Backup/
- it does NOT touch AlbumData.xml

WARNING:

DO NOT RUN RANDOM PERL SCRIPTS ON YOUR COMPUTER, they could seriously screw things up.

This script is not guaranteed to work, though I don't think it can break iPhoto. it Does not touch your pictures, it merely creates shortcuts to them.

I guarantee you will not be able to understand the XML Parsing code, I have never used XML::Parser before, and I am certain that the syntax I am using is very very fragile and will probably not work with any upgrades.

here is the code: (it is attached as a zip file)
Code:
#!/usr/bin/perl -w

# fixPhoto.pl

use strict;
use XML::Parser;

# this is a hash that relates iPhoto's photo ids to their locations on the drive
my %master_image_list;  

# this is a hash of hash refs to albums
my %albums;

my ($current_state, $current_album, $current_image, $current_photo_id, $current_sub_state, $level);

my ($currentMasterPhoto, $current_image_path);
$current_state = '';
$current_sub_state = '';

$level = 0;

my $file;
my $albumdir = $file = shift;

$albumdir =~ s/Data\.xml$//;
$albumdir .= 's';


print "Parsing \n$file\n\nPutting Albums in \n$albumdir\n";

print "Parsing XML\n";

my $parser = new XML::Parser ( Handlers => {
								Start 	=> \&start_handler,
								End		=> \&end_handler,
								Char		=> \&char_handler,
								Default	=> \&default_handler,
							  });

$parser->parsefile( $file );

#print Dumper(%albums);
#print Dumper(%master_image_list);

print "done parsing XML\n";
print "found albums:\n";
foreach my $album (keys %albums) {
	print "	$album\n";
}
print "creating directories and symlinks for albums\n";
create_symlinks( );

print "done creating directories and symlinks\n";

 1;



# this subroutine goes through the albums, creating directories and
# symlinks if necessary.
sub create_symlinks {

	mkdir "$albumdir/../Backup" unless -e "$albumdir/../Backup";
	rename $albumdir, "$albumdir/../Backup/Albums.bak.". time() if -e $albumdir;
	
	mkdir $albumdir;

	foreach my $album (keys %albums) {
		#move old album folder
		next if !defined $album;
		print "	$album... ";
		my $albumfolder = "$albumdir/$album";
		if (-e $albumfolder) {
			rename  $albumfolder, $albumfolder.".bak". time();
	
		}
		
		#create new album folder

		mkdir $albumfolder;
				
		foreach my $photo (keys %{$albums{$album}}) {
			#create symlink
			my $image = $master_image_list{$photo};
			$image =~ s/^[\s\n]*//;
			$image =~ s/[\s\n]*$//;

			symlink $image, $albumfolder."/$photo.JPG";
		}
		print " is done\n";

	
	}

}





# Here are the handlers

sub start_handler {
	my ($p, $elt, %atts) = @_;
#	$currentelement = $elt;
	if ($current_state eq 'MasterImageList' ) {	
		#we are looking for keys to add imagepaths to
		if ($elt eq 'dict') {
			$level++;
		} elsif ($elt eq 'key') {
			
			$current_sub_state = "getMasterPhotoID" if ($level == 1);

		}
	} else {
		if($elt eq 'key') {
			$current_state = "getkey";
		}
	}
	
}


sub end_handler {
	my ($p, $elt) = @_;

	if ($current_state eq 'MasterImageList' ) {	
		#we are looking for keys to add imagepaths to
		if ($elt eq 'dict') {
			$level--;
		} elsif ($elt eq 'key') {
			# we are done getting the master image id
			$current_sub_state = 'waitImagePath' if $current_sub_state eq 'getMasterPhotoID';
		} elsif ($elt eq 'string' and $current_sub_state eq 'getImagePath') {
			$master_image_list{$currentMasterPhoto} = $current_image_path;
			$currentMasterPhoto = '';
			$current_image_path = '';
		}
		
	} else {
		if ($elt eq 'array') {	

			$current_state = '';
		
		} elsif ($current_state eq 'getkeylist') {
			if ($elt eq 'string') {
				# we just got a photo id, lets add it to the album
				$current_photo_id =~ s/^[\s\n]*//;
				$current_photo_id =~ s/[\s\n]*$//;
				$current_album =~ s/^[\s\n]*//;
				$current_album =~ s/[\s\n]*$//;
				$albums{$current_album}{$current_photo_id} = undef; # add an entry for this key
				$current_photo_id = undef;
			} elsif ($elt eq 'array') {
				# we reached the end of this album
				$current_state = 'undef';
				$current_album = undef;
				$current_photo_id = undef;
			}
		} elsif ($current_state eq 'getAlbumName') {
			#we are getting an album name
			if ($elt eq 'string') {
				$current_album =~ s/^[\s\n]*//;
				$current_album =~ s/[\s\n]*$//;
				$current_state = '';
			}
		} 
		
	}
}

sub char_handler {
	my ($p, $str) = @_;

	if ($current_state eq 'getkey') {
		# we want to record the value of a key

		if($str eq 'AlbumName') {
			$current_state = 'getAlbumName';
			$current_album = '';
		} elsif ($str eq 'KeyList') {
			# what will follow are strings with the keys of the photos
			# in this album
			$current_state = 'getkeylist';
		} elsif ($str eq 'Master Image List') {
			$current_state = 'MasterImageList';
		}
	} elsif ($current_state eq 'getAlbumName'){
		# we just go the name of the current album
		$current_album .= $str;
	} elsif ($current_state eq 'getkeylist') {
		# we are adding a song to an album
		$current_photo_id .= $str;
	} elsif ($current_state eq 'MasterImageList') {
			if ($current_sub_state eq 'waitImagePath') {
				if ($str eq 'ImagePath') { 
					$current_sub_state = 'getImagePath';
				}
			} elsif ($current_sub_state eq 'getImagePath') {
				$current_image_path .= $str;
			}elsif ($current_sub_state eq 'getMasterPhotoID') {
				$currentMasterPhoto .= $str;
			}
	}
	

}

sub default_handler {


}
-Good luck

-Seth
Attached Files
File Type: zip fixPhoto.pl.zip (2.1 KB, 2129 views)
proffesor is offline   Reply With Quote
Old 02-23-2005, 05:35 AM   #8
Caius
All Star
 
Join Date: Oct 2004
Location: Leeds, UK
Posts: 757
Quote:
Originally Posted by Proffesor
install XML::Parser with CPAN

Where do i find the installer?
__________________
http://caius.name/
Caius is offline   Reply With Quote
Old 02-23-2005, 09:57 AM   #9
proffesor
Prospect
 
Join Date: Sep 2004
Posts: 3
CPAN installation

in order to install XML::Parser, you must run CPAN, the perl installer.

Drop to a command line in terminal and type

sudo cpan
<type your admin password>

then you may need to configure CPAN ( you might try telling it you don't want to configure yet ). All of the defaults should be fine.

when it is done configuring, type

install XML::Parser

it will ask you about prerequisites. Tell CPAN it is ok to install these ("prepend to qeue" I think).

When this is done, my script should run.

-Seth
proffesor is offline   Reply With Quote
Old 02-23-2005, 07:15 PM   #10
Caius
All Star
 
Join Date: Oct 2004
Location: Leeds, UK
Posts: 757
I had to install expat before XML::Parser

BTW, shouldn't this be a hint on the main site?
__________________
http://caius.name/
Caius is offline   Reply With Quote
Old 03-07-2005, 08:52 PM   #11
Michael_Sacco
Prospect
 
Join Date: Mar 2005
Posts: 2
Thumbs up 5.0.1 iPhoto works like this....

All,

After being disappointed by this seeming lack of a feature I found out how to get iPhoto to allow this. Simply select the album you want, but don't select any specific photo. Make sure none of the photo's are selected. Then, click on the Desktop button at the bottom of iPhoto. This brings up the Desktop Settings Preference with the folder selected entitled: "iPhoto Selection". You can then set the rotate every xx minutes feature. Very cool! Let me know how this works for you.
Michael_Sacco is offline   Reply With Quote
Old 03-07-2005, 09:13 PM   #12
lull
Prospect
 
Join Date: Mar 2003
Location: San Jose
Posts: 44
Thumbs up Awesome, it works

Quote:
Originally Posted by Michael_Sacco
[ in iphoto ] ... Simply select the album you want, but don't select any specific photo. Make sure none of the photo's are selected. Then, click on the Desktop button at the bottom of iPhoto.

Wow, it works! That's really strange that they only let you cycle those "iPhoto Selection" backgrounds and not the albums, but from a disk management point of view I can understand why they wouldn't want so many symlinks. Hopefully this will be really tweaked when Tiger comes out and make it better than either iphoto 4 or 5 is right now. Thanks for the tip! You should definitely post that one as a hint!
lull is offline   Reply With Quote
Old 03-07-2005, 10:45 PM   #13
griffman
MVP
 
Join Date: Dec 2001
Location: Portland, OR
Posts: 1,472
I'd say that's a workaround, but a pretty poor substitute for the previous method -- I could link whatever album I wanted with iPhoto4 and have it available for random, why not now? Also, you can still use the albums from iPhoto5 in the Desktop panel, just not randomly -- hence, all the links are still there.

This seems a bug to me, and I'm going to file it as such and see what they have to say ...

-rob.
griffman is offline   Reply With Quote
Old 06-09-2005, 09:14 PM   #14
tripleman
Prospect
 
Join Date: May 2005
Posts: 3
Smart folders won't work

That is a partial solution (and not a bad one either) but I doesn't seem to work with smart folders - at least for me.

I really couldn't care less about this feature if it's not auto-updating the photos in rotation.

While this whole thing isn't critical, it is something that I miss and it's kind of getting under my skin.

I've also reported it as a bug.

I'm running 10.4.1 with iPhoto 5.02 and I've been waiting since 10.3.8 for them to address this issue. Then again, 10.4.2 should be out in a couple of days.

Let's hope.
tripleman is offline   Reply With Quote
Old 05-29-2007, 10:49 AM   #15
jschrader
Prospect
 
Join Date: May 2007
Location: Tampa, FL
Posts: 7
Quote:
Originally Posted by lull
Quote:
Originally Posted by Michael_Sacco

[ in iphoto ] ... Simply select the album you want, but don't select any specific photo. Make sure none of the photo's are selected. Then, click on the Desktop button at the bottom of iPhoto.


Wow, it works! That's really strange that they only let you cycle those "iPhoto Selection" backgrounds and not the albums, but from a disk management point of view I can understand why they wouldn't want so many symlinks. Hopefully this will be really tweaked when Tiger comes out and make it better than either iphoto 4 or 5 is right now. Thanks for the tip! You should definitely post that one as a hint!

That worked great for me too! Been trying to figure this one out for a while now. Glad when I actually started searching about it, I found this post first ... and... FIXED!

Few differences for me though I guess for Version 6.0.6. They removed the "Desktop" option from the bottom button list, but it is Share Menu > Desktop

Thanks guys
jschrader is offline   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump



All times are GMT -5. The time now is 04:03 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2014, vBulletin Solutions, Inc.
Site design © IDG Consumer & SMB; individuals retain copyright of their postings
but consent to the possible use of their material in other areas of IDG Consumer & SMB.