iPhoto '09 (version 8.1.2) on OS X 10.5.8 and Image Capture do not download images from iPhone

While downloading images from an iPhone with iPhoto, a MacBook ran out of space, and since then, neither iPhoto nor Image Capture would download images from the iPhone. Image Capture showed generic thumbnails, acted like it was downloading to the Pictures folder, even changed the modification date of the Pictures folder, but nothing would download. iPhoto gave an error saying it couldn't downlod the images when Import All was clicked, and if a single image is attempted, it gives an error saying the image is not in a known format. Image thumbnails never correctly generate, showing only the dotted line where the thumbnail should be.

After trying many things, the soluction on this page worked:

http://www.tuaw.com/2009/03/11/tuaw-tip-fixing-syncing-between-iphone-and-iphoto-08/

That is:
  1. Open Image Capture with the iPhone attached
  2. Go to Devices pulldown and select Browse Devices…
  3. Uncheck the iPhone that shows "Connected" to disconnect it
  4. Recheck the iPhone to reconnect it
  5. Now Image Capture and iPhoto should work
But why? I don't know.
I found the three PIDs of Image Capture, Image Capture Extension and PTPCamera. The problem was already fixed, but I used iosnoop to see what files those three accessed. My guess is it has something to do with the colorsync profile cache, but it might be another preference that got re-written.

That cache file is in /private/var/folders so if you have this problem, you can find the cache file, see if it's dated from the time of the onset of the problems, and see if removing it fixed the problem without unchecking and rechecking connection in Image Capture. If you figure it out, let me know

Below are the commands I used to try to figure out which file it was that was causing a problem. The cfx# with random characters (e.g. cfx#0cU2yeL) seem to be temporary Preference files which are written when the content of a file will be changed, then moved in place of the actual preference file.

ps axuwww | grep "Image" | grep -v grep
smithson     9787  33.7  2.4   570596  50040   ??  S     2:19AM   0:03.20 /Applications/Image Capture.app/Contents/MacOS/Image Capture -psn_0_3281697
smithson     9690  15.4 13.7   688768 286308   ??  U     1:39AM   0:37.80 /System/Library/Image Capture/Devices/PTPCamera.app/Contents/MacOS/PTPCamera -psn_0_3232533
smithson     9203   7.2  0.4   365980   8756   ??  S     9:52PM   1:05.43 /System/Library/Image Capture/Support/Image Capture Extension.app/Contents/MacOS/Image Capture Extension -psn_0_3044071


sudo iosnoop -p 9787
#uncheck Image Capture connect checkbox
  501  9787 W 77828600   8192 Image Capture ??/Preferences/cfx#0cU2yeL
  501  9787 W 77828616  28672 Image Capture ??/-Caches-/com.apple.colorsync.profiles.501
#recheck Image Capture connect checkbox
  501  9787 W 78042208  28672 Image Capture ??/-Caches-/com.apple.colorsync.profiles.501
  501  9787 R  4273904  40960 Image Capture ??/Camera.nib/keyedobjects.nib
  501  9787 R  4273864   4096 Image Capture ??/Resources/CameraTable.plist

sudo iosnoop -p 9203
  UID   PID D    BLOCK   SIZE       COMM PATHNAME
#uncheck Image Capture connect checkbox
  501  9203 W 181012024   4096 Image Capture E ??/ByHost/cfx#5rtrmde
#recheck Image Capture connect checkbox
  501  9203 R 231565200   4096 Image Capture E ??/vm/swapfile4


sudo iosnoop -p 9800
  UID   PID D    BLOCK   SIZE       COMM PATHNAME
#uncheck Image Capture connect checkbox
  501  9800 W 181012032   4096  PTPCamera ??/ByHost/cfx#bpxEDSU
  501  9800 W 181012040   4096  PTPCamera ??/ByHost/cfx#qUiz0ST
  501  9800 W 181012032   4096  PTPCamera ??/Preferences/cfx#htcKsHz
  501  9800 W 181012048   4096  PTPCamera ??/Preferences/cfx#Pem9r0Z


sudo find  /private/var/folders -name com.apple.colorsync.profiles.501
/private/var/folders/a6/a90uNxfZFhqhkkwD4pm76E+++TI/-Caches-/com.apple.colorsync.profiles.501

sudo ls -la /private/var/folders/a6/a90uNxfZFhqhkkwD4pm76E+++TI/-Caches-/com.apple.colorsync.profiles.501
-rw-r--r--  1 smithson  staff  26624 Oct 18 03:07 /private/var/folders/a6/a90uNxfZFhqhkkwD4pm76E+++TI/-Caches-/com.apple.colorsync.profiles.501


sudo ls -latr ~/Library/Preferences/ByHost/com.apple.ImageCaptureExtension2.ADF478E9-7B97-54AB-A2CE-38CB4A909DE1.plist
-rw-------  1 smithson  staff  62 Oct 18 03:06 /Users/smithson/Library/Preferences/ByHost/com.apple.ImageCaptureExtension2.ADF478E9-7B97-54AB-A2CE-38CB4A909DE1.plist

sudo ls -latr ~/Library/Preferences/com.apple.ImageCaptureApp.plist ~/Library/Preferences/com.apple.PTPCamera.plist
-rw-------  1 smithson  staff   119 Oct 18 03:06 /Users/smithson/Library/Preferences/com.apple.PTPCamera.plist
-rw-------  1 smithson  staff  4171 Oct 18 03:07 /Users/smithson/Library/Preferences/com.apple.ImageCaptureApp.plist

-- linux_macosx_hints_etc page