Hi,
Does the image load on the post itself when visiting the website?
You might want to consider enabling the debug option from within wp-config.php so that more information can be given in the error. If the image isn’t loading on the website either then it may be due to a permissions or .htaccess issue.
I don’t think the theme’s functions.php has any impact since it is utilizing the built-in WordPress image editor which are located within the wp-includes dir.
Hi GOtrOOt, thanks for the quick reply.
Yes I am able to upload the images, then insert it in the blog. Most image features work well: resize, thumbnail, fearured image, meta data and so on… But on the “edit image” lightbox, I’m not able to crop or rotate the picture. It gives the error “could not load the preview…”
You can check image insertion here: http://www.royer-etienne.com/site/2016/11/14/wp-install-troubleshooting/
I will try tonight to enable the debug “option from within wp-config.php”, and keep you informed when it’s done.
Hi again,
I managed to add the debug option to wp-config.php, according to the chapter “Example wp-config.php for Debugging” of the Codex article https://codex.wordpress.org/Debugging_in_WordPress
As a result, a log file has been created, which you can consult here: http://www.royer-etienne.com/site/wp-content/debug.log.
As well, some changes have appeared on the admin, notably on the “Image preview” lightbox: there is no longer a preview of the image. See screenshot here: http://www.royer-etienne.com/site/wp-content/uploads/2016/11/Screenshot_20161115-214731.png
After trying twice to rotate the image, I get the following message in the debug.log file: [15-Nov-2016 18:42:05 UTC] PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 3456 bytes) in /var/www/vhosts/FilerWeb08/royer-etienne.com/httpdocs/site/wp-includes/class-wp-image-editor-gd.php on line 321
What do you think about this message?
Thanks in advance,
Ah yeah, I was worried about that. I noticed the image seems to be quite large in resolution and so it looks to be hitting the max php memory limit. This limitation is set forth in the php.ini file, but if you are on a shared hosting server then you won’t be able to increase it. I’d recommend asking your web host what the max php memory limit is, or you can check the limit yourself by creating a file in your website’s directory named phpinfo.php and then copy/pasting this code:
<?
phpinfo();
?>
After that, load the URL royer-etienne.com/phpinfo.php and then press Ctrl + F for your browser’s find feature and type in memory_limit, hit enter and it will take you to the portion of the page that shows the memory limit.
Since you are likely on a shared hosting platform and can’t change the value, I would just recommend scaling down the image to a smaller resolution if you want to modify it from within wp-admin. If you do not want to scale it down, then you would need to do the image modifications on your local computer to get around the php memory limitation.
So basically your image is too big and PHP does not have enough memory to load the large image.
-
This reply was modified 9 years, 5 months ago by
g0tr00t.
Hello,
Honestly I thought using smaller images was a good idea.
But now I have removed the debug mode from wp-content file, there is no longer a preview on the “edit image” lightbox π
See screenshot here (after upload of a small image 100x100px): http://www.royer-etienne.com/site/wp-content/uploads/2016/11/no-preview.png
Maybe it’s a separate error…
Any idea how to fix this?
Thanks
Did you manage the issue?
I have the same issue exactly…
Hello! HELP me pls somebody!!!
Has anyone fixed the problem when previewing photos does not appear during editing? I have the same problem. disabling plugins did not help, for memory costs 128 mb. in functions.php all is well tag -?> closed. what to do? I do not know. help me please