Add width and height attributes in drupalImage

Created on 12 July 2019, over 5 years ago
Updated 10 May 2023, over 1 year ago

Hi!
Thank for module.
I think add width and height attributes in drupalImage method.

Example:

    ...
   $build = [
      '#uri' => $file->getFileUri(),
      '#attributes' => $attributes,
    ];
    $image = $this->imageFactory->get($file->getFileUri());
    if ($image->isValid()) {
      $build['#width'] = $image->getWidth();
      $build['#height'] = $image->getHeight();
    }
    else {
      $build['#width'] = $output['#height'] = NULL;
    }
     if ($style) {
...
💬 Support request
Status

Closed: won't fix

Version

2.0

Component

Code

Created by

🇷🇺Russia batkor Irkutsk

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024