webP errors

12 posts by 3 authors in: Forums > CMS Builder
Last Post: November 30   (RSS)

By rez - November 13

Trying the latest version.  Is this a server issue or...

Unable to set image format
in /home/mong/public_html/cmsb/lib/image_functions.php on line 401. Call to undefined function imagecreatefromwebp()
in /home/mong/public_html/cmsb/lib/image_functions.php on line 40. Unable to set image format
in /home/mong/public_html/cmsb/lib/image_functions.php on line 401. Unable to set image format
in /home/mong/public_html/cmsb/lib/image_functions.php on line 401.

By rez - November 13

Oh no... I unchecked the webP option and I am still getting the error as if CMSB is still trying to convert. 

I can't upload any photos.

Call to undefined function imagecreatefromwebp()
in /home/mong/public_html/cmsb/lib/image_functions.php on line 40.

By rez - November 13 - edited: November 13

Update: although I had the option to convert to WebP turned back off, I still had webP as an upload option and was trying to upload a webP image.

I removed that file type from the upload filed possibilities and uploading jps are working.

I am not converting and I'm not sure if I am supposed to be able to at least upload and use webP? I would think so. This is the first time I have tried.

Please advise.

...unless it was still trying to convert because of a cache situation. I need this site done tonight so no more experimenting from me for now! 

By Michael - November 15

Hi rez,

The allowed file extensions are defined per upload field in the section editors/schema files so even though you turned off the "Use WebP" setting, the .webp file extension would still be listed as an allowed upload type and you'd still be able to select and upload .webp files (or any other allowed file extension).

Can you tell me a bit about your server environment?  OS, PHP version, etc.  It's possible your server doesn't have WebP support enabled.  You can verify this by checking the output of the phpinfo() function.  You should see WebP Support enabled screenshot attached.

Michael Sams
Programmer
interactivetools.com
Attachments:

gd-settings-screen.jpg 92K

By pault - November 24

Hi Michael,

I'm also getting this error.  I'm trying to upload a jpg image with the option to 'Automatically convert image uploads to WebP format' selected.

I've checked phpinfo() and get the same as your screenshot, WebP support is enabled.

OS is CentOS 7.9.2009, PHP is v8.0.13.

Regards, Paul.

By Michael - November 25

Hi Paul,

I have 2 quick troubleshooting steps for you to try.

#1 Create a new PHP file with the following code, upload it, and run it on your site.

<?php

if(function_exists('imagecreatefromwebp')) {
  echo 'imagecreatefromwebp() is available';
} else {
  echo 'imagecreatefromwebp() is NOT available';
}

?>

#2 Create a new section editor with an upload field, but uncheck all of the resize/thumbnail options.  Make sure the Use WebP option is enabled in the General Settings.  Then try to upload a JPG file in that editor.  We just want the JPG file to be uploaded and converted.  I want to see if the problem is specific to the imagecreatefromwebp() function or if none of the webp-related functions are working.

Thanks

Michael Sams
Programmer
interactivetools.com

By pault - November 29

Hi Michael,

Thanks for your reply.

So the first point returns 'imagecreatefromwebp() is available'

I've created the section with upload field, unchecked all of the options and ensured WebP is turned on and get the same error message as before:

Unable to set image format
in httpdocs/cmsAdmin/lib/image_functions.php on line 401.

Regards, Paul.

By Michael - November 29

Hi Paul,

Can you check the Imagick section on the phpinfo() output to see if WebP is listed there?  I've attached a sample output of what we're looking for here.

Thanks,

Michael

Michael Sams
Programmer
interactivetools.com

By pault - November 29

Hi Michael,

WEBP isn't listed there.  Is it possible to get CMS Builder to use GD instead of ImageMagick?  Or do you think there's another workaround?

Thanks, Paul.