Python traceback on 1.5.2

8 views
Skip to first unread message

ElCoyote_

unread,
Jan 11, 2010, 4:59:09 AM1/11/10
to iphotoexport-users
Hi everyone,

I was one happy iphoto user and now I'm trying to transition away from
it to keep my photo folders clean (That's why I reverted back to
iphoto 7.1.5 after iPhoto 8 messed up my folders).

I started using iphotoexport 1.5.0 and later to dry-run my transition
and see if I can use the cross-platform 'Picasa' to replace iPhoto in
my daily photo usage.

My iPhoto library has about 7k photos, about 300 events and no albums,
faces or smart albums. The iPhoto_Library is managed by iPhoto 7.1.5
and the folders inside the iPhoto_Library bear the names of the events
they relate to. I value very much my folder names and my 'originals'
because I want to keep my pictures (Family and Friends) organized into
folders to avoid being locked-in with a single tool (that's where
iPhoto '09 is going IMHO). Once the transition is satisfactory, I will
ditch iPhoto.

I use iPhotoExport like this:

/Users/raistlin/bin151/iphotoexport.py \
-e . -o -u -d --folderhints --picasa \
/Users/raistlin/Pictures/iPhoto_Library \
/Users/raistlin/Pictures/Picasa_Library

* -e . because my photos are organized into 'events'.
* -o because I want to keep my originals in case I need to revert to
them in the future.
* -u -d because I know what I'm doing. :) :) :)
* --picasa because I'm trying to transition to Picasa and I
want .picasaoriginals folders.

I noticed two issues with iPhotoExport (listed here by severity).
1) when using '-o', iphotoexport will complain that it cannot find
some modified files (the files are present and readable by the current
user) and report errno[2].. If there are many files like that, it will
eventually run out of file descriptors, report errno[24] and exit..
Here's a sample run:

/Users/raistlin/bin151/iphotoexport.py \
-e . -o -u -d --folderhints --picasa \
/Users/raistlin/Pictures/iPhoto_Library \
/Users/raistlin/Pictures/Picasa_Library
Reading iPhoto database...
Converting iPhoto data...
Scanning iPhoto data for photos to export...
Scanning existing files in export folder...
Exporting photos from iPhoto to export folder...
New file: /Users/raistlin/Pictures/Picasa_Library/
20100110_Debut_Janvier_Bailly/DSC06155.jpg (copy)
New file: /Users/raistlin/Pictures/Picasa_Library/
20100110_Debut_Janvier_Bailly/DSC06156.jpg (copy)
New file: /Users/raistlin/Pictures/Picasa_Library/
20100110_Debut_Janvier_Bailly/DSC06157.jpg (copy)
New file: /Users/raistlin/Pictures/Picasa_Library/
20100110_Debut_Janvier_Bailly/DSC06158.jpg (copy)
New file: /Users/raistlin/Pictures/Picasa_Library/
20100110_Debut_Janvier_Bailly/.picasaoriginals/DSC06158.jpg (copy)
Failed to export /Users/raistlin/Pictures/iPhoto_Library/Modified/
2010/20100110_Debut_Janvier_Bailly/DSC06158.JPG: [Errno 2] No such
file or directory
New file: /Users/raistlin/Pictures/Picasa_Library/
20100110_Debut_Janvier_Bailly/DSC06162.jpg (copy)
New file: /Users/raistlin/Pictures/Picasa_Library/
20100110_Debut_Janvier_Bailly/.picasaoriginals/DSC06162.jpg (copy)
Failed to export /Users/raistlin/Pictures/iPhoto_Library/Modified/
2010/20100110_Debut_Janvier_Bailly/DSC06162.JPG: [Errno 2] No such
file or directory
New file: /Users/raistlin/Pictures/Picasa_Library/
20100110_Debut_Janvier_Bailly/DSC06163.jpg (copy)
New file: /Users/raistlin/Pictures/Picasa_Library/
20100110_Debut_Janvier_Bailly/.picasaoriginals/DSC06163.jpg (copy)
Failed to export /Users/raistlin/Pictures/iPhoto_Library/Modified/
2010/20100110_Debut_Janvier_Bailly/DSC06163.JPG: [Errno 2] No such
file or directory
New file: /Users/raistlin/Pictures/Picasa_Library/
20100110_Debut_Janvier_Bailly/DSC06164.jpg (copy)
New file: /Users/raistlin/Pictures/Picasa_Library/
20100110_Debut_Janvier_Bailly/DSC06165.jpg (copy)
New file: /Users/raistlin/Pictures/Picasa_Library/
20100110_Debut_Janvier_Bailly/DSC06166.jpg (copy)
New file: /Users/raistlin/Pictures/Picasa_Library/
20100110_Debut_Janvier_Bailly/DSC06167.jpg (copy)
New file: /Users/raistlin/Pictures/Picasa_Library/
20100110_Debut_Janvier_Bailly/DSC06168.jpg (copy)
New file: /Users/raistlin/Pictures/Picasa_Library/
20100110_Debut_Janvier_Bailly/DSC06169.jpg (copy)
New file: /Users/raistlin/Pictures/Picasa_Library/
20100110_Debut_Janvier_Bailly/DSC06171.jpg (copy)
New file: /Users/raistlin/Pictures/Picasa_Library/
20100110_Debut_Janvier_Bailly/DSC06172.jpg (copy)
New file: /Users/raistlin/Pictures/Picasa_Library/
20100110_Debut_Janvier_Bailly/DSC06173.jpg (copy)
New file: /Users/raistlin/Pictures/Picasa_Library/
20100110_Debut_Janvier_Bailly/DSC06174.jpg (copy)
New file: /Users/raistlin/Pictures/Picasa_Library/
20100110_Debut_Janvier_Bailly/.picasaoriginals/DSC06174.jpg (copy)
Failed to export /Users/raistlin/Pictures/iPhoto_Library/Modified/
2010/20100110_Debut_Janvier_Bailly/DSC06174.JPG: [Errno 2] No such
file or directory
New file: /Users/raistlin/Pictures/Picasa_Library/
20100110_Debut_Janvier_Bailly/DSC06175.jpg (copy)

