Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generate renditions for all images uploaded to magento #1476

Closed
sivaschenko opened this issue Jun 15, 2020 · 2 comments · Fixed by #1507
Closed

Generate renditions for all images uploaded to magento #1476

sivaschenko opened this issue Jun 15, 2020 · 2 comments · Fixed by #1507

Comments

@sivaschenko
Copy link
Member

Description

Currently when the image is uploaded to the media gallery, the thumbnail is created for the image. The idea is to use a similar approach for generating the optimized version of the image.

  • When image is uploaded to the media gallery the optimized version of the image should be created ("Rendition")
  • Rendition should be created based on width/height specified in the configuration of MediaGalleryRenditions module
  • If the image width is greater than the width specified in the configuration - the image should be resized to the configuration width
  • If the image height is greater than the height specified in the configuration - the image should be resized to the configuration height
  • The image should be resized proportionally
  • Resized version of the image should be saved to the .renditions directory
  • Image path/name should be generated using the same approach as thumbnail generation
    (see \Magento\Cms\Model\Wysiwyg\Images\Storage::resizeFile)

Implementation

  • A \Magento\MediaGalleryRenditionsApi\Api\GenerateRentitionsInterface should be introduced with a single method execute(string $path): void
  • An interface should be implemented by \Magento\MediaGalleryRenditions\Model\GenerateRentitions
  • GenerateRentitionsInterface should be used to execute rendition generation during the image upload
@sivaschenko sivaschenko added this to the 2.1.0 milestone Jun 15, 2020
@m2-assistant
Copy link

m2-assistant bot commented Jun 15, 2020

Hi @sivaschenko. Thank you for your report.
To help us process this issue please make sure that you provided sufficient information.

Please, add a comment to assign the issue: @magento I am working on this


@sivaschenko sivaschenko changed the title Generate renditions for all images uploaded to magento to .renditions directory Generate renditions for all images uploaded to magento Jun 15, 2020
@konarshankar07
Copy link
Contributor

@magento I'm working on this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants