Пример PHP (требуются модули php5-interbase и php5-gd)
require("db.php");
require("class.image.php");
header("Content-type: image/jpeg");
$db = db_connect();
$id_s = intval($_GET["id"]);
$id=intval($id_s);
//
$q = ibase_query($db ,"select ITEMPICS_BODY from ITEMPICS where ITEMPICS_ID = $id");
$row=ibase_fetch_object($q);
$blob_data = ibase_blob_info($row->ITEMPICS_BODY);
$blob_hndl = ibase_blob_open($row->ITEMPICS_BODY);
$bl = ibase_blob_get($blob_hndl, $blob_data[0]);
ibase_free_result($q);
$w = 640; $h = 640;
$filename = $bl ? dirname(__FILE__)."/img/product__$id.jpg" : dirname(__FILE__)."/img/no_pic.jpg";
if ($bl) fwrite(fopen($filename, 'w'), $bl);
$img = new Image($filename);
$img->resize($w, $h, 1, 0);
$img->toBrowser();
if ($bl) @unlink($filename);