dsyak22488 2018-04-02 21:49
浏览 42


I have this nice bit of code that generates a gif on the fly, where I place text over an existing image:

$pic_name = "test.gif";

$gif_image = imagecreatefromgif('background.gif');
$text_color = imagecolorallocate($gif_image, 0, 0, 0);
     $font_path = 'arial.ttf';
      $text = "E-Signed By:";
      imagettftext($gif_image, 6, 0, 72, 11, $text_color, $font_path, $text);

      imagegif($gif_image, $pic_name);


When I am done creating the image, I redirect to the next page:


<meta HTTP-EQUIV='REFRESH' content='0; url=https://emortgagecapital.com/mlo/agreement.php'>


The glitch is, on the redirect, for only a moment, I see a very long string of the GIF special characters, that looks something like this:


There is a lot more, but you get the idea.

Now, if I leave this bit of code in, the special characters don't display, but it kills the further execution of the script, and simply displays the image on screen:

header('Content-type: image/gif');

I tried placing the redirect as the header, but then the image never rendered and did not save to the server - the main reason for the script.

How do I run this script, and redirect, so the special characters do not 'flash' on the screen?

  • 写回答

1条回答 默认 最新

  • doucong3048 2018-04-02 21:54

    imagegif — Output image to browser or file


    your writing to the screen for no reason, just remove the line

    本回答被题主选为最佳回答 , 对您是否有帮助呢?



  • ¥15 vhdl+MODELSIM
  • ¥20 simulink中怎么使用solve函数?
  • ¥30 dspbuilder中使用signalcompiler时报错Error during compilation: Fitter failed,求解决办法
  • ¥15 gwas 分析-数据质控之过滤稀有突变中出现的问题
  • ¥15 没有注册类 (异常来自 HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))
  • ¥15 知识蒸馏实战博客问题
  • ¥15 用PLC设计纸袋糊底机送料系统
  • ¥15 simulink仿真中dtc控制永磁同步电机如何控制开关频率
  • ¥15 用C语言输入方程怎么
  • ¥15 网站显示不安全连接问题