Problem/Motivation

ImageCropWidget::getThumbnailCropProperties calls getimagesize. I think the code should use cores ImageFactory instead.

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

webflo created an issue. See original summary.

webflo’s picture

$image = \Drupal::service('image.factory')->get($file->getFileUri());
if ($image->isValid()) {
  $variables['width'] = $image->getWidth();
  $variables['height'] = $image->getHeight();
}
webflo’s picture

Issue tags: +D8Media
woprrr’s picture

Status: Active » Needs review
Issue tags: +Novice
FileSize
2.34 KB

Oops ! Thanks for this issue !! I purpose this patch with small test to stop all process if image is not valid.

woprrr’s picture

Status: Needs review » Fixed

  • woprrr committed 3b728eb on 8.x-1.x
    Issue #2625642 by woprrr: ImageCropWidget::getThumbnailCropProperties...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.