File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
MediaGalleryRenditions/Model Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -37,6 +37,7 @@ class GenerateRenditions implements GenerateRenditionsInterface
3737 * @var CreateAssetFromFile
3838 */
3939 private $ createAssetFromFile ;
40+
4041 /**
4142 * @var Filesystem
4243 */
@@ -77,7 +78,9 @@ public function execute(array $assets): void
7778 continue ;
7879 }
7980 $ renditionDirectoryPath = $ this ->getRenditionPath ->execute ($ asset );
80- $ renditionImagePath = $ renditionDirectoryPath . $ asset ->getPath ();
81+ $ this ->filesystem ->getDirectoryWrite (DirectoryList::MEDIA )
82+ ->create ($ renditionDirectoryPath );
83+ $ renditionImagePath = $ renditionDirectoryPath . '/ ' . $ asset ->getPath ();
8184 $ image = $ this ->imageFactory ->create ();
8285 $ image ->open ($ path );
8386 $ image ->keepAspectRatio (true );
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ public function __construct(
3939 Filesystem $ filesystem ,
4040 DriverInterface $ file = null
4141 ) {
42- $ this ->directory = $ filesystem ->getDirectoryWrite (DirectoryList::MEDIA );
42+ $ this ->directory = $ filesystem ->getDirectoryRead (DirectoryList::MEDIA );
4343 $ this ->file = $ file ?: ObjectManager::getInstance ()->get (Filesystem \Driver \File::class);
4444 }
4545
You can’t perform that action at this time.
0 commit comments