Skip to content

Commit

Permalink
1.2.8
Browse files Browse the repository at this point in the history
Image file name with spaces causes no webp conversion
  • Loading branch information
conseilgouz committed Sep 19, 2024
1 parent 4892b64 commit 3274722
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cgwebp.xml
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<?xml version="1.0" encoding="utf-8" ?>
<extension type="plugin" version="4.0" group="system" method="upgrade">
<name>System - CG Webp</name>
<creationDate>2024-08-16</creationDate>
<creationDate>2024-09-19</creationDate>
<author>ConseilGouz</author>
<copyright>Copyright (C) 2024 ConseilGouz. All rights reserved.</copyright>
<license>GNU/GPL</license>
<authorEmail>pascal.leconte@conseilgouz.com</authorEmail>
<authorUrl>https://www.conseilgouz.com</authorUrl>
<version>1.2.7</version>
<version>1.2.8</version>
<description>PLG_SYSTEM_CGWEBP_DESCRIPTION</description>
<namespace path="src">Conseilgouz\Plugin\System\Cgwebp</namespace>
<scriptfile>script.cgwebp.php</scriptfile>
Expand Down
12 changes: 12 additions & 0 deletions plg_system_cgwebp_changelog.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,16 @@
<changelogs>
<changelog>
<element>plg_system_cgwebp</element>
<type>plugin</type>
<group>system</group>
<version>1.2.8</version>
<note>
<item>Update : 19/09/2024</item>
</note>
<fix>
<item>Image file name with spaces causes no webp conversion</item>
</fix>
</changelog>
<changelog>
<element>plg_system_cgwebp</element>
<type>plugin</type>
Expand Down
3 changes: 3 additions & 0 deletions src/Extension/Cgwebp.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,9 @@ private function isExcludedDirectory($image, $excluded)

private function imgToWebp($image, $quality = 100, $excluded = array(), $stored_time = 5, $regexPath = '', $fullRegex = '', &$debugTarget = [])
{
if (strpos($image,'%20')) { // filenames with %20 : JCE replaces spaces by %20, let's change this
$image = str_replace('%20',' ',$image);
}
$imgPath = JPATH_ROOT . '/' . $image;
$imgInfo = pathinfo($imgPath);
$imgHash = md5($imgPath);
Expand Down

0 comments on commit 3274722

Please sign in to comment.