Closed sharjilk closed 9 months ago
I created the following patch to fix this issue.
@package yireo/magento2-next-gen-images
Index: /Util/UrlConvertor.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
diff --git a/Util/UrlConvertor.php b/Util/UrlConvertor.php
--- a/Util/UrlConvertor.php
+++ b/Util/UrlConvertor.php (date 1652711174555)
@@ -101,6 +101,7 @@
*/
public function getFilenameFromUrl(string $url): string
{
+ $url = html_entity_decode($url);
$url = preg_replace('/\/static\/version([0-9]+\/)/', '/static/', $url);
if ($this->isLocal($url) === false) {
@thijsdewitt Thanks for jumping in. Note though that it is small little changes like these that are best to pick up as Pull Requests in an open source project like this. The fix will be included in the next release: https://github.com/yireo/Yireo_NextGenImages/commit/8040da540a749251d764418a6c6dfbc85270eb0a
@sharjilk If this fixes your issue, could you close the ticket?
Hello everything is fine? I'm going through a similar situation.
PHP 7.3.33 Magento 2.3.5-p2 Yireo NextGenImages Module version 0.4.0 Yireo WebP2 Module version 0.12.5
When running the command bin/magento dev:di:info "\Magento\Framework\View\LayoutInterface" the error output is the same, however in the LOG appears the pub folder duplicated in the URL
[2023-06-28 15:07:27] main.NOTICE: Source cached image does not exist: /home/mrae/public_html/pub/pub/media/logo/default/mrae-logotipo.png: array ( 'path' => '/home/mrae/public_html/pub/pub/media/logo/default/mrae-logotipo.png', ) [] [] [2023-06-28 15:07:27] main.NOTICE: Source cached image does not exist: /home/mrae/public_html/pub/pub/media/logo/websites/1/mrae-logotipo.png: array ( 'path' => '/home/mrae/public_html/pub/pub/media/logo/websites/1/mrae-logotipo.png', ) [] []
I still don't know what the useful is of the bin/magento dev:di:info
command in this case. But anyway, the notices are pointing to something off. What is the output of the command bin/magento next-gen-images:test-uri URL
where URL
is replaced with the actual URL to the image?
What are the settings that you configured for both the NextGenImages module and the WebP2 module?
Thanks. This URL actually shows that the pub/
is visible in your URLs, meaning that the root of your application is exposed for scanning if people are smart enough. Are you sure that you want to keep running this configuration, while actually everyone would be advising to configure the webserver to use the folder pub/
as your Document Root, and not the application folder?
I never tested for this, because of the security issues involved here. I'm still going to pursue a fix, but I wanted to point out already that not using the pub/
folder as a Document Root suggests another fix with more priority.
Thanks for the feedback. I work with Cpanel and Apache 2.4 and I was not able to configure the webroot, so I had installed it in the root folder. After a lot of research, I found out how to make the adaptation and now the module is working perfectly. Thank you very much for the help
The new version 0.5.0 NextGenImages should fix this. Could you upgrade? And also upgrade the WebP version to the latest version? I'm closing this issue as of yet, but if things are still not working, feel free to reopen this issue.
On product listing page, image tag still present but on product detail page I am having below error.
1 exception(s): Exception #0 (Magento\Framework\View\Asset\File\NotFoundException): URL "https://local.test/media/catalog/product/cache/ff32d94df7540053a6b1040b58ae5eec/l/e/lebs15294.jpg" is not matched with a local file
Browser :- Chrome latest Magento version :- 2.4.1 PHP version:- 7.4 Yireo WebP2 composer version:- 0.12.0 Yireo NextGenImages composer version:- 0.3.0
Settings below
Here's below output of
bin/magento dev:di:info "\Magento\Framework\View\LayoutInterface"