Jump to content

Signature Create error


mark1million

Recommended Posts

  • Moderators

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.

Link to comment
Share on other sites

  • Moderators

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 :)

Link to comment
Share on other sites

  • 1 month later...
  • 1 year later...
  • 4 years later...
  • 4 months later...
  • Administrators

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 by ProAvia
Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...