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

500 err , when enabled "Convert to Webp or Avif" #164

Closed
aminweb2 opened this issue Apr 6, 2022 · 23 comments
Closed

500 err , when enabled "Convert to Webp or Avif" #164

aminweb2 opened this issue Apr 6, 2022 · 23 comments
Milestone

Comments

@aminweb2
Copy link

aminweb2 commented Apr 6, 2022

hi @tbela99
when Enabled "Convert to Webp or Avif" in Image tab. website get 500 Error. in error report :
Fatal error: Paletter image not supported by webp in /var/www/vhosts/site/test.com/plugins/system/gzip/helpers/Images.php on line 367

imagewebp($img, $newFile);

can you help me to fix it? thanks

I used php8.1 support webp (not support Avif)

@tbela99
Copy link
Owner

tbela99 commented Apr 6, 2022

As suggested by the error message, the problem comes from the provided image.
I will push an update to prevent the fatal error from getting in the way, but that will not address the problem with the image palette.

@aminweb2
Copy link
Author

aminweb2 commented Apr 6, 2022

i think this happen when generate webp for GIF images.

@aminweb2
Copy link
Author

aminweb2 commented Apr 6, 2022

mr Thierry , also when enabled CSS proccess get this error:
0 array_splice(): Argument #1 ($array) must be of type array, null given

@tbela99
Copy link
Owner

tbela99 commented Apr 6, 2022

