added missing module fixer and updated imagecache_actions

This commit is contained in:
Bachir Soussi Chiadmi
2018-03-21 17:06:08 +01:00
parent 3f7e130321
commit 0bcc558ed5
83 changed files with 6386 additions and 2517 deletions

View File

@@ -0,0 +1,36 @@
Komika font by APOSTROPHIC LABS:
http://moorstation.org/typoasis/designers/lab/index.htm.
Below the license as was packaged with the font download:
Here is the "Read Me" from the original http://www.apostrophiclab.com website:
Archived here: http://web.archive.org/web/20030408055445/www.hardcovermedia.com/lab/Pages/info.html
and here: http://apostrophiclab.pedroreina.net/info.html
-----------
Apostrophic Laboratories does not collect or relay any personal information about its visitors.
Apostrophic Laboratories is not affiliated with the company that provides its web hosting service.
Apostrophic Laboratories is not affiliated with any third party advertising service. This lab will always be advertisement-free to maintain the spirit and integrity of freedom of information that the world wide web was intended to represent.
The fonts on this site are freeware and can be used as they are in any context without permission from Apostrophic Laboratories, except to produce material that is racist, criminal and/or illegal in nature. It is prohibited to modify any Apostrophic Laboratories font(s) for repackaging and/or re-release without an express written authorization by the designer(s) of the font(s) or Apostrophic Laboratories. Under no circumstance shall any Apostrophic Laboratories design or font design be sold or purchased. Email info@apostrophiclab.com if you want more information.
The Apostrophic Laboratories site and its contents are the property of Apostrophic Laboratories and the contents' creators. It is prohibited to use the graphic designs shown on this site or any of the site's elements without obtaining written authorization from the designer(s) and/or developer(s) of the content in question. Email info@apostrophiclab.com if you want more information.
Read everything written by Kurt Vonnegut.
Hear everything written by Mozart.
Live every day like it is your first.
Smell the flowers.
Touch the faces of babies.
Run in the rain.
Eat pop corn.
The following constitutes the different methods of contacting Apostrophic Laboratories.
Web: http://www.apostrophiclab.com
Email: info@apostrophiclab.com
For individual designer email addresses, click here.
Address: Apostrophic Laboratories, 343 Kingswood Road, Toronto, Ontario, Canada M4E 3N8

View File

@@ -0,0 +1,24 @@
Blokletters fonts by Lefly Fonts: http://lefly.vepar.nl/ under the following
license:
You are free:
to Share — to copy, distribute and transmit the work
to Remix — to adapt the work
Under the following conditions:
Attribution — You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).
Share Alike — If you alter, transform, or build upon this work, you may distribute the resulting work only under the same or similar license to this one.
With the understanding that:
Waiver — Any of the above conditions can be waived if you get permission from the copyright holder.
Other Rights — In no way are any of the following rights affected by the license:
- Your fair dealing or fair use rights;
- The author's moral rights;
- Rights other persons may have either in the work itself or in how the work is used, such as publicity or privacy rights.
Notice — For any reuse or distribution, you must make clear to others the license terms of this work. The best way to do this is with a link to this web page.

View File

@@ -0,0 +1,93 @@
Copyright (c) 2011, Vernon Adams (vern@newtypography.co.uk),
with Reserved Font Name Pacifico.
This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
-----------------------------------------------------------
SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007
-----------------------------------------------------------
PREAMBLE
The goals of the Open Font License (OFL) are to stimulate worldwide
development of collaborative font projects, to support the font creation
efforts of academic and linguistic communities, and to provide a free and
open framework in which fonts may be shared and improved in partnership
with others.
The OFL allows the licensed fonts to be used, studied, modified and
redistributed freely as long as they are not sold by themselves. The
fonts, including any derivative works, can be bundled, embedded,
redistributed and/or sold with any software provided that any reserved
names are not used by derivative works. The fonts and derivatives,
however, cannot be released under any other type of license. The
requirement for fonts to remain under this license does not apply
to any document created using the fonts or their derivatives.
DEFINITIONS
"Font Software" refers to the set of files released by the Copyright
Holder(s) under this license and clearly marked as such. This may
include source files, build scripts and documentation.
"Reserved Font Name" refers to any names specified as such after the
copyright statement(s).
"Original Version" refers to the collection of Font Software components as
distributed by the Copyright Holder(s).
"Modified Version" refers to any derivative made by adding to, deleting,
or substituting -- in part or in whole -- any of the components of the
Original Version, by changing formats or by porting the Font Software to a
new environment.
"Author" refers to any designer, engineer, programmer, technical
writer or other person who contributed to the Font Software.
PERMISSION & CONDITIONS
Permission is hereby granted, free of charge, to any person obtaining
a copy of the Font Software, to use, study, copy, merge, embed, modify,
redistribute, and sell modified and unmodified copies of the Font
Software, subject to the following conditions:
1) Neither the Font Software nor any of its individual components,
in Original or Modified Versions, may be sold by itself.
2) Original or Modified Versions of the Font Software may be bundled,
redistributed and/or sold with any software, provided that each copy
contains the above copyright notice and this license. These can be
included either as stand-alone text files, human-readable headers or
in the appropriate machine-readable metadata fields within text or
binary files as long as those fields can be easily viewed by the user.
3) No Modified Version of the Font Software may use the Reserved Font
Name(s) unless explicit written permission is granted by the corresponding
Copyright Holder. This restriction only applies to the primary font name as
presented to the users.
4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font
Software shall not be used to promote, endorse or advertise any
Modified Version, except to acknowledge the contribution(s) of the
Copyright Holder(s) and the Author(s) or with their explicit written
permission.
5) The Font Software, modified or unmodified, in part or in whole,
must be distributed entirely under this license, and must not be
distributed under any other license. The requirement for fonts to
remain under this license does not apply to any document created
using the Font Software.
TERMINATION
This license becomes null and void if any of the above conditions are
not met.
DISCLAIMER
THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE
COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE.

View File