Issue 2)
When trying to use version 1.5.2, I now get:
/Users/raistlin/bin152/iphotoexport.py \
-e . -o -u -d --folderhints --picasa \
/Users/raistlin/Pictures/iPhoto_Library \
/Users/raistlin/Pictures/Picasa_Library
Reading iPhoto database...
Converting iPhoto data...
Traceback (most recent call last):
File "/Users/raistlin/bin152/iphotoexport.py", line 728, in
<module>
main()
File "/Users/raistlin/bin152/iphotoexport.py", line 719, in main
data = iphotodata.get_iphoto_data(library_dir, album_xml_file,
options.places)
File "/Users/raistlin/bin152/appledata/iphotodata.py", line 475, in
get_iphoto_data
data = IPhotoData(album_xml)
File "/Users/raistlin/bin152/appledata/iphotodata.py", line 73, in
__init__
for face_entry in face_list.values():
AttributeError: 'NoneType' object has no attribute 'values'

Any ideas?

Tilman

unread,
Jan 11, 2010, 4:14:36 PM1/11/10
to iphotoexport-users
Issue 1) that's weird. I see a lot of under scores in the path, e.g.
"iPhoto_Library" vs. "iPhoto Library", and also in your event names.
Did you actually rename your iPhoto library folder to use an
underscore? The other thing to double check is upper vs. lower case,
in particular the .JPG extension.

Issue 2) I can fix that. If you feel comfortable editing the scripts,
you can just delete lines 73 through 77 in appledata/iphotodata.py:
face_list = self._data.get("List of Faces")
for face_entry in face_list.values():
face_key = face_entry.get("key")
face_name = face_entry.get("name")
self.face_names[face_key] = face_name
# Other keys in face_entry: image, key image face index,
PhotoCount, Order
Since there are no faces in iPhoto 7.1.5, this code is not needed. I
will patch it up ASAP. Or stick with 1.5 for now.

Tilman

vin...@cojot.name

unread,
Jan 12, 2010, 4:47:08 AM1/12/10
to iphotoexport-users
On Mon, 11 Jan 2010, Tilman wrote:

> Issue 1) that's weird. I see a lot of under scores in the path, e.g.
> "iPhoto_Library" vs. "iPhoto Library", and also in your event names.
> Did you actually rename your iPhoto library folder to use an
> underscore? The other thing to double check is upper vs. lower case,
> in particular the .JPG extension.

Hi Tillman,

Yes, I renamed my iPhoto Library from "iPhoto Library" to just
"iPhoto_Library" because I don't like whitespace. :) I changed that using
the following procedure:

$ defaults read com.apple.iPhoto
RootDirectory/Users/raistlin/Pictures/iPhoto Library
$ defaults write com.apple.iPhoto RootDirectory /Users/raistlin/Pictures/iPhoto_Library
$ defaults read com.apple.iPhoto
RootDirectory/Users/raistlin/Pictures/iPhoto_Library

