dongta5621 2015-03-31 01:39
浏览 44

服务器在wp_generate_attachment_metadata调用时停止

I am using the Regenerate Thumbnails WordPress plugin, which works on smaller images but for anything that's larger then about 800K it says:

The resize request was abnormally terminated (ID 496). This is likely due to the image exceeding available memory or some other type of fatal error.

I have traced the error to line 372 of regenerate-thumbnails.php:

$metadata = wp_generate_attachment_metadata( $image->ID, $fullsizepath );

On small images this function call will return the result as it is suppose to, but on bigger images it will stop execution, resulting in an empty ajax response (the error message itself is created using JavaScript on line 285).

It seems weird that it would be a memory error because the memory limit is 120M. So my question is why dose this function sometimes work and other times crash. And more importantly, how to fix it.

  • 写回答

1条回答 默认 最新

  • dongmingxiang0312 2016-02-03 11:40
    关注

    We have same issue with large images (>8MB). Probably there is a bug on php gd library (see here).

    Solution 1 (tested)

    We solved adding this lines to wp-config.php file

    define('WP_MEMORY_LIMIT', '768M');
    define('WP_MAX_MEMORY_LIMIT', '768M');
    

    Solution 2 (not tested)

    You could try to switch from gd library to imagemagick

    评论

报告相同问题?

悬赏问题

  • ¥15 目详情-五一模拟赛详情页
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?
  • ¥15 加热介质是液体,换热器壳侧导热系数和总的导热系数怎么算
  • ¥100 嵌入式系统基于PIC16F882和热敏电阻的数字温度计
  • ¥15 cmd cl 0x000007b
  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line