can you provide more details in a separate issue (File name and line number at least please.
Thanks

@aminweb2
Copy link
Author

aminweb2 commented Apr 6, 2022

I will push an update to prevent the fatal error from getting in the way, but that will not address the problem with the image palette.
@tbela99 can you will do today please?

@tbela99
Copy link
Owner

tbela99 commented Apr 6, 2022

maybe, let's say tomorrow

@aminweb2
Copy link
Author

aminweb2 commented Apr 6, 2022

so about problem CSS ?

@tbela99
Copy link
Owner

tbela99 commented Apr 6, 2022

I need you to provide more details like you did with this issue. I need the file name and line unmber at least

@tbela99
Copy link
Owner

tbela99 commented Apr 6, 2022

check the error log file

@aminweb2
Copy link
Author

aminweb2 commented Apr 6, 2022

about Convert webp log:

`
Warning: imagecreatefromwebp(): gd-webp cannot get webp info in /var/www/vhosts/site.eu/test.site.eu/plugins/system/gzip/lib/Image/Image.php on line 101

Warning: imagesx() expects parameter 1 to be resource, null given in /var/www/vhosts/site.eu/test.site.eu/plugins/system/gzip/lib/Potracio/Potracio.php on line 180

Warning: imagesy() expects parameter 1 to be resource, null given in /var/www/vhosts/site.eu/test.site.eu/plugins/system/gzip/lib/Potracio/Potracio.php on line 181

Notice: Uninitialized string offset: 4 in /var/www/vhosts/site.eu/test.site.eu/plugins/system/gzip/helpers/Images.php on line 495

Warning: Division by zero in /var/www/vhosts/site.eu/test.site.eu/plugins/system/gzip/lib/Image/Image.php on line 334

Warning: imagesx() expects parameter 1 to be resource, null given in /var/www/vhosts/site.eu/test.site.eu/plugins/system/gzip/lib/Image/Image.php on line 312

Warning: imagecopyresampled() expects parameter 1 to be resource, null given in /var/www/vhosts/site.eu/test.site.eu/plugins/system/gzip/lib/Image/Image.php on line 655

Warning: imagecreatetruecolor() expects parameter 2 to be int, float given in /var/www/vhosts/site.eu/test.site.eu/plugins/system/gzip/lib/Image/Image.php on line 649

Warning: imagesy() expects parameter 1 to be resource, null given in /var/www/vhosts/site.eu/test.site.eu/plugins/system/gzip/lib/Image/Image.php on line 313
`

@tbela99
Copy link
Owner

tbela99 commented Apr 6, 2022

I guess you image is corrupted in some way. I will fix that as well
Thanks

@tbela99
Copy link
Owner

tbela99 commented Apr 7, 2022

can you try this and let me know if your problems are solved? https://github.com/tbela99/gzip/archive/refs/heads/v.next.zip

@aminweb2
Copy link
Author

aminweb2 commented Apr 8, 2022

yes, problem solved.thank you
just have an question:
how exclude an url for effect gzip plugin?
P.S:when i enabled javascript process, crash my google map!

@tbela99
Copy link
Owner

tbela99 commented Apr 8, 2022

you can tell the plugin to ignore specific javascript and css. check the documentation here https://tbela99.github.io/gzip/#/./javascript?id=process-javascript

https://tbela99.github.io/gzip/#/./css?id=parse-critical-css

@tbela99
Copy link
Owner

tbela99 commented Apr 8, 2022

more generally, I see that you use speedcache. I think that it is redundant, as you can already manage css with this plugin.

@tbela99 tbela99 added this to the V3.0.1 milestone Apr 8, 2022
@tbela99
Copy link
Owner

tbela99 commented Apr 8, 2022

If your problem is fixed, can you close this issue?
thanks!

@aminweb2
Copy link
Author

aminweb2 commented Apr 8, 2022

in Speedcache i used just " Group CSS " and " Group JS" . if disable it , and then enabled just " Process CSS " --> make bad score in LCP and CLS . do you have any idea?

@tbela99
Copy link
Owner

tbela99 commented Apr 8, 2022

You already have it covered with merge Javascript and merge CSS options:

@aminweb2 aminweb2 closed this as completed Apr 8, 2022
Repository owner deleted a comment from aminweb2 Apr 9, 2022
Repository owner deleted a comment from aminweb2 Apr 9, 2022
@aminweb2
Copy link
Author

aminweb2 commented Apr 9, 2022

Note: when i disabled Gzip plugin i achieved 85% in mobile and 97% in desktop on google pagespeed,(i attached screen)
but when enabled Gzip plugin, it is down my score in google page speed. i want achieved upper 90% in mobile.

https://prnt.sc/9kdq1-iBZYWn
https://prnt.sc/uBMGmo2fF6lk

Thankful

Repository owner deleted a comment from aminweb2 Apr 9, 2022
Repository owner deleted a comment from aminweb2 Apr 9, 2022
Repository owner deleted a comment from aminweb2 Apr 11, 2022
@tbela99
Copy link
Owner

tbela99 commented Apr 21, 2022

  1. after an investigation I found that you are using JCH Optimizer. Using both plugins leads to some kind of corruption that will cause css and js files to fail to load, hence the partially loaded page. disabling JCH fixed that problem. As a rule, you should not mix multiple optimization plugins
  2. GIF files are not converted, probably because they are less than 800px width. I think this is probably an issue as I would expect images to be converted regardless their size

I noticed that you use animated GIF, I am not sure whether the conversion will preserve the animation. I will probably add a feature to enable conversion for individual file types.

were you expecting GIF images to be converted?

@tbela99 tbela99 reopened this May 4, 2022
@tbela99
Copy link
Owner

tbela99 commented May 6, 2022

I cannot reproduce the issue. I guess, it probably happened because many extensions were trying to do the same thing.

@tbela99 tbela99 closed this as completed May 6, 2022
@tbela99 tbela99 reopened this May 15, 2022
tbela99 added a commit that referenced this issue May 27, 2022
tbela99 added a commit that referenced this issue May 27, 2022
@aminweb2
Copy link
Author

thanks

tbela99 added a commit that referenced this issue Jun 1, 2022
tbela99 added a commit that referenced this issue Jun 18, 2022
… hit when file modification time changes too often
tbela99 added a commit that referenced this issue Jul 1, 2022
tbela99 added a commit that referenced this issue Jul 1, 2022
tbela99 added a commit that referenced this issue Jul 2, 2022
Fix image processing and CSS parsing/rendering issues

 #164 fix fatal error and notices when processing invalid images 58c2562
#164 fix multiple bugs 60fafa3
#164 change version number d58b45b
fix merge conflict #164 873f692
#164 incorrectly parsing @charset 82ed83a
#164 compute file hash only based on its content to avoid performance… af51a11
#164 revert the change. the hash computation method is configurable t… 79e7040
#164 fix CSS bugs 6823eac
load critical css generator only when required #164
@tbela99
Copy link
Owner

tbela99 commented Jul 2, 2022

fixed!

Thank you for your contribution.

@tbela99 tbela99 closed this as completed Jul 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants