Impact on the broadcast sending speed

This Smarty solution can impact the sending speed in the case of a batch sending.

With this function, you can retrieve the height and width of an image-type property. You can use this information, for instance, to give a content block the same height or width.

getimagesize

{{$url|getimagesize}} 

The output of getimagesize:

KeyContentExample
0Width765
1Height956
2Textually, the width and height.width="765" height="956"
bitsBits8
channelsChannels3
mimeMime typeimage/jpeg


Examples

It's possible to use a variable with a public URL or based on an image property in the content or object.

Based on a property

Create a new property of the type "Image":


Subsequently, in the content or object, you can retrieve the `getimagesize` of the specified property:

getimagesize

{{$image_size = $property['image_url']|getimagesize}}


Output:
Array ( [0] => 765 [1] => 956 [2] => 2 [3] => width="765" height="956" [bits] => 8 [channels] => 3 [mime] => image/jpeg )


Based on a variable

You can also use a URL from a variable, see the example below:

getimagesize

{{$image_url  = "https://deployteq.com/wp-content/uploads/2022/11/cropped-Favicon-192x192.png"}}
{{$image_size = $image_url|getimagesize}}


Output:

array(6) {

  [0]=>
  int(192)
  [1]=>
  int(192)
  [2]=>
  int(3)
  [3]=>
  string(24) "width="192" height="192""
  ["bits"]=>
  int(4)
  ["mime"]=>
  string(9) "image/png"
}