How to only add text into a dynamic image
I currently have this image: http://res.cloudinary.com/saint-gobain/image/upload/t_bp-banner-300x600/w_95,c_fit,l_text:bp_banner_300x600_text:Example%20text,g_south_west,x_21,y_35/sample.jpg, but I would like to have it something like this:
http://res.cloudinary.com/saint-gobain/image/upload/t_bp-banner-300x600/l_text:bp_banner_300x600_text:Example%20text/sample.jpg
So that w_95, c_fit, g_south_west, x_21 and y_35 are all already included in transformation t_bp-banner-300x600 or bp_banner_300x600_text, or perhaps bp_banner_300x600_text could be removed too, because it is already in bp_banner_300x600
How is this possible?
-
Hi Sven,
I'm sorry for my response delay.
This can indeed be done by setting a chained transformation in a named transformation. So you can update the "bp-banner-300x600" transformation to include all of these transformations, and then you'll end up having a URL like:
http://res.cloudinary.com/saint-gobain/image/upload/t_bp-banner-300x600/sample.jpg
If you need any further assistance, please always feel free to open a support ticket, and we'll be happy to assist.
Thanks,
Itay -
I only want the text to be dynamic. The text-style should be fixed. So http://res.cloudinary.com/saint-gobain/image/upload/t_bp-banner-300x600/sample.jpg won't work, because the text itself isn't dynamic anymore but fixed into the transformation.
-
UPDATE
We now support passing a dynamic text overlay to named transformations as well.
Define the variable: `$name_!some%20value!` and then use it in your named transformation as: `$(name)`.
For example, here's a transformation example:
http://res.cloudinary.com/demo/image/upload/$name_!My%20name!/c_scale,w_400/c_scale,fl_relative,g_south,h_0.12,l_black_bar,o_60,w_1.0/co_rgb:eee,g_south_west,l_text:Arial_20:Photographer:%20$(name),x_10,y_5/sample.jpg
We have most of the transformation defined under the `photo` named transformation, and we can dynamically update the `name` of the photographer with something like the following:
http://res.cloudinary.com/demo/image/upload/$name_!My%20name!/t_photo/sample.jpg -
Yes, you can add overlays dynamically. For more information:https://cloudinary.com/cookbook/relative_size_overlays
https://cloudinary.com/blog/how_to_use_conditions_to_dynamically_manipulate_images
Post is closed for comments.
Comments
7 comments