普通网友 2013-12-31 06:41
浏览 415

imageloadfont内存分配乘法将超过INT_MAX

Attempting to load a font using imageloadfont and am running into the following error:

imageloadfont(): gd warning: product of memory allocation multiplication would exceed INT_MAX, failing operation gracefully

Below is the code that is causing the problem. It's... pretty basic.

imageloadfont(APPPATH.'fonts/lora/lora-regular.ttf');

I'm using the FuelPHP framework, which I think is somehow to blame, as I can create a basic .php file in the localhost root (outside of framework) and loading of the above font file works fine.

  • 写回答

1条回答 默认 最新

  • dspx15491 2014-01-11 22:01
    关注

    Same mistake as GD error while try load font?

    There has also been a bug a libgd in early PHP 5.5 which caused this, and is since fixed. But since you say a test file doesn't have this problem, this can't be it?

    It is a standard PHP function call, so how could FuelPHP be to blame? It is not involved anywhere in that call. Are you sure that file is in ./fuel/app/fonts... ?

    Since FuelPHP (by default) fails immediately on any PHP error/warning/notice, it can be that you see this, but you miss the next warning: Warning: imageloadfont() [function.imageloadfont]: Error reading font, invalid font header in ... on line ..., or any other warning related to the filename not being correct.

    评论

报告相同问题?

悬赏问题

  • ¥50 如何用脚本实现输入法的热键设置
  • ¥20 我想使用一些网络协议或者部分协议也行,主要想实现类似于traceroute的一定步长内的路由拓扑功能
  • ¥30 深度学习,前后端连接
  • ¥15 孟德尔随机化结果不一致
  • ¥15 apm2.8飞控罗盘bad health,加速度计校准失败
  • ¥15 求解O-S方程的特征值问题给出边界层布拉休斯平行流的中性曲线
  • ¥15 谁有desed数据集呀
  • ¥20 手写数字识别运行c仿真时,程序报错错误代码sim211-100
  • ¥15 关于#hadoop#的问题
  • ¥15 (标签-Python|关键词-socket)