Closed (fixed)
Project:
Image Effects
Version:
8.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
7 Apr 2016 at 19:05 UTC
Updated:
2 Dec 2016 at 19:34 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
jfrederick commentedAnd a patch
Comment #3
ericduran commented:thumbsup:
Comment #4
mondrakeThanks @jfrederick
Can we have a 'suffix' text here instead of hardcoding an ellipsis? One may want to add [more], (more), >>>, you-know-what, instead of ...
Text type so that it can be translated.
Why cut the text in the toolkit operation code? Manipulating the text can be done at the beginning of the TextOverlayImageEffect::getTextWrapper method, and just input to the operation.
I think this deserves a test, too, like e.g. adding the limit when adding the effect to the image style, a very long input text, and measuring the dimensions of the derivative image without and with the limit.
Comment #5
mondrakeAlso I think we should use
Unicode:: strlenandUnicode::substrin place of the standard PHP functions.Comment #6
mondraketagging
Comment #7
cyslee commentedUpdate patch #2 based on @mondrake's comment on #5.
Comment #8
cyslee commentedComment #9
mondrakeThanks @cyslee
Since there can be endless needs to manipulate the text before overlaying to the image, I was thinking along the lines of adding an hook by means of which any module can alter it as needed. Here I am doing that, adding to the .module file a default implementation of the hook where token resolution, case conversion and length trimming are dealt with.
EDIT: this also covers points in #4 and #5.
Comment #10
mondrakeAdded tests. Plus, the token replacement is better to stay in the effect rather than the hook.
Comment #12
mondrakeComment #13
mondrakeComment #14
mondrakeFixed todo and added test for conversion to uppercase.
Comment #15
mondrakeAdded update function to add new parameters to Text Overlay effect, and chnaged the hook implementation signature not to be strict on ImageEffectsTextOverlay but rather allow alternative implementations.
Comment #16
mondrakeWrong numbering of the update function.
Comment #17
mondrakeAnyone for review?
Comment #18
mondrakeLearned in #872206: Add possibility to not upscale for "Scale and crop" effect to move update function to post_update, and added a test for the upgrade path.
Also adding a database dump for the update test - based on Drupal 8.2.0 core standard profile + installed Image Effects 8.x-1.0-alpha2
Comment #19
mondrakeThere was a debug leftover in #18
Comment #20
mondrakeAdded an empty update function to clean up caches and allow disovery of hook_image_effects_text_overlay_text_alter implemnetations.
Comment #22
mondrakeCommitted.
Comment #23
mondrake