private function makeImage($image_url, $image_date)
 {
     $make_image_size = array();
     $make_image_size[] = array("width" => 100, "hight" => 100);
     $image_file_urls = array();
     // 拡張子を取得
     $path_parts = pathinfo($image_url);
     $image_extension = $path_parts['extension'];
     $image_path = _IMAGE_PATH . $this->RSS_AccountInfo->name;
     if (!file_exists($image_path)) {
         mkdir($image_path, 0777);
     }
     $imageObj = new Image();
     if (!$imageObj->setImage($image_url)) {
         //画像取得失敗
         return array();
     }
     foreach ($make_image_size as $image_size) {
         $image_file_name = $this->RSS_AccountInfo->name . "_" . date("ymd_His", strtotime($image_date)) . "_" . $image_size['width'] . "x" . $image_size['hight'] . "." . $image_extension;
         $output_image_path = $image_path . "/" . $image_file_name;
         $ret = $imageObj->resizeImage($image_size['width'], $image_size['hight'])->output_ImageResource($output_image_path);
         if ($ret) {
             $image_file_urls[] = _IMAGE_URL . $this->RSS_AccountInfo->name . "/" . $image_file_name;
         }
     }
     return $image_file_urls;
 }
Example #2
0
$table_twitter->setClass("table.MenuOption");
$table_twitter->setColumnsStyle("20%;80%");
$img_twitter = new Image();
$img_twitter->setImage("img/Android/hdpi/ic_twitter.png");
$img_twitter->setClass("image.menu");
$lbl_twitter = new Label();
$lbl_twitter->setClass("label.MenuOption");
$lbl_twitter->setCaption("Twitter");
$table_twitter->onTap(twitte());
$table_twitter->addControl($img_twitter, 1, 1, 1, 1, "Center", "Middle");
$table_twitter->addControl($lbl_twitter, 1, 2, 1, 1, "Left", "Middle");
$table_map = new Table();
$table_map->setClass("table.MenuOption");
$table_map->setColumnsStyle("20%;80%");
$img_map = new Image();
$img_map->setImage("img/Android/hdpi/ic_map.png");
$img_map->setClass("image.menu");
$lbl_map = new Label();
$lbl_map->setClass("label.MenuOption");
$lbl_map->setCaption("Map");
$table_map->onTap(map());
$table_map->addControl($img_map, 1, 1, 1, 1, "Center", "Middle");
$table_map->addControl($lbl_map, 1, 2, 1, 1, "Left", "Middle");
$mainTable->addControl($table_home, 2, 1);
$mainTable->addControl($table_facebook, 3, 1);
$mainTable->addControl($table_twitter, 4, 1);
$mainTable->addControl($table_map, 5, 1);
$win->addControl($mainTable);
function Slide()
{
    $token = new InputText(80);
Example #3
0
if (file_exists(PATH_UPLOADS . $tmpName)) {
    $number = 0;
    $tmpName = $filename . '_' . $number . '.' . $fileExtension;
    while (file_exists(PATH_UPLOADS . $tmpName)) {
        $number++;
        $tmpName = $filename . '_' . $number . '.' . $fileExtension;
    }
}
// Move from temporary PHP folder to temporary Bludit folder.
move_uploaded_file($source, PATH_TMP . 'original' . '.' . $fileExtension);
// --- PROFILE PICTURE ---
if ($type == 'profilePicture') {
    // Resize and crop profile image.
    $username = Sanitize::html($_POST['username']);
    $tmpName = $username . '.jpg';
    $Image = new Image();
    $Image->setImage(PATH_TMP . 'original' . '.' . $fileExtension, '200', '200', 'crop');
    $Image->saveImage(PATH_UPLOADS_PROFILES . $tmpName, 100, true);
} else {
    // Generate the thumbnail
    $Image = new Image();
    $Image->setImage(PATH_TMP . 'original' . '.' . $fileExtension, THUMBNAILS_WIDTH, THUMBNAILS_HEIGHT, 'crop');
    $Image->saveImage(PATH_UPLOADS_THUMBNAILS . $tmpName, 100, true);
    // Move the original to the upload folder.
    rename(PATH_TMP . 'original' . '.' . $fileExtension, PATH_UPLOADS . $tmpName);
}
// Remove the Bludit temporary file.
if (file_exists(PATH_TMP . 'original' . '.' . $fileExtension)) {
    unlink(PATH_TMP . 'original' . '.' . $fileExtension);
}
exit(json_encode(array('status' => 0, 'filename' => $tmpName)));
Example #4
0
$input_outcome = new InputNumeric(11);
$input_outcome->setReadOnly(true);
$input_outcome->setClass("label.black");
$label_red = new Label();
$label_red->setClass("label.outcome");
$table_outcome = new Table();
$table_outcome->setColumnsStyle("5dip;50%;50%");
$table_outcome->addControl($label_red, 1, 1, 1, 1, "", "Middle");
$table_outcome->addControl($label_outcome, 1, 2, 1, 1, "Center", "Middle");
$table_outcome->addControl($input_outcome, 1, 3, 1, 1, "Right", "Middle");
$table_second = new Table();
$table_second->setWidth("100%");
$table_second->setHeight("40%");
$table_second->setClass("table.first");
$img_add = new Image();
$img_add->setImage("img/Android/hdpi/plus_circle.png");
$img_add->onTap(movements());
$label_title = new InputText();
$label_title->setReadOnly(true);
$label_title->setClass("label.black");
$table_title_month = new Table();
$table_title_month->addControl($label_title, 1, 1, 1, 1, "Center", "Middle");
$label_income_month = new Label();
$label_income_month->setCaption("Income: ");
$label_income_month->setClass("label.black");
$input1 = new InputText();
$input1->setReadOnly(true);
$input1->setClass("label.black");
$label_green_bis = new Label();
$label_green_bis->setClass("label.income");
$label_red_bis = new Label();
Example #5
0
$table_login->setColumnsStyle("20%;80%");
$table_login->setInvisibleMode("Collapse Space");
$img_login = new Image();
$img_login->setImage("img/Android/hdpi/ic_login.png");
$img_login->setClass("imagemenu");
$lbl_login = new Label();
$lbl_login->setCaption("Login");
$lbl_login->setClass("labelMenuOption");
$table_login->onTap(login());
$table_login->addControl($img_login, 1, 1, 1, 1, "Center", "Middle");
$table_login->addControl($lbl_login, 1, 2, 1, 1, "Left", "Middle");
$table_logout = new Table();
$table_logout->setClass("tableMenuOption");
$table_logout->setColumnsStyle("20%;80%");
$img_logout = new Image();
$img_logout->setImage("img/Android/hdpi/ic_logout.png");
$img_logout->setClass("imagemenu");
$lbl_logout = new Label();
$lbl_logout->setCaption("Logout");
$lbl_logout->setClass("labelMenuOption");
$table_logout->onTap(logout());
$table_logout->addControl($img_logout, 1, 1, 1, 1, "Center", "Middle");
$table_logout->addControl($lbl_logout, 1, 2, 1, 1, "Left", "Middle");
$table_space = new Table();
$table->addControl($table_space, 1, 1);
$table->addControl($table_home, 2, 1);
$table->addControl($table_account, 3, 1);
$table->addControl($table_transactions, 4, 1);
$table->addControl($table_login, 5, 1);
$table->addControl($table_settings, 6, 1);
$table->addControl($table_logout, 7, 1);
Example #6
0
function clickme(){
	echo "Hello !";
}*/
/***
 * Listado de categorias.
 */
$win = new SDPanel();
$win->setCaption("Tasks list");
$table = new Table();
$table->setClass("table.Menu");
$table_home = new Table();
$table_home->setClass("table.MenuOption");
$table_home->setColumnsStyle("20%;80%");
$img_home = new Image();
$img_home->setImage("img/ico_thumb.png");
$img_home->setClass("ImageMenu");
$lbl_home = new Label();
$lbl_home->setClass("LabelMenuOption");
$lbl_home->setCaption("Home");
$table_home->onTap(home());
//$table_home -> addControl($img_home,1,1,1,1,"Center","Middle");
$table_home->addControl($lbl_home, 1, 2, 1, 1, "Left", "Middle");
$table->addControl($table_home, 2, 1);
$win->addControl($table);
$win->Render();
function Slide()
{
    $win->Open("mainThumb");
}
function home()
Example #7
0
<?php

/**
 * Main object.
 * @author Kikapp
 * @version 1.0
 */
$win = new SDPanel();
$win->setCaption("Image control");
$tabMain = new Table();
$img_arrow = new Image();
$img_arrow->setImage("img/Android/hdpi/appicon.png");
$tabMain->addControl($img_arrow, 1, 1);
$win->addControl($tabMain);
Example #8
0
$table_add->setColumnsStyle("20%;80%");
$img_add = new Image();
$img_add->setImage("img/ic_add.png");
$img_add->setClass("image.MenuItem");
$lbl_add = new Label();
$lbl_add->setCaption("Add task");
$lbl_add->setClass("label.MenuItem");
$table_add->onTap(add());
$table_add->addControl($img_add, 1, 1, 1, 1, "Center", "Middle");
$table_add->addControl($lbl_add, 1, 2, 1, 1, "Left", "Middle");
//Deleted button
$table_deleted = new Table();
$table_deleted->setClass("table.MenuItem");
$table_deleted->setColumnsStyle("20%;80%");
$img_deleted = new Image();
$img_deleted->setImage("img/ic_deleted.png");
$img_deleted->setClass("image.MenuItem");
$lbl_deleted = new Label();
$lbl_deleted->setCaption("Done");
$lbl_deleted->setClass("label.MenuItem");
$table_deleted->onTap(openDoneList());
$table_deleted->addControl($img_deleted, 1, 1, 1, 1, "Center", "Middle");
$table_deleted->addControl($lbl_deleted, 1, 2, 1, 1, "Left", "Middle");
//Add controls to menu
$table->addControl($table_header, 1, 1);
$table->addControl($table_home, 2, 1);
$table->addControl($table_deleted, 3, 1);
$table->addControl($table_add, 4, 1);
//Add controls to main screen
$win->addControl($table);
$win->Render();
Example #9
0
<?php

/**
 * Main object.
 * @author Kikapp
 * @version 1.0
 */
$win = new SDPanel();
$win->setCaption("Welcome");
$actionBar = new ActionBar();
$actionBar->setClass("applicationBars");
$mainTable = new Table();
$mainTable->setClass("table.general");
$label = new Label();
$label->setCaption("Welcome to the Global Example!");
$label->setClass("label.Home");
$label2 = new Label();
$label2->setCaption("Use the Slide to open Facebook, Twitter and Map!");
$label2->setClass("label.Home");
$image = new Image();
$image->setImage("img/Android/hdpi/appicon.png");
$mainTable->addControl($label, 2, 1, 1, 1, "Center", "Middle");
$mainTable->addControl($label2, 3, 1, 1, 1, "Center", "Middle");
$mainTable->addControl($image, 4, 1, 1, 1, "Center", "Middle");
$win->addControl($mainTable);
Example #10
0
$fileExtension = pathinfo($filename, PATHINFO_EXTENSION);
$filename = pathinfo($filename, PATHINFO_FILENAME);
$filename = Text::replace(' ', '', $filename);
$filename = Text::replace('_', '', $filename);
if (file_exists(PATH_UPLOADS . $filename . '.' . $fileExtension)) {
    $number = 0;
    $tmpName = $filename . '_' . $number . '.' . $fileExtension;
    while (file_exists(PATH_UPLOADS . $tmpName)) {
        $number++;
        $tmpName = $filename . '_' . $number . '.' . $fileExtension;
    }
}
if (empty($tmpName)) {
    $tmpName = $filename . '.' . $fileExtension;
}
// --- PROFILE PICTURE ---
if ($type == 'profilePicture') {
    // Move to tmp file
    move_uploaded_file($source, PATH_UPLOADS_PROFILES . 'tmp' . '.' . $fileExtension);
    // Resize and crop profile image.
    $username = Sanitize::html($_POST['username']);
    $tmpName = $username . '.jpg';
    $Image = new Image();
    $Image->setImage(PATH_UPLOADS_PROFILES . 'tmp' . '.' . $fileExtension, '200', '200', 'crop');
    $Image->saveImage(PATH_UPLOADS_PROFILES . $tmpName, 100, true);
    // Remove tmp file
    unlink(PATH_UPLOADS_PROFILES . 'tmp' . '.' . $fileExtension);
} else {
    move_uploaded_file($source, PATH_UPLOADS . $tmpName);
}
exit(json_encode(array('status' => 0, 'filename' => $tmpName)));
Example #11
0
$table = new Table();
$table->setClass("table.Menu");
$list = new Grid();
$list->addData(load_grid());
$list->setEmptyGridText("Your list is empty");
$list->addSearch($name);
$table_grid = new Table();
$table_grid->setClass("table.DetailMain");
//Items definition
$id = new InputNumeric();
$name = new InputText();
$name->setClass("input.Title");
$date = new InputDate();
$date->setClass("input.Common");
$statusIcon = new Image();
$statusIcon->setImage("img/tick.png");
$statusIcon->setClass("image.ListIcon");
$statusIcon->onTap(changeToDone());
$table_list = new Table();
$table_list->addControl($name, 1, 1, 1, 6, "Left", "Middle");
$table_list->addControl($date, 1, 2, 1, 2, "Left", "Middle");
$table_list->addControl($statusIcon, 1, 3, 1, 1, "Middle", "Middle");
$table_grid->addControl($table_list, 1, 1);
$table_grid->onTap(detail());
//Add controls to main screen
$list->addControl($table_grid);
$table->addControl($list);
$win->addControl($table);
$win->Render();
function load_grid()
{
Example #12
0
$win->addControl($bar);
//Items List definition
$table = new Table();
$table->setClass("table.Menu");
$list = new Grid();
$list->addData(load_grid());
$list->setEmptyGridText("Your list is empty");
$list->addSearch($name);
$table_grid = new Table();
$table_grid->setClass("table.DetailMain");
//Items definition
$id = new InputNumeric();
$name = new InputText();
$name->setClass("input.Title");
$deleteIcon = new Image();
$deleteIcon->setImage("img/deleteTask.png");
$deleteIcon->setClass("image.ListIcon");
$deleteIcon->onTap(remove());
$table_list = new Table();
$table_list->addControl($name, 1, 1, 1, 6, "Left", "Middle");
$table_list->addControl($deleteIcon, 1, 2, 1, 1, "Middle", "Middle");
$table_grid->addControl($table_list, 1, 1);
$table_grid->onTap(detail());
//Add controls to main screen
$list->addControl($table_grid);
$table->addControl($list);
$win->addControl($table);
$win->Render();
function load_grid()
{
    //Make JSON request
Example #13
0
<?php

require_once "../conf.php";
require_once _TWITTER_CLASS_PATH . "Image.php";
if (!isset($_REQUEST['image']) or !strlen($_REQUEST['image'])) {
    exit;
}
header('Content-Type: image/jpeg');
$imageObj = new Image();
$imageObj->setImage($_REQUEST['image']);
$imageObj->resizeImage(200, 200)->output_ImageResource('/home/ainyan/blog.graph.jp/public_html/img/oretekigame/oretekigame_151119_132925_200x200.jpg');
Example #14
0
$table_mycart->setClass("tableMenuOption");
$table_mycart->setColumnsStyle("20%;80%");
$img_mycart = new Image();
$img_mycart->setImage("img/ic_cart.png");
$img_mycart->setClass("imagemenu");
$lbl_cart = new Label();
$lbl_cart->setCaption("My Cart");
$lbl_cart->setClass("labelMenuOption");
$table_mycart->onTap(mycart());
$table_mycart->addControl($img_mycart, 1, 1, 1, 1, "Center", "Middle");
$table_mycart->addControl($lbl_cart, 1, 2, 1, 1, "Left", "Middle");
$table_logout = new Table();
$table_logout->setClass("tableMenuOption");
$table_logout->setColumnsStyle("20%;80%");
$img_logout = new Image();
$img_logout->setImage("img/ic_logout.png");
$img_logout->setClass("imagemenu");
$lbl_logout = new Label();
$lbl_logout->setCaption("Logout");
$lbl_logout->setClass("labelMenuOption");
$table_logout->onTap(logout());
$table_logout->addControl($img_logout, 1, 1, 1, 1, "Center", "Middle");
$table_logout->addControl($lbl_logout, 1, 2, 1, 1, "Left", "Middle");
//Add controls to menu
$table->addControl($table_header, 1, 1);
$table->addControl($table_home, 2, 1);
$table->addControl($table_products, 3, 1);
$table->addControl($table_cat, 4, 1);
$table->addControl($table_login, 5, 1);
$table->addControl($table_UserData, 6, 1);
$table->addControl($table_mycart, 7, 1);
Example #15
0
$source = $_FILES['files']['tmp_name'][0];
// Filename
$filename = Text::lowercase($_FILES['files']['name'][0]);
$fileExtension = pathinfo($filename, PATHINFO_EXTENSION);
$filename = pathinfo($filename, PATHINFO_FILENAME);
$filename = Text::replace(' ', '', $filename);
$filename = Text::replace('_', '', $filename);
if (file_exists(PATH_UPLOADS . $filename . '.' . $fileExtension)) {
    $number = 0;
    $tmpName = $filename . '_' . $number . '.' . $fileExtension;
    while (file_exists(PATH_UPLOADS . $tmpName)) {
        $number++;
        $tmpName = $filename . '_' . $number . '.' . $fileExtension;
    }
}
if (empty($tmpName)) {
    $tmpName = $filename . '.' . $fileExtension;
}
// --- PROFILE PICTURE ---
if ($type == 'profilePicture') {
    $username = Sanitize::html($_POST['username']);
    $tmpName = $username . '.jpg';
    move_uploaded_file($source, PATH_UPLOADS_PROFILES . $tmpName);
    // Resize and crop profile image.
    $Image = new Image();
    $Image->setImage(PATH_UPLOADS_PROFILES . $tmpName, '200', '200', 'crop');
    $Image->saveImage(PATH_UPLOADS_PROFILES . $tmpName, 100, true);
} else {
    move_uploaded_file($source, PATH_UPLOADS . $tmpName);
}
exit(json_encode(array('status' => 0, 'filename' => $tmpName)));
Example #16
0
 /**
  * Applies the watermark to the given image.
  *
  * @param  Image  $image The image where apply the watermark.
  * @return Image         The resulting watermarked Image, so you can
  *                       do $watermark->apply($image)->generate().
  */
 public function apply(Image $image)
 {
     $metadata = $image->getMetadata();
     $this->calculateSize($metadata);
     list($x, $y) = $this->calculatePosition($metadata);
     $resource = $this->imagecreate($metadata['width'], $metadata['height']);
     // @codingStandardsIgnoreStart
     imagecopyresampled($resource, $image->getImage(), 0, 0, 0, 0, $metadata['width'], $metadata['height'], $metadata['width'], $metadata['height']);
     // @codingStandardsIgnoreEnd
     imagealphablending($resource, true);
     imagesavealpha($resource, false);
     // @codingStandardsIgnoreStart
     imagecopy($resource, $this->image, $x, $y, 0, 0, $this->width, $this->height);
     // @codingStandardsIgnoreEnd
     $image->setImage($resource);
     return $image;
 }