Cornerstone Templates Issue with webp images

Like the heading says. I’ve made templates within Cornerstone. The templates contain webp images however I get an error when attempting to import the templates into another site.

I’ve tried this on different servers with different hosts but I still have the same issue.

Is there something I can do so as to import the webp images when importing templates?

Error in all sites is the same.
[24-Feb-2026 10:53:09 UTC] PHP Notice: exif_imagetype(): Error reading from /tmp/php8u6qv1tn4rds86glY4x! in /wp-includes/functions.php on line 3343
[24-Feb-2026 10:53:09 UTC] PHP Notice: exif_imagetype(): Error reading from /tmp/phpatrgph0mj28kbuwpBop! in /wp-includes/functions.php on line 3343

Hello @urchindesign,

Thanks for writing in!

The problem isn’t that the images are WebP. The error you’re seeing would happen with any image format (JPEG, PNG, etc.) given the same circumstances.

The error exif_imagetype(): Error reading from /tmp/php[random_string] indicates that PHP is trying to read a temporary file during the import process, but something is going wrong. Here are the most likely causes:

The exif_imagetype() function requires:

  • The PHP EXIF extension needs to be enabled
  • Proper file permissions to read temporary files
  • allow_url_fopen` enabled (if fetching remote images)

There’s a known issue with Cornerstone templates: they store attachment IDs instead of image URLs. When you export a template, it contains references to media library IDs that don’t exist on the destination site. This causes the import process to fail when it tries to locate these images.

Please check out this thread: Imported templates not bringing all their assets

Thanks.

Could you please confirm whether you have performed an equivalent test on your side. Specifically, creating a template that includes WebP images, exporting it, and then importing it into another site.

To clarify the behaviour I am observing:

  1. When the WebP images are replaced with PNG files, the template imports and functions correctly.
  2. File permissions do not appear to be the cause. I have verified this locally, including the use of custom temporary folders and files, together with a full review of permissions.
  3. PHP EXIF and allow_url_fopen are both enabled.

I have repeated this process across multiple environments, including a local Ubuntu server, standard shared hosting, LiteSpeed-based hosting, and several other hosting setups with different providers. The outcome is consistent.

On the local server, there are no security layers such as mod_security, and the site itself is a clean installation with only Pro and UpdraftPlus installed. No additional plugins or themes are present.

While I appreciate the reference provided, pointing to a forum discussion from nearly five years ago is not especially reassuring. A defect of that age would reasonably be expected to have been addressed. Furthermore, if the underlying cause were permissions or configuration, one would expect similar failures across all image formats rather than WebP alone.

PNG and JPEG images import without issue. This strongly indicates that permissions, extensions, and general server configuration are unlikely to be the root cause. The failure occurs only when WebP images are involved. If you can confirm that you have reproduced and tested this scenario independently, I will gladly continue investigating. However, given the range of servers and configurations already tested, the issue appears more closely related to the import process itself.

For completeness, the WebP images were generated in Photoshop and validated directly via SSH:

Command:
file banner.webp

Result:
RIFF (little-endian) data, Web/P image

Additionally, both GD and Imagick are installed with WebP support enabled.

As a further precaution, I explicitly allowed the MIME type within the child theme:

add_filter(‘upload_mimes’, function ($mimes) {
$mimes[‘webp’] = ‘image/webp’;
return $mimes;
});

Hello @urchindesign,

I can confirm that I have performed a template export/import with a WebP image in it.
https://www.dropbox.com/scl/fi/lixcjldjb3jakujpcjbnx/web-p-image-template.tco?rlkey=n8mu5bpceruz1hc179mhqt01p&st=3iyz3w4d&dl=0

The template was imported but the image WebP image failed. I will forward this to our developers for further investigation.

Please bear with us.

Can confirm this bug. I did some digging: all webp images imported via .tco templates were 9-byte files containing the literal string undefined. The images inside the .tco archive are valid (full-size webp files with correct RIFF headers), but the import code fails to write the binary data for webp files, writing the JS string undefined instead.

1 Like

Hello @admin_at_shift,

Thanks for chiming in. We already added this in our issue tracker.

Cheers.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.