As for the .JPG vs .jpg, I hadn't tought of that. My SONY camera creates
.JPG files and I do have some .jpg files from my previous camera in my
iPhoto library.
Also, -I think - that the HFS+ filesystem that I'm using on my Mac isn't
case-sensitive.. Perhaps that might be the problem. (I read somewhere
that making your HFS+ filesystem case-sensitive - it's an option - could
break some software). I think Leopard creates a case-insensitive HFS+ by
default..

> Issue 2) I can fix that. If you feel comfortable editing the scripts,
> you can just delete lines 73 through 77 in appledata/iphotodata.py:
> face_list = self._data.get("List of Faces")
> for face_entry in face_list.values():
> face_key = face_entry.get("key")
> face_name = face_entry.get("name")
> self.face_names[face_key] = face_name
> # Other keys in face_entry: image, key image face index,
> PhotoCount, Order
> Since there are no faces in iPhoto 7.1.5, this code is not needed. I
> will patch it up ASAP. Or stick with 1.5 for now.

I commented them out and it now runs fine:

wayreth:~ raistlin$ ./bin152/iphotoexport.py -e . -o -u -d --folderhints \
--picasa ./Pictures/iPhoto_Library ./Pictures/Picasa_Library


Reading iPhoto database...
Converting iPhoto data...
Scanning iPhoto data for photos to export...
Scanning existing files in export folder...
Exporting photos from iPhoto to export folder...

Speaking of case sensitivity, do you have any idea why the movies get
renamed from .MPG files as "MPG .mpg"?

wayreth:~ raistlin$ find ./Pictures -iname MOV06057\*mpg
./Pictures/iPhoto_Library/Originals/2009/20091207_Neige_Sur_Bailly/MOV06057.MPG
./Pictures/Picasa_Library/20091207_Neige_Sur_Bailly/MOV06057 MPG.mpg
^^^^^^^^^^

If you know....

Many Thanks for the quick reply,

Best regards from France,

Vincent

--
,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'`^`'~*-,
Vincent S. Cojot, Computer Engineering. STEP project. _.,-*~'`^`'~*-,._.,-*~
Ecole Polytechnique de Montreal, Comite Micro-Informatique. _.,-*~'`^`'~*-,.
Linux Xview/OpenLook resources page _.,-*~'`^`'~*-,._.,-*~'`^`'~*-,._.,-*~'
http://step.polymtl.ca/~coyote _.,-*~'`^`'~*-,._ coy...@NOSPAM4cojot.name

They cannot scare me with their empty spaces
Between stars - on stars where no human race is
I have it in me so much nearer home
To scare myself with my own desert places. - Robert Frost

Tilman

unread,
Jan 13, 2010, 3:38:23 PM1/13/10
to iphotoexport-users
On the renaming part:

iphotoexport use the iPhoto title, regardless of what the actual file
name is in the library, to name the export file. So most likely, the
title in your iPhoto library is "MOV06057 MPG". It then adds the file
extension, .mpg. There is some code around line 363 of iphotoexport.py
that detects such patterns, but it currently only recongnizes image
extensions:
# default image caption filenames have the file extension on them
already,
# so remove it or the export filename will look like "IMG 0087
JPG.jpg"
orig_basename = re.sub(re.compile(r'\.(jpeg|jpg|png|tif|tiff)$',
re.IGNORECASE), '',
orig_basename)
If you add "|mpeg" to that list, it might fix it for you:
# default image caption filenames have the file extension on them
already,
# so remove it or the export filename will look like "IMG 0087
JPG.jpg"
orig_basename = re.sub(re.compile(r'\.(jpeg|jpg|mpeg|png|tif|tiff)
$',
re.IGNORECASE), '',
orig_basename)


Tilman

> >> � �File "/Users/raistlin/bin152/iphotoexport.py", line 728, in
> >> <module>
> >> � � �main()
> >> � �File "/Users/raistlin/bin152/iphotoexport.py", line 719, in main
> >> � � �data = iphotodata.get_iphoto_data(library_dir, album_xml_file,
> >> options.places)
> >> � �File "/Users/raistlin/bin152/appledata/iphotodata.py", line 475, in
> >> get_iphoto_data
> >> � � �data = IPhotoData(album_xml)
> >> � �File "/Users/raistlin/bin152/appledata/iphotodata.py", line 73, in
> >> __init__
> >> � � �for face_entry in face_list.values():

Reply all
Reply to author
Forward
0 new messages