Example #1
0
        $this->path = $path;
        $this->filename = $filename;
    }
    public function getMeta()
    {
        $info = array();
        $size = getimagesize($this->path . $this->filename, $info);
        if (isset($info['APP13'])) {
            $app13 = $info['APP13'];
            $iptcUnhandled = iptcparse($app13);
            $returnIPTCarray = getIPTC($iptcUnhandled);
            print_r($returnIPTCarray);
        }
    }
}
$me = new Metaclass("./", "img.jpg");
$me->getMeta();
function starter()
{
    //getMeta("./samples/","1.jpg");
    getMeta("./", "img.jpg");
    $iptc = array("2#120" => "Hello world", "2#025" => "Your keywords will be placed here", "2#116" => "Thomas Darvik heter jeg");
    $data = "";
    foreach ($iptc as $tag => $string) {
        $tag = substr($tag, 2);
        $data .= IPTCmakeTag(2, $tag, $string);
    }
    $content = iptcembed($data, "./img.jpg");
    $file = fopen("./img.jpg", "wb");
    fwrite($file, $content);
    fclose($file);
Example #2
0
 $extension = explode('.', $filename);
 $extension = strtolower(end($extension));
 $i = 1;
 $pieces = explode('.', $name);
 $filename = $pieces[0];
 if (in_array($extension, $allowed)) {
     if ($file_error === 0) {
         $file_dir = "images/" . $filename . "." . $pieces[1];
         while (file_exists("../images/" . $filename . "." . $pieces[1])) {
             $filename = $name_ext["filename"] . "_" . $i++;
             //$filename = $pieces[0] . "_" . $i++;
         }
         $file_dir = "images/" . $filename . "." . $pieces[1];
         $uploaded[$position] = $file_dir;
         if (move_uploaded_file($file_tmp, "../" . $file_dir)) {
             $metaSystem = new Metaclass($file_dir);
             $currentMeta = $metaSystem->getMeta();
             createThumbnail($filename . "." . $pieces[1]);
             $uploaded[$position] = $file_dir;
         } else {
             $failed[$position] = "[{$filename}] failed to upload.";
         }
     } else {
         $failed[$position] = "[{$filename}] errored with code {$file_error}.";
     }
 } else {
     $failed[$position] = "[{$filename}] file extension '{$extension}' is not allowed.";
 }
 if (!empty($uploaded)) {
     echo "{$filename} has been successfully uploaded!.";
     echo $filename;
Example #3
0
<?php

/*
"title"
"keywords"
"credit"
"creator"
"copyright"
"description"
*/
include "app.php";
$meta = new Metaclass("./samples/", "1.jpg");
$meta->getMeta();
$array = array("title" => "Title of the new image", "description" => "This is a description of the image", "credit" => "CREDIT: Thomas Darvik", "creator" => "CREATOR: Thomas Darvik", "copyright" => "COPYRIGHT: Thomas Darvik", "keywords" => array("Drunk", "Power", "Stuff", "Other tags"));
//$meta->writeMeta($array);