An image could not be created from the given input
Permalink 1 user found helpful
having manually upgraded to 5810 the build was progressing well until we started getting
this error
An image could not be created from the given input
A few days ago this hit us but then everything recovered and was ok.
Then this evening it struck again and hasnt gone away.
The error is being thrown in this function.(See below) We have tried removing the svg logo but the issue persists. We are currently running with caching turned off. we have cleared the cache folder.
We have found that when not logged in we can browse the home page but any other page throws this error. When logged in we cant even load the home page.
The site is running on a fully patched version of Centos. Running nginx with php-fpm as the php processor. Before you start saying switch to nginx I have been running numerous versions of C5 on nginx with no issues.
Right now our final approach is to trash and rebuild the site at which point the client is likely to want to switch to another popular CMS
Can anyone suggest how we can at lleast get the site up again?
Thanks
private function doLoad($string, MetadataBag $metadata)
{
$resource = @imagecreatefromstring($string);
if (!is_resource($resource)) {
throw new RuntimeException('An image could not be created from the given input');
}
return $this->wrap($resource, new RGB(), $metadata);
}
this error
An image could not be created from the given input
A few days ago this hit us but then everything recovered and was ok.
Then this evening it struck again and hasnt gone away.
The error is being thrown in this function.(See below) We have tried removing the svg logo but the issue persists. We are currently running with caching turned off. we have cleared the cache folder.
We have found that when not logged in we can browse the home page but any other page throws this error. When logged in we cant even load the home page.
The site is running on a fully patched version of Centos. Running nginx with php-fpm as the php processor. Before you start saying switch to nginx I have been running numerous versions of C5 on nginx with no issues.
Right now our final approach is to trash and rebuild the site at which point the client is likely to want to switch to another popular CMS
Can anyone suggest how we can at lleast get the site up again?
Thanks
private function doLoad($string, MetadataBag $metadata)
{
$resource = @imagecreatefromstring($string);
if (!is_resource($resource)) {
throw new RuntimeException('An image could not be created from the given input');
}
return $this->wrap($resource, new RGB(), $metadata);
}
I now know the issue is related to C5 being unable to create the thumbnails for the file image thumbnails, C5 has full read/write access to this folder, and can create files in there when used from the UI just not when creating them on the fly. Our next area to look at is the infrastructure to see if there is anything strange about it.I will provide any further updates as more information comes to hand.
Hey there. I am not an uber programmer but I have come across this in three different instances and maybe one will at least spark an idea toward a fix.
One was an SVG and the error was thrown because it can't generate the thumbnails from that.
Two was when my client replaced an image with a PDF and again the system couldnt generate the thumbnails.
Three was when the image was way too big. I upped my memory limit substantially and fixed the issue but also making sure the original file is not huge (and also NOT saved at 300dpi regardless of the size) can help.
The way I end up fixing pages that I can't get to due to the error preventing it from loading is to comment out what you think is the offending code from whatever block you think is causing the error, upload it and then delete that block from the page if it loads. If it doesn't load then you know that wasn't the block causing the issue.
Since you mention it happens on all pages but your home page, I would look at block that you have in your sitewide content areas... things that are shared across pages. Logo, header image, social media icon (image), etc.
Like I said, not a programmer but I hope this helps.
One was an SVG and the error was thrown because it can't generate the thumbnails from that.
Two was when my client replaced an image with a PDF and again the system couldnt generate the thumbnails.
Three was when the image was way too big. I upped my memory limit substantially and fixed the issue but also making sure the original file is not huge (and also NOT saved at 300dpi regardless of the size) can help.
The way I end up fixing pages that I can't get to due to the error preventing it from loading is to comment out what you think is the offending code from whatever block you think is causing the error, upload it and then delete that block from the page if it loads. If it doesn't load then you know that wasn't the block causing the issue.
Since you mention it happens on all pages but your home page, I would look at block that you have in your sitewide content areas... things that are shared across pages. Logo, header image, social media icon (image), etc.
Like I said, not a programmer but I hope this helps.
HI Thanks for the reply, I went through all of those options very early this morning, but its useful to hear it from someone else. I have def. tracked the cause to not being able to create the thumbnails in the file manager. We are building a vanilla 8.1.0 site to verify that its not an issue with the theme or the other elements in the project.
Can you get to your dashboard? If so, the way I discover the "Client replaces image with PDF" issue was just scrolling through the file manager and looking for anything odd. In my case it was a file that showed a generic icon where the file manager thumbnail should have been. Also I think the size of the 'image' tipped me off as well.
I haven't tried this and I don't know what the long term ramifications are but what if you renamed the "files" directory. Wouldn't C5 just recreate a new (empty) one? Not sure if it would cause more errors or if since it cant find the suspect file it would quietly display nothing.
Be sure to post back what you find for posterity. I generally try to regardless of embarrassment level. :)
I haven't tried this and I don't know what the long term ramifications are but what if you renamed the "files" directory. Wouldn't C5 just recreate a new (empty) one? Not sure if it would cause more errors or if since it cant find the suspect file it would quietly display nothing.
Be sure to post back what you find for posterity. I generally try to regardless of embarrassment level. :)
That was part of the problem we couldn't get the site to load at all, the home page would sort of load but try to go anywhere else on the site and it would crash with this error, Try to login and the same. By fooling C5 to thinking that the filemanager thumbnails were built the site did function and you could login.
Exactly what caused this to start happening is unclear, it even started happening on my development environment, this was caused by adding a Native C5 image block onto the page.
Trying to load the image list resulted in an error "Image cannot be created..." doing anything after that was impossible.
We have finally found a solution albeit severe. By installing a clean build of 5.8.1.0 we seem to be able to build the site up again.
This may not be the only solution but I think it has worked for us. Doing this was feasible because the site wasn't live and was being constructed. I now have another 5.8.0.3 site that I have to upgrade. This site in question has a already been populated with content and so the upgrade process has to be carefully considered.
Exactly what caused this to start happening is unclear, it even started happening on my development environment, this was caused by adding a Native C5 image block onto the page.
Trying to load the image list resulted in an error "Image cannot be created..." doing anything after that was impossible.
We have finally found a solution albeit severe. By installing a clean build of 5.8.1.0 we seem to be able to build the site up again.
This may not be the only solution but I think it has worked for us. Doing this was feasible because the site wasn't live and was being constructed. I now have another 5.8.0.3 site that I have to upgrade. This site in question has a already been populated with content and so the upgrade process has to be carefully considered.
delete from linglingv1.FileImageThumbnailPaths;
Until the table is refilled with data and then causes the errors to throw again.
I have checked the path and I can see that the webserver has full write access to the folders.
So what would be causing this?