Jump to content
klikrzys

Problem with getting webp format URL

Recommended Posts

Hello processwire world!

Im having a little problem with getting my image in WEBP format.

$image = $pages->get('/')->images->first();
            echo $image->webp()->url();

Share this post


Link to post
Share on other sites

I dont know why i cant edit, my post (i send it in mistake). So once again:

Hello processwire world!

Im having a little problem with getting my image in WEBP format.

I in my config i have:

$config->imageSizerOptions('webpAdd'true); 
$config->contentTypes('webp''image/webp');

The code which fails

$image = $pages->get('/')->images->first();
echo $image->webp()->url(); // Fails: Error: Exception: Method Pageimage::webp does not exist or is not callable in this context
echo $image->url; // returns path correctly

 

I'd love to hear your opinion on that, im having really hard time with it 😞

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By jacmaes
      One of PW 3.010's major novelty was the introduction of Horst's new image resizing engine that uses ImageMagick. Now I understand that ImageMagick can convert images to Webp, the image format that Google says can reduce image size up to 34% compared to JPEG.
      Mozilla is apparently adding support to Firefox, and even the Safari team is playing with it, so it looks like Webp is soon going to be available in most major browsers. If Horst's module can be extended to add Webp conversion, that would be a great addition to PW's already very powerful image manipulation arsenal. 
      I'm currently using the free ImageEngine Lite to serve Webp images to supporting browsers, and the results are impressive. I routinely get images that are between 25 and 60% smaller compared to JPEG, with the same visual quality. I would love to eliminate the need to rely on a third-party service though. 
×
×
  • Create New...