FotoTagger Web API basically allows extract annotations from the photos and display them on web pages, so that annotations are positioned over the picture, as it was specified by annotations author, and allowing instantly hide or show the annotations.
Everyone can annotate photos with a free FotoTagger tool for PC (Widnows). The text is embedded into the picture itself. The annotations are stored in the standartized open FotoML format, based on XML and RDF. As FotoML is free and provides a standardized way to represent information about the objects on photos, Cogitum encourages developers to use this format in their applications.
FotoTagger Web API is copyrighted by Cogitum LC. Please see the license agreement and find out conditions of commercial use.
Check the latest version of FotoTagger Web API on the developer's website.
<?
/*
* This example illustrates how to insert annotated image into your web page
*/
include "../annotations.php";
// creating object
$a = new CAnnotationDisplay();
// turn on links replacement (http, mailto, ..)
$a->flag_replaceLinks(1);
?>
<html>
<title>Display annotations. Example.</title>
<? echo $a->getStyles(); ?>
<? echo $a->getJavascript(); ?>
<body>
This example illustrates how to insert annotated image into your web page.<br>
<?echo $a->getAnnotatedImageFromFile("sample.jpg", "sample.jpg"); ?>
</body>
</html>
<?
/*
* This example illustrates how to draw annotations over image
* requires GD library
* requires TrueType font file
*/
include "../annotations.php";
// configuring
// font size in pixels
$font_size = 10;
// TrueType font file. Should be full path to font from root
$font_file = "c:\\windows\\fonts\\arialn.ttf";
// creating object
$m = new CAnnotationMerge();
// first we need create a copy of sample.jpg to prevent modifiy it
$dest = md5(microtime()).".jpg";
if (!copy("sample.jpg", $dest))
{
echo "failed copy to $dest.";
die;
}
// perform merging
if (($ret = $m->mergedFile($dest, array("font_size" => $font_size,
"font_file" => $font_file
)
)) != $m->ERROR_NONE)
{
// delete temporary file
unlink($dest);
echo "Error merging ($ret): ".$m->getErrorDescription($ret);
die;
}
// send new image to browser
header("Pragma: public");
header("Content-type: image/jpeg");
header("Content-Disposition: attachment; filename=". $dest);
readfile($dest);
// delete temporary file
unlink($dest);
?>
1.4.6-NO