douchongbang6011 2013-01-13 17:08
浏览 23

为什么imagettftext返回负值是如此之大和不合理?

I am writing a very simple php about write text in a png file.

var_dump(imagettftext ($img, 36, 0, 100,100, 0x000000, './arial.ttf','test'));

I run it at Linux version 2.6.9 and php 5.2.17, but it doesn't work, nothing is written.Then I run it in Win7 and php 5.2.17, it write the text in image indeed.

And I found their output are different.

In Linux:

array(8) {
  [0]=>
  int(-1783466488)
  [1]=>
  int(42)
  [2]=>
  int(22134784)
  [3]=>
  int(0)
  [4]=>
  int(-1073754768)
  [5]=>
  int(127)
  [6]=>
  int(57)
  [7]=>
  int(1)
}

In Win7:

array(8) {
  [0]=>
  int(100)
  [1]=>
  int(102)
  [2]=>
  int(200)
  [3]=>
  int(102)
  [4]=>
  int(200)
  [5]=>
  int(66)
  [6]=>
  int(100)
  [7]=>
  int(66)
}

It is too weird in Linux, but I don't know why its output like this.

  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 如何在炒股软件中,爬到我想看的日k线
    • ¥15 51单片机中C语言怎么做到下面类似的功能的函数(相关搜索:c语言)
    • ¥15 seatunnel 怎么配置Elasticsearch
    • ¥15 PSCAD安装问题 ERROR: Visual Studio 2013, 2015, 2017 or 2019 is not found in the system.
    • ¥15 (标签-MATLAB|关键词-多址)
    • ¥15 关于#MATLAB#的问题,如何解决?(相关搜索:信噪比,系统容量)
    • ¥500 52810做蓝牙接受端
    • ¥15 基于PLC的三轴机械手程序
    • ¥15 多址通信方式的抗噪声性能和系统容量对比
    • ¥15 winform的chart曲线生成时有凸起