Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aeyoll/image-retriever-for-prestashop
This module helps you generate thumbnails and webp/avif alternatives for images inside a custom module.
https://github.com/aeyoll/image-retriever-for-prestashop
Last synced: about 2 months ago
JSON representation
This module helps you generate thumbnails and webp/avif alternatives for images inside a custom module.
- Host: GitHub
- URL: https://github.com/aeyoll/image-retriever-for-prestashop
- Owner: aeyoll
- Created: 2024-02-13T20:11:29.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-10-10T14:19:56.000Z (2 months ago)
- Last Synced: 2024-10-11T00:45:37.613Z (2 months ago)
- Language: PHP
- Homepage:
- Size: 13.7 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Image Retriever for PrestaShop
This module helps you generate thumbnails and webp/avif alternatives for images inside a custom module.
Requirements
---PHP 7.1+ is needed to use this module.
Installation
---### PrestaShop 8.0+
For PrestaShop 8.0+, require the plugin with Composer using the following command:
```sh
composer require aeyoll/image_retriever
```Usage
---Let's assume you have an image file in a module, located at `modules/your_module/img/test.jpg`.
```php
getImage(
_PS_MODULE_DIR_ . 'your_module/img/', // The absolute path to the uploaded images folder
'test.jpg', // The image filename
['home_default'] // Optional: generate only specific image types, otherwise generate every format
);
```In your template:
```tpl
{if !empty($image.bySize.home_default.sources.avif)}
{/if}{if !empty($image.bySize.home_default.sources.webp)}
{/if}