application: the_name
version: 1
runtime: php55
api_version: 1
threadsafe: yes
handlers:
- url: /favicon\.ico
static_files: favicon.ico
upload: favicon\.ico
- url: /009\.jpg
static_files: 009.jpg
upload: 009\.jpg
application_readable: true
- url: /RosewoodStdRegular\.otf
static_files: RosewoodStdRegular.otf
upload: RosewoodStdRegular\.otf
mime_type: application/x-font-otf
- url: /arial\.ttf
static_files: arial.ttf
upload: arial\.ttf
mime_type: application/x-font-ttf
- url: .*
script: main.php
<?php
try {
$img = new Imagick("009.jpg");
$img->setImageCompressionQuality(100);
//ADD TEXT
$text = array(
'width' => 300,
'height'=> 80,
'x' => 420,
'y' => 160,
'font' => 'arial.ttf',
'color' => 'black',
'value' => "Coucou"
);
$addText = new Imagick();
$addText->setBackgroundColor("transparent");
$addText->setFont($text['font']);
$addText->newPseudoImage($text['width'],$text['height'], "Caption:".$text['value'] );
$addText->colorizeImage($text['color'],1);
$img->compositeImage($addText, Imagick::COMPOSITE_OVER, $text['x'], $text['y']);
$img->setImageFormat('jpg');
//header('Content-Type: image/jpg');
//echo $img;
} catch (Exception $e) {
echo 'Caught exception: ', $e->getMessage(), "\n";
}
Caught exception: The given font is not found in the ImageMagick configuration and the file (app_path/1.388444744529109221/arial.ttf) is not accessible
application: image-generator-1124version: 1runtime: php55api_version: 1threadsafe: yes
handlers:- url: /favicon\.ico static_files: favicon.ico upload: favicon\.ico
- url: /009\.jpg static_files: 009.jpg upload: 009\.jpg application_readable: true
- url: /arial\.ttf static_files: arial.ttf upload: arial\.ttf mime_type: application/x-font-truetype application_readable: true
- url: .* script: main.phpArray
(
[0] => .
[1] => ..
[2] => 009.jpg
[3] => app.yaml
[4] => arial.ttf
[5] => main.php
[6] => php.ini
)