Skip to content

Commit

Permalink
Merge pull request #1 from digitalutsc/d10-update
Browse files Browse the repository at this point in the history
removed and replaced dep function
  • Loading branch information
Natkeeran authored Oct 24, 2023
2 parents 94dcf13 + 3d50fef commit 0d2643d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Plugin/MediaThumbnail/MediaThumbnailJp2.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public function createThumbnail($sourceUri) {

// Read the Jp2.
try {
$cmd = "convert " . $path . " -resize " . $width . "x" . $width . " /tmp/" . $filename . ".jpg";
$cmd = "convert " . $path . " -resize " . $width . "x" . $width . " /tmp/" . $filename . ".jpg";
exec($cmd);
}
catch (\ImagickException $e) {
Expand All @@ -54,7 +54,7 @@ public function createThumbnail($sourceUri) {
$im->destroy();

// Return a new managed file object using the generated thumbnail.
return file_save_data($image, $sourceUri . '.jpg');
return \Drupal::service('file.repository')->writeData($image, $sourceUri . '.jpg');

}

Expand Down

0 comments on commit 0d2643d

Please sign in to comment.