views:

23

answers:

0

Using phpFlickr, I need to have 100x100 square thumbnails coming from Flickr. The problem I'm having is that using a larger size via the API such as the Small, the vertical oriented images will be distorted when resized to 100x100. I was using CSS to do this.

How can I distinguish between the vertically or horizontally oriented images by their width to make this work?

This is the code I have so far:

<?php require_once("phpFlickr/phpFlickr.php");
$f = new phpFlickr("APIKEY");
$user = "USERNAME";
$ph_sets = $f->photosets_getList($user);

?>

<?php $photos = $f->photosets_getPhotos('PHOTOSET'); ?>

<?php foreach ($photos['photoset']['photo'] as $photo): ?>



        <a rel="lightbox[]" href="<?= $f->
buildPhotoURL($photo, 'large') ?>"
title="<?= $photo['title'] ?>">
<img src="<?= $f->buildPhotoURL($photo, 'small') ?>"
alt="<?= $photo['title'] ?>" title="<?= $photo['title'] ?>" />
</a>

             <?php endforeach; ?>