Coder Social home page Coder Social logo

.webp support about phpwcms HOT 7 CLOSED

tomjak avatar tomjak commented on July 1, 2024
.webp support

from phpwcms.

Comments (7)

Chaffinch avatar Chaffinch commented on July 1, 2024 1

My hosting provider is KEI. For now, I'm staying on the older version >> phpWCMS 1.9.35 <<. phpWCMS 1.10.2 on KEI.pl servers , I don't succeed (I'm waiting for more stable Kei.pl software). Home.pl teลผ poop. Best regards from the south

from phpwcms.

slackero avatar slackero commented on July 1, 2024 1

I have searched a bit more and found a solution here (I hope). This works now for animated WebP too โ€“ just resizing is forbidden in combination with GD. An animated WebP example can be found here.

from phpwcms.

tomjak avatar tomjak commented on July 1, 2024 1

Thanks for explanation.
I switched to the webp format a year ago. Tests showed no problems. Frontend and backend works properly.
The webp format makes it easier to achieve better Core Web Vitals results. I will not go back to the jpg format.
Your fix works very well. Thank you very much. ๐Ÿ†

from phpwcms.

tomjak avatar tomjak commented on July 1, 2024

I checked clean installs of 1.9.35/6/7/8. This error does not occur until 1.9.36. This error has been present since 1.9.37. Test environment: php 8.2.12 (XAMPP)

from phpwcms.

Chaffinch avatar Chaffinch commented on July 1, 2024

Testing environment: php 8.2.12 (XAMPP) , O.K Let's wait for the knowledge to be supplemented. Regards

from phpwcms.

tomjak avatar tomjak commented on July 1, 2024

In the file "helper.image.php" (phpWCMS 1.9.37) I found the following code:

                // Animated WebP isn't supported yet, needs to be detected and rejected
                $webp_type = file_get_contents($path, false, null, 12, 4);
                if ($webp_type && strtoupper($webp_type) === 'VP8X') {
                    $this->set_error('imglib_webp_animated_not_supported');
                    return false;
                }

I removed this code and my problem disappeared. My .webp files are not animated. Perhaps Photoshop, when exporting the image to the .webp format, consists of several layers, added information or the extended version VP8X.

from phpwcms.

slackero avatar slackero commented on July 1, 2024

WebP support of the GD lib is still not perfect โ€“ the problem might be resizing, I haven't tested it yet finally. I cannot recommend using WebP as default image format in the backend because of the possible lack of support in older browsers. And whenever possible switch to ImageMagick or GraphicMagic from GD. I will implement another setting which will override the VP8X check.

from phpwcms.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.