Skip to content

WebP support#94

Open
louisbels wants to merge 5 commits intoPrestaShop:devfrom
louisbels:dev
Open

WebP support#94
louisbels wants to merge 5 commits intoPrestaShop:devfrom
louisbels:dev

Conversation

@louisbels
Copy link

@louisbels louisbels commented Aug 17, 2023

Questions Answers
Description? WebP support. WebP lossless images are 26% smaller in size compared to PNGs. WebP lossy images are 25-34% smaller than comparable JPEG
Type? improvement
BC breaks? no
Deprecations? no
Fixed ticket?
Sponsor company
How to test? Use the module. Upload a new image that uses WebP support. Without this PR, it does not work.

Copy link
Contributor

@matks matks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hello @Patrocle !

This is nice, however the current version of ps_imageslider is compatible with PrestaShop 1.7.4.0 until PrestaShop 8.1.0 (here https://github.com/PrestaShop/ps_imageslider/blob/dev/ps_imageslider.php#L65)

WebP image support has been added in PrestaShop 8.0.0 (see PrestaShop/PrestaShop#10356).

So if someone uses this PR on PrestaShop 1.7.8 for example it will not work.

I suggest that, in this PR, you modify the minimum version of PrestaShop compatible with ps_imageslider to 8.0.0 😉

@louisbels louisbels requested a review from matks August 18, 2023 09:38
Copy link
Contributor

@matks matks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the changes 😉 I validate the PR. Let's now wait for QA team to test it.

Copy link
Contributor

@matks matks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Woups I was too quick 😅 we also need to remove the CI jobs that verify the module is compatible with prestashop <= 8.0.0

This is why the CI is failing: it attempts to verify the module works with PrestaShop 1.7.7, 1.7.8 ... but it's not relevant now

@louisbels louisbels requested a review from matks August 18, 2023 14:17
- name: Checkout
uses: actions/checkout@v2.0.0

- name: PHP syntax checker 5.6
Copy link
Contributor

@kpodemski kpodemski Aug 22, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Patrocle I think it would be better to keep PHP checks for 7.2 to 8.1. As you probably know, PrestaShop 8.0 is compatible with PHP 7.2 to 8.1.

@kpodemski
Copy link
Contributor

Hey @Patrocle

Thanks for your contribution!

A couple of suggestions:

  1. You have to create a config file for PHPStan: Project config file at path /var/www/html/modules/ps_imageslider/tests/phpstan/phpstan-8.1.0.neon does not exist.
  2. It would be better to check PHP compatibility between 7.2 and 8.1.

@louisbels louisbels requested a review from kpodemski August 22, 2023 14:00
strategy:
matrix:
presta-versions: ['1.7.4.4', '1.7.5.1', '1.7.6', '1.7.7', '1.7.8', 'latest']
presta-versions: ['8.0.0', '8.1.0', 'latest']
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we should use '8.0', '8.1' here (they mean 8.0.x and 8.1.x :)

uses: shivammathur/setup-php@v2
with:
php-version: '7.4'
php-version: '8.1'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused about the impact of this php-version change 😕

$this->displayName = $this->trans('Image slider', [], 'Modules.Imageslider.Admin');
$this->description = $this->trans('Add sliding images to your homepage to welcome your visitors in a visual and friendly way.', [], 'Modules.Imageslider.Admin');
$this->ps_versions_compliancy = ['min' => '1.7.4.0', 'max' => _PS_VERSION_];
$this->ps_versions_compliancy = ['min' => '8.0.0', 'max' => _PS_VERSION_];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

module version need to be bumped to 4.0.0 accordingly

@seakrebel
Copy link

seakrebel commented Mar 2, 2024

My ps_imageslider v3.1.4 doesn't seem to accept .webp source images even though other settings are configured correctly and products, categories, etc. have .webp source images that also render as such.

PrestaShop v8.1.4

Screenshot 2024-03-02 at 12 45 38@2x

Screenshot 2024-03-02 at 12 47 31@2x

EDIT: works after manually applying the fix from @matks

@LetsPrint3D
Copy link

EDIT: works after manually applying the fix from @matks

Did you just change the 'min' value on $this->ps_versions_compliancy to a value of '8.0.0'? I'm having the same problem on the latest Prestashop 8.1.7 and that sadly didn't work for me.

@Acidiphilium
Copy link

Hi folks, do we know around when it will be compatible? With latest version 3.2.1 under Prestashop 8.2, it doesn't look to be compatible.

@louisbels
Copy link
Author

Hello, what changes are required ?
Should the version be bumped to 4.0.0 ?

$this->displayName = $this->trans('Image slider', [], 'Modules.Imageslider.Admin');
$this->description = $this->trans('Add sliding images to your homepage to welcome your visitors in a visual and friendly way.', [], 'Modules.Imageslider.Admin');
$this->ps_versions_compliancy = ['min' => '1.7.4.0', 'max' => _PS_VERSION_];
$this->ps_versions_compliancy = ['min' => '8.0.0', 'max' => _PS_VERSION_];

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But why break compatibility with 1.7 if nothing in this PR actually needs version 8+?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Waiting for author

Development

Successfully merging this pull request may close these issues.

9 participants