@@ -2,7 +2,7 @@ README
------
README for the Image effect text module.
Author Erwin Derksen (fietserwin: http://drupal.org/user/750928)
Author Erwin Derksen (fietserwin: https://drupal.org/user/750928)
Dependencies
@@ -12,10 +12,10 @@ Hard dependencies:
- Image (Drupal core).
Soft dependencies/recommended modules:
- Imagemagick (preferred toolkit, http://drupal.org/project/imagemagick).
- Imagemagick (preferred toolkit, https://drupal.org/project/imagemagick).
- PHP filter (Drupal core, if yuo want to use PHP to create the text to render).
- System stream wrapper (http://drupal.org/project/system_stream_wrapper)
- Remote stream wrapper (http://drupal.org/project/remote_stream_wrapper)
- System stream wrapper (https://drupal.org/project/system_stream_wrapper)
- Remote stream wrapper (https://drupal.org/project/remote_stream_wrapper)
The latter 2 provide additional stream wrappers. Especially the system stream
wrapper is very handy as it provides, among others, a module:// and theme://
wrapper.
@@ -45,9 +45,12 @@ More information about the effect data options
Font
----
You have to supply the font file to use. The font type supported depend on the
toolkit in use, but at least ttf files will always work. This option accepts
either:
This module comes with some free fonts so you can easily test this effect.
Please read their respective licences.
For real use, you normally want to use your own font as dictated by the website
design. The font types supported depend on the toolkit in use, but at least ttf
files will always work. This option accepts either:
- 1 of the (enabled) scheme's:
* public://
* private:// Preferred for site specific masks, overlays, etc, that do not
@@ -59,13 +62,17 @@ either:
* theme:// idem.
* profile:// idem.
* library:// idem.
- A relative (to the current directory, probably Drupal root) or absolute path.
- A relative path (relative to the current directory, probably Drupal root).
- An absolute path.
- A system or toolkit font specification. E.g. on my Windows system 'arial.ttf'
worked with both GD and Imagemagick. A warning will be issued but that may be
ignored when it works as expected.
Text position
-------------
The text position defines the point in the image where you want to place (align)
your text. It starts at the top left corner of the image with postion 0,0 and
your text. It starts at the top left corner of the image with position 0,0 and
the positive directions are to the right and down.
The definition of the vertical position differs per toolkit. For GD it is the
@@ -89,49 +96,65 @@ for this yourself.
Rotation
--------
The text can be rotated before being overlaid on the image. The vlaue is in
degrees, so 90 degrees is straight down. Positive values are rotated clockwise,
The text can be rotated before being overlaid on the image. The value is in
degrees. Positive values are rotated clockwise, So 90 degrees is straight down.
negative values counter clockwise.
In Imagemagick the text is rotated around the text position. Thus centered text
is rotated around its own center. GD, on the other hand, always rotates around
the left bottom (baseline) position, regardless the text alignment. Using
the left bottom (baseline) position, regardless the text alignment. So using
rotation with a non default alignment (left bottom) will give surprising
results.
Text source
-----------
Note: this module is not build to handle multi line texts. Not when the text
contains new lines and/or carriage returns, and not to split a given text over
multiple lines given an available width. Using "\n" in GD seems to work though.
The text to place on the image may come from different sources:
- Static: the text to place on the image is static and is defined in the image
effect data. Use this e.g. for a fixed copyright notice.
- Text (with token replacement): the text to place on the image has to be
entered on the image effect form. Use this e.g. for a copyright notice.
notes:
* Token replacement: you can use all global tokens, the file tokens, and
tokens from entities referring to the image via an image field. Example: if
you know that the image style is only used for article nodes, you can use
[node:field-image:alt] to get the alt text of the image. Note: this specific
example requires the entity_token module.
* New lines: you can add a new line by adding \n to your text. To get a
literal \n, use \\n.
- PHP: the text to place on the image comes from a piece of PHP code that should
return the text to place on the image. Only users with the 'use PHP for
settings' permission are allowed to use this source. This permission and the
evaluation of the PHP code come from the PHP filter module which is part of
Drupal core and thus needs to be enabled, also during image generation.
- To alleviate the need to enable the PHP filter module, 2 commonly used sources
for dynamic texts are directly available without any coding, namely the alt
and title properties of the image field linked to the image at hand. Note that
multiple image fields, possibly in different languages, may be referring to
the image that is being processed. This module will take the first image field
it finds to extract the alt and title. If the field in itself is multi
lingual, thus not a synced field, the current language will be taken, which is
the language of the user that happens to request this styled image first.
To add new lines to your text add them literally to the string you return,
normally by using "\n" in your PHP code.
- Image Alt or Title: to alleviate the need to enable the PHP filter module, 2
commonly used sources for dynamic texts are directly available without any
coding: the alt and title properties of an image field linked to the image at
hand.
Notes:
- When using token replacement or the image alt or title, multiple image fields,
possibly in different languages, may be referring to the image that is being
processed. This module will take the first image field it finds to extract the
alt and title. If the field in itself is multi-lingual, thus not a synced
field, the current language will be taken, which is the language of the user
that happens to request this image derivative first.
- This module will not automatically break text based on available space.
- Due to the way that GD text box positioning works it is quite difficult to
correctly position multiple lines of text with GD. If you have a working
solution please post a patch. (Probably involves exploding the text in
separate lines and then positioning each line separately.)
PHP snippets to determine the text
----------------------------------
Given the correct permission, you can write your own PHP snippet to compute the
text to display. To ease this task, this module makes some information regarding
the image being processed available in 2 variables: $image and $image_context.
These variables are readily available in your snippet.
the image being processed available in a number of variables: $image,
$image_context, $image_style, and $image_effect_id. These variables are readily
available in your snippet.
$image is an associative array containing:
$image is an object containing the following properties:
- source: string, the source of the image, e.g. public://photo.jpg
- info: array, example data:
- width (int) 180
@@ -153,7 +176,7 @@ $image_context is an associative array containing:
- HEX (string) 000000
- alpha (string) 100
- angle (string) 0
- fontfile (string:10) lhandw.ttf
- fontfile (string:46) module://image_effects_text/Komika_display.ttf
- text_source (string) text
- text (string) Hello World!
- php (string) return 'Hello World!'
@@ -192,6 +215,18 @@ $image_context is an associative array containing:
- title (string) ...
- ...
$image_style is an associative array containing the current image style being
processed. It ocntians a.o.:
- isid: the unique image style id
- name: machine name.
- label: Human readable name.
- effects: An array with the effects of this image style, ordered in the way
they should be applied.
$image_effect_id is an int containng the unique id of the current image effect
being applied. This can be used to look the current image effect up in the
$image_style array.
Of course there are many other possible useful globals. Think of:
- base_url
- base_path
@@ -205,20 +240,30 @@ Using these information you can access entity data as follows:
Specific case (1 entity, of known entity_type, referring to the image):
<?php
if (!$image_context['entity']) {
return 'No referring entity';
}
$entity_type = 'node';
$field_name = 'my_field';
$entity = $image_context['entity'];
$field = field_get_items($entity_type, $entity, $field_name);
if ($field) {
return isset($field[0]['value']) ? $field[0]['value'] : 'No field value';
}
?>
Or the more general case (not knowing the referring type, or multiple entities
that may be referring to the image):
<?php
if (!$image_context['referring_entities']) {
return 'No referring entities';
}
$referring_entities = $image_context['referring_entities'];
foreach ($referring_entities as $field_name => $field_referring_entities) {
foreach ($field_referring_entities as $entity_type => $entities) {
foreach ($entities as $entity_id => $entity) {
$field = field_get_items($entity_type, $entity, $field_name);
// ...
}
}
}
@@ -232,7 +277,7 @@ TODO
do the same?
- Language and alt/title: what if the first user to pass by and that generates
the image is in a language that has no alt/title?
- Newlines: seem to work in GD, not in Imagemagick.
- Check for existence of imagettftext() and fail properly.
To quote http://www.imagemagick.org/Usage/text/#draw:
As of IM version 6.2.4, the "-draw text" operation no longer understands the use

View File

@@ -10,7 +10,7 @@
* Only tuned for Ubuntu so far. I've been unable do find ubiquitous tools that
* provide useful font listings.'
*/
function image_effects_text_help_inc($path, $arg) {
function image_effects_text_help_inc(/*$path, $arg*/) {
$output = "<p>
For text rendering to work on a server, we <em>must</em>
know the system path to the font <em>file</em>, not just the name.
@@ -39,7 +39,7 @@ function image_effects_text_help_inc($path, $arg) {
}
/**
* Builds the form structure for the overlay text image effect.
* Image effect form callback for the text effect.
*
* Note that this is not a complete form, it only contains the portion of the
* form for configuring the effect options. Therefore it does not not need to
@@ -51,36 +51,132 @@ function image_effects_text_help_inc($path, $arg) {
* @return array
* The form definition for this effect.
*/
function image_effects_text_form_inc($data) {
function image_effects_text_form_inc(array $data) {
// Use of functions imagecache_file_...() creates a dependency on file utility.inc.
module_load_include('inc', 'imagecache_actions', 'utility');
// Use of function imagecache_rgb_form() creates a dependency on file utility-color.inc.
module_load_include('inc', 'imagecache_actions', 'utility-color');
// Note: we also need to check for the existence of the module: admin has
// all rights, so user_acccess(...) returns TRUE even if the module is not
// all rights, so user_access(...) returns TRUE even if the module is not
// enabled and the permission does not exist.
// A user without the 'use PHP for settings' permission (defined by the core
// PHP filter module) may not:
// - Select the 'PHP code' text source option if it is currently not selected.
// - Change the 'PHP code' textarea.
$allow_dynamic = user_access('use PHP for settings') && module_exists('php');
$allow_php = module_exists('php') && user_access('use PHP for settings');
$defaults = array(
'size' => 12,
'angle' => 0,
'text_source' => 'text',
'text' => t('Hello World!'),
'php' => 'if (!$image_context[\'entity\']) {
return \'' . t('No referring entity') . '\';
}
$entity_type = \'node\';
$field_name = \'my_field\';
$entity = $image_context[\'entity\'];
$field = field_get_items($entity_type, $entity, $field_name);
if ($field) {
return isset($field[0][\'value\']) ? $field[0][\'value\'] : \'' . t('No field value') . '\';
}
',
'text_case' => 'none',
'fontfile' => drupal_get_path('module', 'image_effects_text') . '/Komika_display.ttf',
'size' => 50,
'RGB' => array('HEX' => '#000000'),
'alpha' => 100,
'xpos' => '0',
'ypos' => '0',
'halign' => 'left',
'valign' => 'bottom',
'RGB' => array('HEX' => '#000000'),
'alpha' => 100,
'fontfile' => 'lhandw.ttf',
'text_source' => 'text',
'text' => 'Hello World!',
'php' => 'return \'Hello World!\'',
'valign' => 'top',
'angle' => 0,
);
$data += $defaults;
$tokens = token_info();
$tokens = array_keys($tokens['types']);
$form = array(
'text_help' => array(
'#type' => 'item',
'#title' => t('Text'),
'#description' => t('<p>Select the source of the text:</p>
<ul>
<li><strong>Image alt</strong>: the alt text of an image field referring to this image is taken.</li>
<li><strong>Image title</strong>: the title text of an image field referring to this image is taken.</li>
<li><strong>Text (with token replacement)</strong>: A text with optional token replacement. Line breaks can be inserted with \n (\\\\n for a literal \n). You can define the text in the text field below the drop down.</li>
<li><strong>PHP code</strong>: a piece of PHP code that returns the text to display. You can define the PHP code in the text area below the drop down. You will need the \'%use_php\' permission, defined by the \'PHP filter\' module.</li>
</ul>
<p>See the help in README.txt for an extensive explanation of the possibilities.</p>',
array('%use_php' => t('Use PHP for settings'))),
),
'text_source' => array(
'#type' => 'select',
'#title' => t('Text source'),
'#default_value' => $data['text_source'],
'#options' => array(
'alt' => t('Image alt'),
'title' => t('Image title'),
'text' => t('Text (with token replacement)'),
'php' => t('PHP code'),
),
),
'text' => array(
'#type' => 'textfield',
'#title' => t('Text'),
'#default_value' => $data['text'],
'#states' => array(
'visible' => array(':input[name="data[text_source]"]' => array('value' => 'text')),
),
),
'token_help' => array(
'#type' => 'fieldset',
'#title' => t('Token replacement patterns'),
'#collapsible' => TRUE,
'#collapsed' => TRUE,
'tree' => array(
'#theme' => 'token_tree',
'#token_types' => $tokens,
),
'token_module_notice' => array(
'#markup' => !module_exists('token') ? t('You might want to enable the token module to view token replacement patterns.') : '',
),
'entity_token_module_notice' => array(
'#markup' => !module_exists('entity_token') ? t('You might want to enable the entity_token module to get token options for all entities and field properties.') : '',
),
'#states' => array(
'visible' => array(':input[name="data[text_source]"]' => array('value' => 'text')),
),
),
'php' => array(
'#type' => 'textarea',
'#rows' => 12,
'#title' => t('PHP code'),
'#default_value' => $data['php'],
'#disabled' => !$allow_php,
'#states' => array(
'visible' => array(':input[name="data[text_source]"]' => array('value' => 'php')),
),
'#wysiwyg' => FALSE,
),
'text_case' => array(
'#title' => t('Capitalization'),
'#type' => 'select',
'#options' => array(
'none' => t('No transform'),
'upper' => t('Upper case'),
'lower' => t('Lower case'),
'ucfirst' => t('Capitalize first letter'),
'ucwords' => t('Capitalize each word'),
),
'#default_value' => $data['text_case'],
'#description' => t('Defines if and how to transform the case of the text to render.'),
),
'fontfile' => array(
'#type' => 'textfield',
'#title' => t('Font file name'),
'#default_value' => $data['fontfile'],
'#description' => imagecache_actions_file_field_description(),
'#element_validate' => array('image_effects_text_validate_font'),
'#size' => 80,
),
'size' => array(
'#type' => 'textfield',
'#title' => t('Font size'),
@@ -88,6 +184,14 @@ function image_effects_text_form_inc($data) {
'#description' => t('The font size in points. Only in GD1 this is in pixels.'),
'#size' => 3,
),
'RGB' => imagecache_rgb_form($data['RGB']),
'alpha' => array(
'#type' => 'textfield',
'#title' => t('Opacity'),
'#default_value' => $data['alpha'],
'#size' => 3,
'#description' => t('Opacity: 1-100.'),
),
'xpos' => array(
'#type' => 'textfield',
'#title' => t('X offset'),
@@ -107,22 +211,22 @@ function image_effects_text_form_inc($data) {
'#title' => t('Horizontal alignment'),
'#default_value' => $data['halign'],
'#description' => t('The horizontal alignment of the text around the given %xpos.', array('%xpos' => t('X offset'))),
'#options' => array('left' => t('Left'), 'center' => t('Center'), 'right' => t('Right')),
'#options' => array(
'left' => t('Left'),
'center' => t('Center'),
'right' => t('Right')
),
),
'valign' => array(
'#type' => 'select',
'#title' => t('Vertical alignment'),
'#default_value' => $data['valign'],
'#description' => t('The vertical alignment of the text around the given %ypos.', array('%ypos' => t('Y offset'))),
'#options' => array('top' => t('Top'), 'center' => t('Center'), 'bottom' => t('Bottom')),
),
'RGB' => imagecache_rgb_form($data['RGB']),
'alpha' => array(
'#type' => 'textfield',
'#title' => t('Opacity'),
'#default_value' => $data['alpha'] ? $data['alpha'] : 100,
'#size' => 3,
'#description' => t('Opacity: 1-100.'),
'#options' => array(
'top' => t('Top'),
'center' => t('Center'),
'bottom' => t('Bottom')
),
),
'angle' => array(
'#type' => 'textfield',
@@ -131,52 +235,8 @@ function image_effects_text_form_inc($data) {
'#description' => t('Angle: The angle in degrees, with 0 degrees being left-to-right reading text. Higher values represent a counter-clockwise rotation. For example, a value of 90 would result in bottom-to-top reading text.'),
'#size' => 3,
),
'fontfile' => array(
'#type' => 'textfield',
'#title' => t('Font file name'),
'#default_value' => $data['fontfile'],
'#description' => imagecache_actions_file_field_description(),
'#element_validate' => array('imagecache_actions_validate_file'),
),
'text_help' => array(
'#type' => 'item',
'#title' => t('Text'),
'#description' => t('<p>Select the source of the text:</p>
<ul>
<li><strong>Image alt</strong>: the alt text of an image field referring to this image is taken.</li>
<li><strong>Image title</strong>: the title text of an image field referring to this image is taken.</li>
<li><strong>Static text</strong>: a text that will be the same for each image, e.g. a copyright message. You can define the text in the text field below the drop down.</li>
<li><strong>PHP code</strong>: a piece of PHP code that returns the text to display. You can define the PHP code in the text area below the drop down. You will need the \'%use_php\' permission, defined by the \'PHP filter\' module.</li>
</ul>
<p>See the help for an extensive explanation of the possibilities.</p>',
array('%use_php' => t('Use PHP for settings'))),
),
'text_source' => array(
'#type' => 'select',
'#title' => t('Text source'),
'#default_value' => $data['text_source'],
'#options' => array('alt' => t('Image alt'), 'title' => t('Image title'), 'text' => t('Static text'), 'php' => t('PHP code')),
),
'text' => array(
'#type' => 'textfield',
'#title' => t('Text'),
'#default_value' => $data['text'],
'#states' => array(
'visible' => array(':input[name="data[text_source]"]' => array('value' => 'text')),
),
),
'php' => array(
'#type' => 'textarea',
'#rows' => 5,
'#title' => t('PHP code'),
'#default_value' => $data['php'],
'#disabled' => !$allow_dynamic,
'#states' => array(
'visible' => array(':input[name="data[text_source]"]' => array('value' => 'php')),
),
),
);
if (!$allow_dynamic && $data['text_source'] !== 'php') {
if (!$allow_php && $data['text_source'] !== 'php') {
unset($form['text_fieldset']['text_source']['#options']['php']);
}
@@ -188,7 +248,7 @@ function image_effects_text_form_inc($data) {
* Element validation callback for the effect form.
* @see http://api.drupal.org/api/drupal/developer--topics--forms_api_reference.html/7#element_validate
*/
function image_effects_text_form_validate($element, &$form_state, $form) {
function image_effects_text_form_validate(array $element/*, &$form_state, $form*/) {
if (!is_numeric($element['size']['#value']) || $element['size']['#value'] <= 0) {
form_error($element['size'], t('%field must be a positive number.', array('%field' => t('Font size'))));
}
@@ -201,17 +261,30 @@ function image_effects_text_form_validate($element, &$form_state, $form) {
}
/**
* Implementation of theme_hook() for text image effect.
* Validates that the file as specified in the element exists and is readable.
*
* This is a Form API #element_validate callback.
*
* @param array $element
*/
function image_effects_text_validate_font(array &$element/*, &$form_status*/) {
if (!imagecache_actions_find_file($element['#value'])) {
drupal_set_message(t("Unable to find the font file '%file'. Please check the path. You can ignore this waning, if the font refers to a system or toolkit font, and the text shows correctly.", array('%file' => $element['#value'])), 'warning');
}
}
/**
* Implements theme_hook() for the text effect summary.
*
* @param array $variables
* An associative array containing:
* - data: The current configuration for this resize effect.
* - data: The current configuration for this image effect.
*
* @return string
* The HTML for the summary of a text image effect.
* The HTML for the summary of this image effect.
* @ingroup themeable
*/
function theme_image_effects_text_summary($variables) {
function theme_image_effects_text_summary(array $variables) {
$data = $variables['data'];
switch ($data['text_source']) {
case 'alt':
@@ -226,27 +299,23 @@ function theme_image_effects_text_summary($variables) {
case 'php':
$text = 'PHP code';
break;
default:
$text = '';
break;
}
return 'Text: ' . $text . '; Position: ' . $data['xpos'] . ',' . $data['ypos'] . '; Alignment: ' . $data['halign'] . ',' . $data['valign'];
}
/**
* (Real implementation of) Image effect callback; Overlay text on an image
* resource.
*
* @param object $image
* An image object returned by image_load().
* Image effect callback for the text effect.
*
* @param stdClass $image
* @param array $data
* An array of attributes to use when performing the resize effect with the
* following items:
* - "width": An integer representing the desired width in pixels.
* - "height": An integer representing the desired height in pixels.
*
* @return boolean
* true on success, false on failure to apply the effect.
* true on success, false otherwise.
*/
function image_effects_text_effect_inc($image, $data) {
function image_effects_text_effect_inc(stdClass $image, array $data) {
// Use of imagecache_actions_hex2rgba() ,the imagecache_file_...() functions,
// and imagecache_actions_get_image_context() create a dependency on
// file utility.inc.
@@ -256,79 +325,82 @@ function image_effects_text_effect_inc($image, $data) {
// Start with a straight copy.
$params = $data;
// Get the text to overlay.
$params['text'] = image_effects_text_get_text($image, $params);
if (empty($params['text'])) {
// No text to overlay. This is a situation that can be expected with token
// replacement, or custom PHP code. Return immediately with success.
return TRUE;
}
// Find out where the font file is located and if it is readable.
$params['fontpath'] = imagecache_actions_find_file($data['fontfile']);
if ($params['fontpath'] === FALSE) {
drupal_set_message(t("Failed to locate the requested font %fontfile. Cannot overlay text onto image.", array('%fontfile' => $data['fontfile'])), 'error');
return FALSE;
// Pass the font on and let's hope that the toolkit knows where to find it.
// We did warn on the effect form.
$params['fontpath'] = $data['fontfile'];
}
// Get the text to overlay.
$params['text'] = image_effects_text_get_text($image, $params);
if ($params['text'] === FALSE) {
drupal_set_message(t("Failed to evaluate text (is the 'PHP Filter' module enabled?). Not overlaying text."), 'error');
return FALSE;
}
// Parse offsets
// Parse offsets.
$params['xpos'] = image_effects_text_get_offset($data['xpos'], $image->info['width'], $image->info['height'], $image->info['width']);
$params['ypos'] = image_effects_text_get_offset($data['ypos'], $image->info['width'], $image->info['height'], $image->info['height']);
// Convert color from hex (as it is stored in the UI).
$params['RGB'] = $data['RGB'];
if($params['RGB']['HEX'] && $deduced = imagecache_actions_hex2rgba($params['RGB']['HEX'])) {
if ($params['RGB']['HEX'] && $deduced = imagecache_actions_hex2rgba($params['RGB']['HEX'])) {
$params['RGB'] += $deduced;
}
// Make int's of various parameters
// Make integers of various parameters.
$params['size'] = (int) $params['size'];
$params['xpos'] = (int) $params['xpos'];
$params['ypos'] = (int) $params['ypos'];
// Hand over to toolkit
// Hand over to toolkit.
return image_toolkit_invoke('image_effects_text', $image, array($params));
}
/**
* GD toolkit specific implementation of this image effect.
* GD toolkit specific implementation of the text effect.
*
* @param object $image
* @param array $params
* An array containing the parameters for this effect.
* @param stdClass $image
* @param array $data
* The parameters for this effect.
*
* @return bool
* true on success, false otherwise.
*/
function image_gd_image_effects_text($image, $params) {
function image_gd_image_effects_text(stdClass $image, array $data) {
// Convert color and alpha to GD alpha and color value.
// GD alpha value: 0 = opaque, 127 = transparent.
$params['alpha'] = (int) ((1 - ($params['alpha'] / 100)) * 127);
$color = imagecolorallocatealpha($image->resource, $params['RGB']['red'], $params['RGB']['green'], $params['RGB']['blue'], $params['alpha']);
$data['alpha'] = (int) ((1 - ($data['alpha'] / 100)) * 127);
$color = imagecolorallocatealpha($image->resource, $data['RGB']['red'], $data['RGB']['green'], $data['RGB']['blue'], $data['alpha']);
if ($color !== FALSE) {
$bounds = NULL;
// Adjust Y position for vertical alignment (if different from bottom).
if ($params['valign'] !== 'bottom') {
if ($data['valign'] !== 'bottom') {
// Get bounding box.
// PHP Manual: "This function requires both the GD library and the » FreeType library."
// So it is not more demanding than imagettftext, which we need anyway.
$bounds = imagettfbbox($params['size'], 0, $params['fontpath'], $params['text']);
if ($bounds === FALSE) {
$bounds = imagettfbbox($data['size'], 0, $data['fontpath'], $data['text']);
if (!$bounds) {
drupal_set_message(t('Failed to calculate text dimensions using GD toolkit. Ignoring the alignment settings.'), 'warning');
}
else {
// Get height of bounding box.
$height = $bounds[1] - $bounds[7];
// Shift ypos down (full height on bottom, half the height on center).
$params['ypos'] += $params['valign'] === 'center' ? (int) ($height/2) : $height;
$data['ypos'] += $data['valign'] === 'center' ? (int) ($height / 2) : $height;
}
}
// Adjust X position for horizontal alignment (if different from left).
if ($params['halign'] !== 'left') {
// Get bounding box.
// PHP Manual: "This function requires both the GD library and the » FreeType library."
// So it is not more demanding than imagettftext, which we need anyway.
if ($data['halign'] !== 'left') {
// Get bounding box. PHP Manual: "This function requires both the GD
// library and the » FreeType library.", so it is not more demanding than
// imagettftext(), which we need anyway.
if ($bounds === NULL) {
$bounds = imagettfbbox($params['size'], 0, $params['fontpath'], $params['text']);
if ($bounds === FALSE) {
$bounds = imagettfbbox($data['size'], 0, $data['fontpath'], $data['text']);
if (!$bounds) {
drupal_set_message(t('Failed to calculate text dimensions using GD toolkit. Ignoring the alignment.'), 'warning');
}
}
@@ -336,39 +408,40 @@ function image_gd_image_effects_text($image, $params) {
// Get width of bounding box.
$width = $bounds[2] - $bounds[0];
// Shift xpos to the left (full width on right, half the width on center).
$params['xpos'] -= $params['halign'] === 'center' ? (int) ($width/2) : $width;
$data['xpos'] -= $data['halign'] === 'center' ? (int) ($width / 2) : $width;
}
}
// PHP Manual: "This function requires both the GD library and the » FreeType library."
$bounds = imagettftext($image->resource, $params['size'], $params['angle'], $params['xpos'], $params['ypos'], $color, $params['fontpath'], $params['text']);
$bounds = imagettftext($image->resource, $data['size'], $data['angle'], $data['xpos'], $data['ypos'], $color, $data['fontpath'], $data['text']);
return $bounds !== FALSE;
}
return FALSE;
}
/**
* Imagemagick toolkit specific implementation of this image effect.
* Imagemagick toolkit specific implementation of the text effect.
*
* Text in Imagemagick:
* @link http://www.imagemagick.org/script/command-line-options.php?#draw
* @link http://www.imagemagick.org/script/command-line-options.php?#annotate
* - http://www.imagemagick.org/script/command-line-options.php?#draw
* - http://www.imagemagick.org/script/command-line-options.php?#annotate
*
* UTF-8/non-ascii characters
* Though the online imagemagick manual mentions some problems with accented
* characters, it worked fine for me in a Windows Vista shell. TBC on other
* OS'es (including linux)
* (@see: http://www.imagemagick.org/Usage/windows/#character_encoding)
* UTF-8/non-ascii characters:
* To prevent problems with non-ASCII characters, the online manual suggests to
* put the text in a file and use the @{file} syntax. This does not work with
* the text primitive of the -draw command, so we use -annotate.
* We put the text in a temporary file which will be deleted by our hook_exit().
* http://www.imagemagick.org/Usage/windows/#character_encoding
*
* Alignment in Imagemagick:
* This is not directly supported, though a justicifcation option has been
* proposed: @link http://www.imagemagick.org/Usage/bugs/future/#justification.
* This is not directly supported, though a justification option has been
* proposed: http://www.imagemagick.org/Usage/bugs/future/#justification.
*
* What we do have is the gravity option:
* @link http://www.imagemagick.org/Usage/annotating/#gravity
* Gravity is used to position a text, but it also automatically applies a
* justification based on that placement. So we use gravity here for alignment,
* but will thus have to rebase our positioning.
* - http://www.imagemagick.org/Usage/annotating/#gravity
*
* Gravity |halign|valign |hpos change|vpos change
* ------------------------------------------------
@@ -381,8 +454,16 @@ function image_gd_image_effects_text($image, $params) {
* SouthWest left bottom 0 -height
* South center bottom -width/2 -height
* SouthEast right bottom -width -height
*
* @param stdClass $image
* @param array $data
* The parameters for this effect.
*
* @return bool
* true on success, false otherwise.
*/
function image_imagemagick_image_effects_text($image, $params) {
function image_imagemagick_image_effects_text(stdClass $image, array $data) {
static $alignments2gravity = array(
'left' => array(
'top' => array(
@@ -438,39 +519,65 @@ function image_imagemagick_image_effects_text($image, $params) {
);
// Convert color and alpha to Imagemagick rgba color argument.
$alpha = $params['alpha'] / 100;
$color = 'rgba(' . $params['RGB']['red']. ',' . $params['RGB']['green'] . ',' . $params['RGB']['blue'] . ','. $alpha . ')';
$alpha = $data['alpha'] / 100;
$color = 'rgba(' . $data['RGB']['red'] . ',' . $data['RGB']['green'] . ',' . $data['RGB']['blue'] . ',' . $alpha . ')';
// Alignment
$alignment_corrections = $alignments2gravity[$params['halign']][$params['valign']];
// Set gravity for the alignment and calculate the translation to the
// requested x and y offset as starting from the gravity point.
$alignment_corrections = $alignments2gravity[$data['halign']][$data['valign']];
$gravity = $alignment_corrections['gravity'];
if ($alignment_corrections['tx'] > 0) {
$params['xpos'] = (int) ($alignment_corrections['tx'] * $image->info['width'] - $params['xpos']);
$data['xpos'] = (int) ($alignment_corrections['tx'] * $image->info['width'] - $data['xpos']);
}
else {
$params['xpos'] += (int) ($alignment_corrections['tx'] * $image->info['width']);
$data['xpos'] += (int) ($alignment_corrections['tx'] * $image->info['width']);
}
if ($alignment_corrections['ty'] > 0) {
$params['ypos'] = (int) ($alignment_corrections['ty'] * $image->info['height'] - $params['ypos']);
$data['ypos'] = (int) ($alignment_corrections['ty'] * $image->info['height'] - $data['ypos']);
}
else {
$params['ypos'] += (int) ($alignment_corrections['ty'] * $image->info['height']);
$data['ypos'] += (int) ($alignment_corrections['ty'] * $image->info['height']);
}
// Define the quote to use around the text. This is part of the argument of
// the -draw command and thus should NOT be the shell argument enclosing
// character.
$quote = strstr($_SERVER['SERVER_SOFTWARE'], 'Win32') || strstr($_SERVER['SERVER_SOFTWARE'], 'IIS') ? "'" : '"';
// and subsequently escape the use of that quote within the text.
$text = $params['text'];
$text = str_replace($quote, "\\$quote", $text);
// Add signs to translation, also when positive or 0.
if ($data['xpos'] >= 0) {
$data['xpos'] = '+' . $data['xpos'];
}
if ($data['ypos'] >= 0) {
$data['ypos'] = '+' . $data['ypos'];
}
$image->ops[] = '-font ' . escapeshellarg($params['fontpath']);
$image->ops[] = "-pointsize {$params['size']}";
// Angle must be positive.
if ($data['angle'] < 0) {
$data['angle'] = $data['angle'] % 360 + 360;
}
// Set font file, size and color. fontpath is the real path, not a wrapper.
$image->ops[] = '-font ' . escapeshellarg($data['fontpath']);
$image->ops[] = "-pointsize {$data['size']}";
$image->ops[] = '-fill ' . escapeshellarg($color);
// See issue http://drupal.org/node/1561214, Bootstrap should reset locale settings to UTF-8.
setlocale(LC_ALL, 'C.UTF-8');
$image->ops[] = '-draw ' . escapeshellarg("gravity $gravity translate {$params['xpos']},{$params['ypos']} rotate {$params['angle']} text 0,0 $quote$text$quote");
// Add text to a temporary file,
$tmp_file_name = drupal_tempnam('temporary://', 'image_effects_text');
$tmp_file = fopen($tmp_file_name, 'w');
if ($tmp_file) {
fwrite($tmp_file, $data['text']);
fclose($tmp_file);
// and inform our hook_exit about it.
image_effects_text_exit($tmp_file_name);
$tmp_file_name = drupal_realpath($tmp_file_name);
$text = "@$tmp_file_name";
}
else {
// Fallback to pass the text via the command line, let's hope there are no
// non-ASCII characters or that it works anyway (OS and locale dependent).
$text = $data['text'];
}
// Add gravity.
$image->ops[] = "-gravity $gravity";
// Add text angle, position and text (file) itself.
$image->ops[] = "-annotate {$data['angle']}x{$data['angle']}{$data['xpos']}{$data['ypos']} " . escapeshellarg($text);
return TRUE;
}
@@ -499,14 +606,14 @@ function image_imagemagick_image_effects_text($image, $params) {
* The algorithm will accept many more situations, though the result may be hard
* to predict.
*
* @param string $position
* The string defining the position.
* @param int $width
* The length of the horizontal dimension.
* @param int $height
* The length of the vertical dimension.
* @param int $length
* The length of the current dimension (should be either width or height).
* @param string $position
* The string defining the position.
*
* @return number
* The computed offset in pixels.
@@ -543,7 +650,7 @@ function image_effects_text_get_offset($position, $width, $height, $length) {
break;
case 'center':
// half the current dimension as provided by $length.
$value += $sign * $length/2;
$value += $sign * $length / 2;
$sign = 1;
break;
default:
@@ -565,38 +672,123 @@ function image_effects_text_get_offset($position, $width, $height, $length) {
/**
* Get the text to use for this image.
*
* @param object $image
* @param stdClass $image
* The image the current effect is to be applied to.
* @param array $data
* An array containing the effect data.
*
* @return string
* Plain string to be placed on the image.
* Plain text to be placed on the image.
*/
function image_effects_text_get_text($image, $data) {
function image_effects_text_get_text(stdClass $image, array $data) {
// Get context about the image.
$image_context = imagecache_actions_get_image_context($image, $data);
if ($data['text_source'] === 'text') {
$text = $data['text'];
}
else {
// Get context about the image.
$image_context = imagecache_actions_get_image_context($image, $data);
// Replace \n with a newline character, except when preceded by a \.
$text = preg_replace('/([^\\\\])\\\\n/', "$1\n", $data['text']);
// Replace \\n by \n.
$text = preg_replace('/\\\\\\\\n/', '\n', $text);
if ($data['text_source'] === 'alt' || $data['text_source'] === 'title') {
// Existence of an image field is not guaranteed, so check for that first.
$text = isset($image_context['image_field'][$data['text_source']]) ? $image_context['image_field'][$data['text_source']] : '';
// Replace tokens.
$token_data = array();
foreach ($image_context['referring_entities'] as /*$field_name =>*/ $field_referring_entities) {
foreach ($field_referring_entities as $entity_type => $entities) {
// We can pass only 1 entity per given type to token_replace(), we take
// the first.
$token_data[$entity_type] = reset($entities);
}
}
else { // $data['text_source'] === 'php'
// Process the php using php_eval (rather than eval), but with GLOBAL
// variables, so they can be passed successfully.
$GLOBALS['image_context'] = $image_context;
$GLOBALS['image'] = $image;
// We don't need to check_plain() the resulting text, as the text is not
// rendered in a browser but processed on the server.
$text = module_exists('php') ? php_eval('<'.'?php global $image, $image_context; ' . $data['php'] . ' ?'.'>') : '';
unset($GLOBALS['image']);
unset($GLOBALS['image_context']);
if ($image_context['managed_file']) {
$token_data['file'] = $image_context['managed_file'];
}
// We should not sanitize the text as it will not be rendered in the browser
// but is rendered on the image canvas on the server.
$text = token_replace($text, $token_data, array('clear' => TRUE, 'sanitize' => FALSE));
}
else if ($data['text_source'] === 'alt' || $data['text_source'] === 'title') {
$text = '';
// We have 2 possible sources for the alt or title text:
// - Image field.
// - Media module (7.x-2.x) with file_entity: the alt and title come as
// fields of the file entity, stored in 'managed_file'. The names of the
// fields are field_file_image_alt_text resp. field_file_image_title_text.
// BTW: these fields are also available in the 'image_field' entry, but as
// a managed file may be existing without any image field referring to it,
// we do the lookup in the managed_file entry.
if (!empty($image_context['image_field'][$data['text_source']])) {
$text = $image_context['image_field'][$data['text_source']];
}
else if (!empty($image_context['managed_file'])) {
$field = field_get_items('file', $image_context['managed_file'], "field_file_image_{$data['text_source']}_text");
if ($field) {
$text = $field[0]['value'];
}
}
}
else { // $data['text_source'] === 'php'
// Process the php using php_eval (rather than eval), but with GLOBAL
// variables, so they can be passed successfully.
$GLOBALS['image_context'] = $image_context;
$GLOBALS['image'] = $image;
// Get (non-alterable) context about the image style and image effect.
$execution_info = imagecache_actions_get_image_effect_context();
$GLOBALS['image_style'] = $execution_info['image_style'];
$GLOBALS['image_effect_id'] = $execution_info['image_effect_id'];
// We don't need to check_plain() the resulting text, as the text is not
// rendered in a browser but processed on the server.
$text = module_exists('php') ? php_eval('<' . '?php global $image, $image_context; ' . $data['php'] . ' ?' . '>') : '';
unset($GLOBALS['image_effect_id']);
unset($GLOBALS['image_style']);
unset($GLOBALS['image']);
unset($GLOBALS['image_context']);
}
// Convert case.
$text = image_effect_text_case_transform($text, isset($data['text_case']) ? $data['text_case'] : 'none');
return $text;
}
/**
* Transform a string by a certain method.
*
* Proudly copied from module://views/includes/handlers.inc.
*
* @param $string
* The input you want to transform.
* @param $option
* How do you want to transform it, possible values:
* - upper: Uppercase the string.
* - lower: lowercase the string.
* - ucfirst: Make the first char uppercase.
* - ucwords: Make each word in the string uppercase.
*
* @return string
* The transformed string.
*/
function image_effect_text_case_transform($string, $option) {
global $multibyte;
switch ($option) {
default:
return $string;
case 'upper':
return drupal_strtoupper($string);
case 'lower':
return drupal_strtolower($string);
case 'ucfirst':
return drupal_strtoupper(drupal_substr($string, 0, 1)) . drupal_substr($string, 1);
case 'ucwords':
if ($multibyte == UNICODE_MULTIBYTE) {
return mb_convert_case($string, MB_CASE_TITLE);
}
else {
return ucwords($string);
}
}
}

View File

@@ -1,14 +1,14 @@
name = Image Text Effects
description = Display simple or dynamic captions on images.
name = Image Effects Text
description = Provides an image effect to overlay text captions on images.
package = Media
core = 7.x
dependencies[] = image
dependencies[] = imagecache_actions
; Information added by drupal.org packaging script on 2012-12-04
version = "7.x-1.1"
; Information added by Drupal.org packaging script on 2018-03-20
version = "7.x-1.9"
core = "7.x"
project = "imagecache_actions"
datestamp = "1354653754"
datestamp = "1521550387"

View File

@@ -1,25 +0,0 @@
<?php
/**
* @file Set up new text effects.
*
* @todo: is this cache we are clearing still in use?
*/
/**
* Implements hook_install().
*
* Need to flush the cache when this module is enabled or disabled.
*/
function image_effects_text_install() {
cache_clear_all('imagecache_actions', 'cache');
drupal_set_message(t('Additional image effects to add text should now be available in the effects list on !settings_link', array('!settings_link' => l(t('settings'), 'admin/config/media/image-styles'))));
}
/**
* Implements hook_uninstall().
*
* This hook implementation clears the imagecache_actions cache.
*/
function image_effects_text_uninstall() {
cache_clear_all('imagecache_actions', 'cache');
}

View File

@@ -3,7 +3,7 @@
* @file Provide text manipulation effects for image styles.
*
* Ported by dman
* from http://drupal.org/node/264862#comment-865490 by patrickharris
* from https://drupal.org/node/264862#comment-865490 by patrickharris
*
* Ported to D7 by fietserwin
* from imagecache_textactions 6.x-1.8.
@@ -29,8 +29,8 @@ function image_effects_text_image_effect_info() {
'label' => t('Text'),
'help' => t('Add static or dynamic (coded) text to an image.'),
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'form callback' => 'image_effects_text_form',
'summary theme' => 'image_effects_text_summary',
);
@@ -51,12 +51,13 @@ function image_effects_text_help($path, $arg) {
// link to it.
return ' ';
}
return '';
}
/**
* Implements hook_theme().
*
* We register theme functions for the effect summaries.
* Registers theme functions for the effect summaries.
*/
function image_effects_text_theme() {
return array(
@@ -67,6 +68,36 @@ function image_effects_text_theme() {
);
}
/**
* Implements hook_exit().
*
* For imagemagick we place the text in a temporary file as this prevents
* problems with non-ASCII characters. This hook deletes files created during
* execution of the text effect. As a style may contain multiple text effects,
* there may be multiple files to delete.
*
* To keep track of temporary files created by this effect, the image effect
* function itself also calls this hook, but passes the filename as a parameter.
*
* @param string|null $destination
*/
function image_effects_text_exit($destination = NULL) {
static $tmp_file_names = array();
if (isset($destination)) {
if (substr($destination, 0 , strlen('temporary://')) === 'temporary://') {
// Called by the effect function. Add to our static list of files ot delete.
$tmp_file_names[] = $destination;
}
}
else {
// Normal invocation as Drupal hook: delete any files we have collected.
foreach ($tmp_file_names as $tmp_file_name) {
unlink($tmp_file_name);
}
}
}
/**
* Builds the form structure for the overlay text image effect.
*/

View File

@@ -2,17 +2,18 @@ README
------
README for the Image effect text test module.
This module contains 2 image styles to test text effects. It uses an image
This module contains several image styles to test text effects. It uses an image
containing a grid and a font which are included in the install package as well.
The image styles defined by this module start with 'text-test-'.
Hard Dependencies
-----------------
Hard dependencies:
- Imagecache actions.
- Imagecache actions (canvas_actions and image_effects_text).
- Image (Drupal core).
- Features
- System stream wrapper (http://drupal.org/project/system_stream_wrapper)
- System stream wrapper (https://drupal.org/project/system_stream_wrapper)
Soft Dependencies
-----------------
- Imagemagick (preferred toolkit, http://drupal.org/project/imagemagick).
- Imagemagick (preferred toolkit, https://drupal.org/project/imagemagick).
- GD

View File

@@ -1,483 +0,0 @@
<?php
/**
* @file
* image_effects_text_test.features.inc
*/
/**
* Implements hook_image_default_styles().
*/
function image_effects_text_test_image_default_styles() {
$styles = array();
// Exported image style: text-rotate-test.
$styles['text-rotate-test'] = array(
'name' => 'text-rotate-test',
'effects' => array(
32 => array(
'label' => 'Echelle',
'help' => 'La mise à l\'échelle maintiendra les proportions originales de l\'image. Si une seule dimension est précisée, l\'autre dimension sera calculée automatiquement.',
'effect callback' => 'image_scale_effect',
'dimensions callback' => 'image_scale_dimensions',
'form callback' => 'image_scale_form',
'summary theme' => 'image_scale_summary',
'module' => 'image',
'name' => 'image_scale',
'data' => array(
'width' => '800',
'height' => '',
'upscale' => 0,
),
'weight' => '1',
),
33 => array(
'label' => 'Overlay (watermark)',
'help' => 'Choose the file image you wish to use as an overlay, and position it in a layer on top of the canvas.',
'effect callback' => 'canvasactions_file2canvas_image',
'dimensions passthrough' => TRUE,
'form callback' => 'canvasactions_file2canvas_form',
'summary theme' => 'canvasactions_file2canvas_summary',
'module' => 'imagecache_canvasactions',
'name' => 'canvasactions_file2canvas',
'data' => array(
'xpos' => 0,
'ypos' => 0,
'alpha' => '100',
'path' => 'module://image_effects_text_test/grid800x600.png',
),
'weight' => '2',
),
34 => array(
'label' => 'Texte',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => '100',
'ypos' => '200',
'halign' => 'left',
'valign' => 'bottom',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '45',
'fontfile' => 'module://image_effects_text_test/lhandw.ttf',
'text_source' => 'text',
'text' => '100,200 45 left,bottom',
'php' => 'return \'Hello World!\'',
),
'weight' => '3',
),
35 => array(
'label' => 'Texte',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => '300',
'ypos' => '200',
'halign' => 'center',
'valign' => 'center',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '45',
'fontfile' => 'module://image_effects_text_test/lhandw.ttf',
'text_source' => 'text',
'text' => '300,200 45 center,center',
'php' => 'return \'Hello World!\'',
),
'weight' => '4',
),
37 => array(
'label' => 'Texte',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => '500',
'ypos' => '200',
'halign' => 'right',
'valign' => 'top',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '45',
'fontfile' => 'module://image_effects_text_test/lhandw.ttf',
'text_source' => 'text',
'text' => '500,200 45 right,top',
'php' => 'return \'Hello World!\'',
),
'weight' => '5',
),
38 => array(
'label' => 'Texte',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => '100',
'ypos' => '500',
'halign' => 'left',
'valign' => 'bottom',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '-30',
'fontfile' => 'module://image_effects_text_test/lhandw.ttf',
'text_source' => 'text',
'text' => '100,500 -30 left,bottom',
'php' => 'return \'Hello World!\'',
),
'weight' => '7',
),
39 => array(
'label' => 'Texte',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => '300',
'ypos' => '500',
'halign' => 'center',
'valign' => 'center',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '-30',
'fontfile' => 'module://image_effects_text_test/lhandw.ttf',
'text_source' => 'text',
'text' => '300,500 -30 center,center',
'php' => 'return \'Hello World!\'',
),
'weight' => '8',
),
40 => array(
'label' => 'Texte',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => '600',
'ypos' => '400',
'halign' => 'right',
'valign' => 'top',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '-30',
'fontfile' => 'module://image_effects_text_test/lhandw.ttf',
'text_source' => 'text',
'text' => '600,400 -30 right,top',
'php' => 'return \'Hello World!\'',
),
'weight' => '9',
),
),
);
// Exported image style: text-test.
$styles['text-test'] = array(
'name' => 'text-test',
'effects' => array(
30 => array(
'label' => 'Overlay (watermark)',
'help' => 'Choose the file image you wish to use as an overlay, and position it in a layer on top of the canvas.',
'effect callback' => 'canvasactions_file2canvas_image',
'dimensions passthrough' => TRUE,
'form callback' => 'canvasactions_file2canvas_form',
'summary theme' => 'canvasactions_file2canvas_summary',
'module' => 'imagecache_canvasactions',
'name' => 'canvasactions_file2canvas',
'data' => array(
'xpos' => 'left',
'ypos' => 'top',
'alpha' => '100',
'path' => 'module://image_effects_text_test/grid800x600.png',
),
'weight' => '-10',
),
31 => array(
'label' => 'Tekst',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => '100',
'ypos' => '200',
'halign' => 'left',
'valign' => 'top',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '0',
'fontfile' => 'module://image_effects_text_test/lhandw.ttf',
'text_source' => 'text',
'text' => '100,200 left,top',
'php' => 'return \'Hello World!\'',
),
'weight' => '-8',
),
32 => array(
'label' => 'Tekst',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => '300',
'ypos' => '200',
'halign' => 'left',
'valign' => 'center',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '0',
'fontfile' => 'module://image_effects_text_test/lhandw.ttf',
'text_source' => 'text',
'text' => '300,200 left,center',
'php' => 'return \'Hello World!\'',
),
'weight' => '3',
),
33 => array(
'label' => 'Tekst',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => '500',
'ypos' => '200',
'halign' => 'left',
'valign' => 'bottom',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '0',
'fontfile' => 'module://image_effects_text_test/lhandw.ttf',
'text_source' => 'text',
'text' => '500,200 left,bottom',
'php' => 'return \'Hello World!\'',
),
'weight' => '4',
),
34 => array(
'label' => 'Tekst',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => '100',
'ypos' => '400',
'halign' => 'center',
'valign' => 'top',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '0',
'fontfile' => 'module://image_effects_text_test/lhandw.ttf',
'text_source' => 'text',
'text' => '100,400 center,top',
'php' => 'return \'Hello World!\'',
),
'weight' => '5',
),
35 => array(
'label' => 'Tekst',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => '300',
'ypos' => '400',
'halign' => 'center',
'valign' => 'center',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '0',
'fontfile' => 'module://image_effects_text_test/lhandw.ttf',
'text_source' => 'text',
'text' => '300,400 center,center',
'php' => 'return \'Hello World!\'',
),
'weight' => '6',
),
36 => array(
'label' => 'Tekst',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => '500',
'ypos' => '400',
'halign' => 'center',
'valign' => 'bottom',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '0',
'fontfile' => 'module://image_effects_text_test/lhandw.ttf',
'text_source' => 'text',
'text' => '500,400 center, bottom',
'php' => 'return \'Hello World!\'',
),
'weight' => '7',
),
37 => array(
'label' => 'Tekst',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => '100',
'ypos' => '500',
'halign' => 'right',
'valign' => 'top',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '0',
'fontfile' => 'module://image_effects_text_test/lhandw.ttf',
'text_source' => 'text',
'text' => '100,500 right,top',
'php' => 'return \'Hello World!\'',
),
'weight' => '8',
),
38 => array(
'label' => 'Tekst',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => '300',
'ypos' => '500',
'halign' => 'right',
'valign' => 'center',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '0',
'fontfile' => 'module://image_effects_text_test/lhandw.ttf',
'text_source' => 'text',
'text' => '300,500 right,center',
'php' => 'return \'Hello World!\'',
),
'weight' => '9',
),
39 => array(
'label' => 'Tekst',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => '500',
'ypos' => '500',
'halign' => 'right',
'valign' => 'bottom',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '0',
'fontfile' => 'module://image_effects_text_test/lhandw.ttf',
'text_source' => 'text',
'text' => '500,500 right,bottom',
'php' => 'return \'Hello World!\'',
),
'weight' => '10',
),
),
);
return $styles;
}

View File

@@ -1,19 +1,16 @@
name = Image Effects Text test
description = Image effects that test the text effect
description = Defines image styles that test the text effect.
core = 7.x
package = Features
php = 5.2.4
project = image_effects_text_test
package = Media
dependencies[] = image
dependencies[] = image_effects_text
dependencies[] = imagecache_canvasactions
dependencies[] = system_stream_wrapper
features[features_api][] = api:1
features[image][] = text-rotate-test
features[image][] = text-test
; Information added by drupal.org packaging script on 2012-12-04
version = "7.x-1.1"
; Information added by Drupal.org packaging script on 2018-03-20
version = "7.x-1.9"
core = "7.x"
project = "imagecache_actions"
datestamp = "1354653754"
datestamp = "1521550387"

View File

@@ -4,4 +4,606 @@
* Code for the Image Effects Text test feature.
*/
include_once('image_effects_text_test.features.inc');
/**
* Implements hook_image_default_styles().
*/
function image_effects_text_test_image_default_styles() {
$styles = array();
// Exported image style: text-test-position-orientation.
$styles['text-test-position-orientation'] = array(
'name' => 'text-test-position-orientation',
'effects' => array(
115 => array(
'label' => 'Overlay (watermark)',
'help' => 'Choose the file image you wish to use as an overlay, and position it in a layer on top of the canvas.',
'effect callback' => 'canvasactions_file2canvas_image',
'dimensions passthrough' => TRUE,
'form callback' => 'canvasactions_file2canvas_form',
'summary theme' => 'canvasactions_file2canvas_summary',
'module' => 'imagecache_canvasactions',
'name' => 'canvasactions_file2canvas',
'data' => array(
'xpos' => 'left',
'ypos' => 'top',
'alpha' => '100',
'path' => 'module://image_effects_text_test/grid800x600.png',
),
'weight' => '-10',
),
116 => array(
'label' => 'Tekst',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => '100',
'ypos' => '200',
'halign' => 'left',
'valign' => 'top',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '0',
'fontfile' => 'module://image_effects_text/Komika_display.ttf',
'text_source' => 'text',
'text' => '100,200 left,top',
'php' => 'return \'Hello World!\'',
),
'weight' => '-8',
),
117 => array(
'label' => 'Tekst',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => 'left+300',
'ypos' => 'top+200',
'halign' => 'left',
'valign' => 'center',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '0',
'fontfile' => 'module://image_effects_text/Komika_display.ttf',
'text_source' => 'text',
'text' => 'left+300,top+200 left,center',
'php' => 'return \'Hello World!\'',
),
'weight' => '3',
),
118 => array(
'label' => 'Tekst',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => 'right-300',
'ypos' => '200+top',
'halign' => 'left',
'valign' => 'bottom',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '0',
'fontfile' => 'module://image_effects_text/Komika_display.ttf',
'text_source' => 'text',
'text' => 'right-300,200+top left,bottom',
'php' => 'return \'Hello World!\'',
),
'weight' => '4',
),
119 => array(
'label' => 'Tekst',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => 'center-300',
'ypos' => '100+center',
'halign' => 'center',
'valign' => 'top',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '0',
'fontfile' => 'module://image_effects_text/Komika_display.ttf',
'text_source' => 'text',
'text' => 'center-300,100+center center,top',
'php' => 'return \'Hello World!\'',
),
'weight' => '5',
),
120 => array(
'label' => 'Tekst',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => '-100+center',
'ypos' => 'center+100',
'halign' => 'center',
'valign' => 'center',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '0',
'fontfile' => 'module://image_effects_text/Komika_display.ttf',
'text_source' => 'text',
'text' => '-100+center,center+100 center,center',
'php' => 'return \'Hello World!\'',
),
'weight' => '6',
),
121 => array(
'label' => 'Tekst',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => '-200+right',
'ypos' => 'bottom-200',
'halign' => 'center',
'valign' => 'bottom',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '0',
'fontfile' => 'module://image_effects_text/Komika_display.ttf',
'text_source' => 'text',
'text' => '-200+right,bottom-200 center, bottom',
'php' => 'return \'Hello World!\'',
),
'weight' => '7',
),
122 => array(
'label' => 'Tekst',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => '300',
'ypos' => '500',
'halign' => 'right',
'valign' => 'top',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '0',
'fontfile' => 'module://image_effects_text/Komika_display.ttf',
'text_source' => 'text',
'text' => '300,500 right,top',
'php' => 'return \'Hello World!\'',
),
'weight' => '8',
),
123 => array(
'label' => 'Tekst',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => 'right-center+100',
'ypos' => 'bottom-100',
'halign' => 'right',
'valign' => 'center',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '0',
'fontfile' => 'module://image_effects_text/Komika_display.ttf',
'text_source' => 'text',
'text' => 'right-center+100,bottom-100 right,center',
'php' => 'return \'Hello World!\'',
),
'weight' => '9',
),
124 => array(
'label' => 'Tekst',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => 'right-100',
'ypos' => 'bottom-100',
'halign' => 'right',
'valign' => 'bottom',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '0',
'fontfile' => 'module://image_effects_text/Komika_display.ttf',
'text_source' => 'text',
'text' => 'right-100,bottom-100 right,bottom',
'php' => 'return \'Hello World!\'',
),
'weight' => '10',
),
),
);
// Exported image style: text-test-rotate-wrt-alignment.
$styles['text-test-rotate-wrt-alignment'] = array(
'name' => 'text-test-rotate-wrt-alignment',
'effects' => array(
125 => array(
'label' => 'Schalen',
'help' => 'Door te schalen worden de originele verhoudingen behouden. Als één van de dimensies wordt ingevuld zal de andere worden berekend.',
'effect callback' => 'image_scale_effect',
'dimensions callback' => 'image_scale_dimensions',
'form callback' => 'image_scale_form',
'summary theme' => 'image_scale_summary',
'module' => 'image',
'name' => 'image_scale',
'data' => array(
'width' => '800',
'height' => '',
'upscale' => 0,
),
'weight' => '1',
),
126 => array(
'label' => 'Overlay (watermark)',
'help' => 'Choose the file image you wish to use as an overlay, and position it in a layer on top of the canvas.',
'effect callback' => 'canvasactions_file2canvas_image',
'dimensions passthrough' => TRUE,
'form callback' => 'canvasactions_file2canvas_form',
'summary theme' => 'canvasactions_file2canvas_summary',
'module' => 'imagecache_canvasactions',
'name' => 'canvasactions_file2canvas',
'data' => array(
'xpos' => 0,
'ypos' => 0,
'alpha' => '100',
'path' => 'module://image_effects_text_test/grid800x600.png',
),
'weight' => '2',
),
127 => array(
'label' => 'Tekst',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => '100',
'ypos' => '200',
'halign' => 'left',
'valign' => 'bottom',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '45',
'fontfile' => 'module://image_effects_text/Komika_display.ttf',
'text_source' => 'text',
'text' => '100,200 45 left,bottom',
'php' => 'return \'Hello World!\'',
),
'weight' => '3',
),
128 => array(
'label' => 'Tekst',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => '300',
'ypos' => '200',
'halign' => 'center',
'valign' => 'center',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '66.67',
'fontfile' => 'module://image_effects_text/Komika_display.ttf',
'text_source' => 'text',
'text' => '300,200 66.67 center,center',
'php' => 'return \'Hello World!\'',
),
'weight' => '4',
),
129 => array(
'label' => 'Tekst',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => '500',
'ypos' => '200',
'halign' => 'right',
'valign' => 'top',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '90',
'fontfile' => 'module://image_effects_text/Komika_display.ttf',
'text_source' => 'text',
'text' => '500,200 45 right,top',
'php' => 'return \'Hello World!\'',
),
'weight' => '5',
),
130 => array(
'label' => 'Tekst',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => '100',
'ypos' => '500',
'halign' => 'left',
'valign' => 'bottom',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '-30',
'fontfile' => 'module://image_effects_text/Komika_display.ttf',
'text_source' => 'text',
'text' => '100,500 -30 left,bottom',
'php' => 'return \'Hello World!\'',
),
'weight' => '7',
),
131 => array(
'label' => 'Tekst',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => '300',
'ypos' => '500',
'halign' => 'center',
'valign' => 'center',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '-45',
'fontfile' => 'module://image_effects_text/Komika_display.ttf',
'text_source' => 'text',
'text' => '300,500 -45 center,center',
'php' => 'return \'Hello World!\'',
),
'weight' => '8',
),
132 => array(
'label' => 'Tekst',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '18',
'xpos' => '600',
'ypos' => '400',
'halign' => 'right',
'valign' => 'top',
'RGB' => array(
'HEX' => '000000',
),
'alpha' => '100',
'angle' => '-90',
'fontfile' => 'module://image_effects_text/Komika_display.ttf',
'text_source' => 'text',
'text' => '600,400 -90 right,top',
'php' => 'return \'Hello World!\'',
),
'weight' => '9',
),
),
);
// Exported image style: text-test-utf8-multi-line-color-transparency.
$styles['text-test-utf8-multi-line-color-transparency'] = array(
'name' => 'text-test-utf8-multi-line-color-transparency',
'effects' => array(
133 => array(
'label' => 'Overlay (watermark)',
'help' => 'Choose the file image you wish to use as an overlay, and position it in a layer on top of the canvas.',
'effect callback' => 'canvasactions_file2canvas_image',
'dimensions passthrough' => TRUE,
'form callback' => 'canvasactions_file2canvas_form',
'summary theme' => 'canvasactions_file2canvas_summary',
'module' => 'imagecache_canvasactions',
'name' => 'canvasactions_file2canvas',
'data' => array(
'xpos' => 'left',
'ypos' => 'top',
'alpha' => '100',
'path' => 'module://image_effects_text_test/grid800x600.png',
),
'weight' => '-10',
),
114 => array(
'label' => 'Tekst',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '20',
'xpos' => '100',
'ypos' => '100',
'halign' => 'left',
'valign' => 'top',
'RGB' => array(
'HEX' => 'FF0000',
),
'alpha' => '100',
'angle' => '0',
'fontfile' => 'sites/all/modules/imagecache_actions/image_effects_text/Komika_display.ttf',
'text_source' => 'text',
'text' => 'top+100,left+100: é è à ù ç Ö ÿ “ ” ° ² ³ € x ÷',
'php' => 'if (!$image_context[\'entity\']) {
return \'No referring entity\';
}
$entity_type = \'node\';
$field_name = \'my_field\';
$entity = $image_context[\'entity\'];
$field = field_get_items($entity_type, $entity, $field_name);
if ($field) {
return isset($field[0][\'value\']) ? $field[0][\'value\'] : \'No field value\';
}
',
),
'weight' => '-9',
),
135 => array(
'label' => 'Tekst',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '50',
'xpos' => '100',
'ypos' => '200',
'halign' => 'left',
'valign' => 'top',
'RGB' => array(
'HEX' => '0000FF',
),
'alpha' => '90',
'angle' => '0',
'fontfile' => 'sites/all/modules/imagecache_actions/image_effects_text/Komika_display.ttf',
'text_source' => 'text',
'text' => 'Hello World!\\nOlá, mundo\\\\nHej världen',
'php' => 'if (!$image_context[\'entity\']) {
return \'No referring entity\';
}
$entity_type = \'node\';
$field_name = \'my_field\';
$entity = $image_context[\'entity\'];
$field = field_get_items($entity_type, $entity, $field_name);
if ($field) {
return isset($field[0][\'value\']) ? $field[0][\'value\'] : \'No field value\';
}
',
),
'weight' => '-8',
),
134 => array(
'label' => 'Tekst',
'help' => 'Add static or dynamic (coded) text to an image.',
'dimensions passthrough' => TRUE,
'form callback' => 'image_effects_text_form',
'effect callback' => 'image_effects_text_effect',
'summary theme' => 'image_effects_text_summary',
'module' => 'image_effects_text',
'name' => 'image_effects_text',
'data' => array(
'size' => '50',
'xpos' => '400',
'ypos' => 'bottom-100',
'halign' => 'center',
'valign' => 'bottom',
'RGB' => array(
'HEX' => 'FFFFFF',
),
'alpha' => '50',
'angle' => '0',
'fontfile' => 'arial.ttf',
'text_source' => 'php',
'text' => 'Hello World!',
'php' => 'return "Hello World!\\nOlá, mundo\\\\nHej världen";
',
),
'weight' => '-7',
),
),
);
return $styles;
}