I am proud to announce that the Device Images feature is back in version 2.1.2! It comes in the form of a utility class that you can use to retrieve the device image from an instance of Tera-WURFL.
Here's a usage example:
- Code: Select all
$image = new TeraWurflDeviceImage($teraWurflObj);
$image->setBaseURL("http://www.yourdomain.com/device_pix/");
$image->setImagesDirectory("/var/www/html/device_pix/");
if($image->getImage()===false){
// There was no device image available
echo "No image available<br/>";
}else{
// Display the image with it's name for the title
$title = $teraWurflObj->capabilities['product_info']['brand_name'] . " " . $teraWurflObj->capabilities['product_info']['model_name'];
echo sprintf('<img border="0" title="%s" src="%s" />',$title,$image);
}
The TeraWurflDeviceImage class is a major improvement from the old method of determining a device image; if it is not able to find an image for the exact device, it looks for an ancestor to the device and uses a picture of that device instead (this behavior is configurable via TeraWurflDeviceImage::descend).
You can download the device images from the WURFL Project's website: http://wurfl.sourceforge.net/utilities/ ... bnails.php