Moderators mark1million Posted June 19, 2011 Moderators Report Posted June 19, 2011 Hi, For some reason this has just started to popup on my site when accepting pireps, Warning: imagecreatefromstring(): Empty string or invalid image in /core/common/PilotData.class.php on line 1016 so i went over and deleted all the signatures and recreated them all from the admin side, that produced the same error but the images are being created, any ideas what is causing this? Generating signatures... Generating signature for Mark Grant Warning: imagecreatefromstring(): Empty string or invalid image in /core/common/PilotData.class.php on line 1016. Those lines are here # Add the Rank image if (Config::Get('SIGNATURE_SHOW_RANK_IMAGE') == true && $pilot->rankimage != '') { $cws = new CodonWebService(); $rankimg = @$cws->get($pilot->rankimage); $rankimg = imagecreatefromstring($rankimg); <--- This is 1016 if (!$rankimg) { echo ''; } else { $r_width = imagesx($rankimg); $r_height = imagesy($rankimg); imagecopy($img, $rankimg, $width - $r_width - $xoffset, $yoffset, 0, 0, $r_width, $r_height); } } Nothing has changed that should have effected that, any clues would be appreciated. Quote
Moderators mark1million Posted June 19, 2011 Author Moderators Report Posted June 19, 2011 I have just deleted the background,png and reuploaded, then regenerated. Same problem but there is no rank image... As im typing this i think i know what the problem may be, i shortened the rank images from the full url to /images/xxx.png. I will let you know if that's the problem Quote
Moderators mark1million Posted June 19, 2011 Author Moderators Report Posted June 19, 2011 This is good talking to yourself Right yes that was the error....... Next question is can i change the code in the file to accept the /images/xxx.png instead of the full url path, example <?php echo SITE_URL?> Quote
TAV1702 Posted August 10, 2011 Report Posted August 10, 2011 This problem has come up again for another person and now I am getting it as well. It does not happen on my live site. Only on my test site. Quote
TAV1702 Posted August 10, 2011 Report Posted August 10, 2011 I shut the rank image off in config for signature and now I can accept pireps. However, no matter what size I set the avatar to in the config file, I can not add an avatar to a profile at all. v2.1.934-153-g822a0b9 Quote
fardly83 Posted October 20, 2017 Report Posted October 20, 2017 Anyone have this problem, ive made some modification.. hope this will not annoying you again.. hehehe please replace this file PilotData.class.zip Quote
Administrators ProAvia Posted March 4, 2018 Administrators Report Posted March 4, 2018 (edited) I am getting this same error when approving PIREPS or regenerating signatures Warning: imagecreatefromstring(): Empty string or invalid image in /core/common/PilotData.class.php on line 1016 Line 1016 reads: $rankimg = imagecreatefromstring($rankimg); I believe it is related to how 'rankimage' is listed in the ranks table of the DB. If the full URL (https://site_name.com/lib/images/ranks/rankimage.png) is listed, the rank image shows. If a relative URL (/lib/images/ranks/rankimage.png) is listed, the error shows. I have a relative URL set for the rank image - since changing the site over to HTTPS from HTTP. Rank images displayed elsewhere on the site show fine when using the relative URL. Is there something in the code that can be tweaked to allow this to work on the signature (badges) page? For now, I have commented out the entire "# Add the Rank image" section in the PilotData.class file (lines 1010-1026). This stops the error as the expense of not showing the rank image in the signature. I suppose I could set Config::Set('SIGNATURE_SHOW_RANK_IMAGE', true); from true to false (in local.config.php) to accomplish the same thing, but haven't tried that yet. Edited March 4, 2018 by ProAvia Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.