Wednesday, August 09, 2006

Put A Face To That Name!

Ahh summer...the time when I spend my days working, my evenings training for a marathon and my weekends out of town attending weddings. But I am back in town and I was able to spend a little bit of quality time with the source-code, and I am happy to announce a new feature for onXiam.

You've chosen your name, you've tied your identities together, now you can now upload a photo to your onXiam profile! For an example, you can check out my profile. Ideally this would have been ready when I first turned the site on, but it was a time-crunch and it just slipped down the priority list. But now it is ready to go, so get to uploading, people!

FYI, in order to simplify my life in the future, I decided to use a pre-determined size for all user photos. That size is 150x150 pixels. Big enough to see, but small enough to fit in columns should I create a new CSS for the site. If you want your user photo to be absolutely perfect, you could crop it beforehand to be the desired 150x150 dimensions. However, cropping beforehand is not absolutely necessary. Here's how it works:

The image you want to upload:
  • Is smaller than 150x150
    • The image will be displayed at its native size in the middle of a 150x150 area
  • Is portrait and taller than 150
    • The image will be automatically resized to a height of 150px, preserving aspect ratio
  • Is landscape and wider than 150
    • The image will be automatically resized to a width of 150px, preserving aspect ratio
  • Is bigger than 150x150
    • The image will be automatically resized to fit the 150x150 area, preserving aspect ratio
I hope this works ok for everyone. I'm anxious to see everyone's faces!

More to come...

8 Comments:

Blogger SignpostMarv said...

Can we be lazy and opt for the relevant profile photo to be copied & cached from one of the services we have indicated on onXiam ?

PS: Please don't let your script-fu exclude PNG images. I've found several sites & services that don't allow PNGs to be uploaded when there doesn't immediately seem to be a good reason for it. coughSecondLifecough

5:41 PM  
Blogger Kevin Poulsen said...

Let me look into the PNG format for uploads. I never write things like image uploads, so it's kinda foreign ground for me. I'm using a pre-written upload utility around which I've wrapped some code. If I can do it easily, I'll get it in there for you. If the upload utility that I'm using can't handle it, then I'm not sure if I'll spend the time on it.

As for using photos from other services, that was my first thought since...well, since I didn't want to spend time developing the image upload. But when I looked into it at first, I saw a few problems. I'll just use Flickr as an example since it's easy.

Quote: "Flickr Terms of Service specify that if you post a Flickr photo on an external website, the photo must link back to its photo page."

I have no problem with that, but it could get quite difficult for me to enforce that for Flickr alone, yet alone for all other sites from which people may want to link profile photos.

In the end it actually turned out to be easier for me to create a simple routine that utilized an already written photo upload utility, so that's the route I've taken for now so that I can continue to develop more new and interesting things for the site.

6:39 PM  
Anonymous Anonymous said...

Might be a good idea to only show a photo on People and Latest if there is one available. Also, you might want to put them on absolute-center.. As it is the bullet points look misaligned

7:04 PM  
Blogger SignpostMarv said...

I do remember a problem some image processing scripts have with interlaced and none interlaced images, so that's one thing you'll want to put on the testing list.

Now as to the flickr thing....

I do believe this assumes that you are linking directly to a photo held on http://static.flickr.com/

This would effectively be Flickr's policy to allow hotlinking. However, what I'm suggesting (would also probably require a verification mechanism of putting the onXiam URL in their profile) would mean copying a photo that the onXiam user owns from flickr to your server.

I would suggest speaking to flickr before you do something like that, because although each photo would only be copied once, and although the onXiam user would own the photo, and although you'd theoretically be being nice by not forcing users to re-upload photos that are already on the net, Flickr have some very strange policies. coughNIPSAcough

PS. PHP!

2:39 AM  
Blogger Kevin Poulsen said...

signpostmarv - I tested out PNGs, and it seems to work ok with them. However, they seem to look not quite as "sharp" after the resizing compared to gif and jpgs. I am totally not a graphics guru, so I don't really know why that would be. But you can now upload PNG files for your profile image.

Also, when looking into the PNG issue, I came up with a slightly better revision to the code that will still do the resize, yet will not put the black edges on portrait and landscape images. That is, they will not be resized to a 150x150 square. Rather, they will be resized to a MAXIMUM of 150x150, but if they are smaller (say a portrait of 100wide X 150high), then that is how they will be displayed.

Take a look and you'll see what I mean. It's easier to see than it is to explain. I fixed the images that were already uploaded, so all is good to go.

12:23 PM  
Blogger Kevin Poulsen said...

Oh, and I'll keep thinking about the "link to photo somewhere else" topic as well. But my thinking on that matter at this moment is that it would be quite difficult to implement something of that nature and be in compliance with whatever terms of service all of these various sites may have, so I really think that for now that will fall way down on the priority list.

I could email the Flickr people, but that's only one of many sites where people have images. I'd have to contact Dodgeball and Upcoming and...the list goes on. That's just not what I really want to focus my time and efforts on right now. Perhaps in the future, but for now I'd really rather keep adding features and functionality to onXiam.

That being said, I certainly do appreciate the discussion and suggestions! Keep the feedback coming!

12:27 PM  
Blogger Kevin Poulsen said...

Baba - I didn't forget about you! Yes, I agree that the latest page looks kind of funky right now. I'm still experimenting with that layout. I may remove the images like you said, but I'm not positive yet what I want that to look like. It will probably change from time to time while I'm experimenting. Thanks for throwing your $0.02 into the mix!

12:30 PM  
Blogger SignpostMarv said...

I'm not seeing much noticable difference between the manipulated PNG I uploaded and the original "zoomed out" with the Firefox "Image Zoom" extension.

It would be nice if you could eventually add the ability to select an are of the uploaded image to use as the display photo.

Also, while I'm here: regarding the identities with syndication feeds associated with them- please add a "last updated" date to them :-)

5:36 AM  

Post a Comment

<< Home