Usage sample

2012-03-11: Thanks to Roland Schütz for pointing out that flickr changed their images' static URL. The file randomFlickr.php has been updated and will now work again. Thank you Roland!

GD-Library 2 required. PHP5+ required for grayscaling image. PHP4 users see php-4 demo

Fetch a random picture from my photostream, wrap it in a link to it's flickr-photo-page, and load it with randomFlickr to shrink it proportional to 400x240 pixel and crop it.

no pic: could not fetch data from badge http://www.flickr.com/badge_code_v2.gne?count=1&display=random&size=m&layout=x&source=user&user=7353617%40N04

How to include

<?php 
$badge  
'http://www.flickr.com/badge_code_v2.gne?count=1&display=random&size=m&layout=x&source=user&user=7353617%40N04';
$width  400;
$height 240;
$gray   true;

/**
 *  if you want the Class to try to guess the best source size 
 *  (should work for all near-standard uses) you don't have to add
 *  anything at all. Should you need to force the script to
 *  auto-detect, the following line will do:
*/
$size "auto";

/**
 *  if you want to manually define the size to use add the following
 *  line and use one of these size-constants:
 *  "xxs" (75x75), "xs" (100x?), "s" (240x?), 
 *  "m" (500x?), "l" (1024x?), "xl" (original)
*/
$size "m";

include(
"flickpic.php"); 
?>