Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Login Image

Login Image
Thread Tools
Professional Poster
Join Date: Sep 2000
Location: Texas
Status: Offline
Reply With Quote
Feb 10, 2004, 01:26 PM
 
Does ayone know where the user preferences are stored for the login image? I know where the login images are located, but not the preference on who gets what image. This is releated to programming because I want to try and get the image for a user. Thanks!
     
Dedicated MacNNer
Join Date: Dec 2002
Location: someplace
Status: Offline
Reply With Quote
Feb 10, 2004, 01:36 PM
 
niutil -readprop . /users/$USER picture
To assign it:
sudo niutil -createprop . /users/$USER picture "/Library/User Pictures/yourpicture.tif"
(The picture can be anywhere in the filesystem, though. Just be sure to quote the path if it has spaces. Also, it wouldn't be good if the picture was moved or deleted, so you may want to choose a good static location for it.)
     
Professional Poster
Join Date: Sep 2000
Location: Texas
Status: Offline
Reply With Quote
Feb 10, 2004, 01:49 PM
 
How about where the preference is stored or maybe a way in cocoa to get the User Login Picture, same as

userName = NSFullUserName();

I could just use a location and get it that way... If I just knew the location to the preferences file of the login image.......
     
Mac Elite
Join Date: Feb 2001
Location: Vancouver, WA
Status: Offline
Reply With Quote
Feb 10, 2004, 02:30 PM
 
Nope -- there's no such API, at least, not that's public. You used to be able to use the NetInfo C API (BSD-style) to accomplish the same thing as gatorparrots' niutil example (you still can if you dig up netinfo/ni.h on the net and link the private framework), but now the only public supported API for that is in the DirectoryServices.
(Last edited by Rickster; Feb 10, 2004 at 02:35 PM. )
Rick Roe
icons.cx | weblog
     
Professional Poster
Join Date: Sep 2000
Location: Texas
Status: Offline
Reply With Quote
Feb 10, 2004, 02:41 PM
 
Ok that is what I thought. How about where the preference for the user image is located? I cant do a search right now b/c I am at work... I looked for about 20 minutes earlier and found nothing.
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Feb 10, 2004, 03:27 PM
 
Originally posted by Rickster:
Nope -- there's no such API, at least, not that's public. You used to be able to use the NetInfo C API (BSD-style) to accomplish the same thing as gatorparrots' niutil example (you still can if you dig up netinfo/ni.h on the net and link the private framework), but now the only public supported API for that is in the DirectoryServices.
I was directed away from the ni* API by the Apple engineers responsible for NetInfo and towards DirectoryServices now that NIAccess/NIInterface have gone.
     
Addicted to MacNN
Join Date: May 2001
Location: Cupertino, CA
Status: Offline
Reply With Quote
Feb 10, 2004, 03:56 PM
 
I wouldn't recommend trying to use the preference file, as I'd imagine Apple could move the file in the future or change its format.
     
Professional Poster
Join Date: Sep 2000
Location: Texas
Status: Offline
Reply With Quote
Feb 10, 2004, 04:24 PM
 
Hmm... without using the pref file, how can you get the users image? Well... I have an idea, let the user choose their own image again! Unless someone knows of unsupported or supported call, thanks!
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Feb 14, 2004, 04:43 AM
 
Originally posted by djohnson:
Hmm... without using the pref file, how can you get the users image? Well... I have an idea, let the user choose their own image again! Unless someone knows of unsupported or supported call, thanks!
Uh, use NetInfo. As was suggested above...
     
Grizzled Veteran
Join Date: Jun 2001
Status: Offline
Reply With Quote
Feb 21, 2004, 05:27 PM
 
Using that command returns the path:
/Library/Caches/com.apple.user501pictureCache.userImage

If I try to read the file with something as simple as cp, it tells me that nothing exists with that name. What the...
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Feb 21, 2004, 06:11 PM
 
Originally posted by macgyvr64:
Using that command returns the path:
/Library/Caches/com.apple.user501pictureCache.userImage

If I try to read the file with something as simple as cp, it tells me that nothing exists with that name. What the...
Works fine here. If I cp it to ./blah.jpg then open it with preview it's my user icon.
     
Senior User
Join Date: Oct 2000
Location: Midwest
Status: Offline
Reply With Quote
Feb 21, 2004, 06:31 PM
 
Too hard. Use the Login Options of the Accounts System Preferences. Select the Picture option and click on Edit…

HTH
Craig
     
Grizzled Veteran
Join Date: Jun 2001
Status: Offline
Reply With Quote
Feb 21, 2004, 06:36 PM
 
Is your icon in /Library/Caches/?

I've tried several different things, and they all tell me this:
[PowerBook-G4:~] collin% niutil -readprop . /users/$USER picture
/Library/Caches/com.apple.user501pictureCache.userImage
[PowerBook-G4:~] collin% cp /Library/Caches/com.apple.user501pictureCache.userImage ~/Desktop/blah.jpg
cp: /Library/Caches/com.apple.user501pictureCache.userImage: No such file or directory

Strange.
     
Professional Poster
Join Date: Sep 2000
Location: Texas
Status: Offline
Reply With Quote
Feb 21, 2004, 07:01 PM
 
Originally posted by suthercd:
Too hard. Use the Login Options of the Accounts System Preferences. Select the Picture option and click on Edit…

HTH
Craig
I am not wanting to change it, I merely want to see the image set for the user. BTW, I still have not found it...
     
   
Thread Tools
Forum Links
Forum 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
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 12:58 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2