dongtanhe4607 2010-11-14 23:34
浏览 76
已采纳

wordpress图像裁剪是否依赖于某些php库?

quick question:

i'm developing a wordpress theme for a client and have a heavy use of the_post_thumbnail function.

now, on my local dev site (running under MAMP) everything works like a charm and all the images get hard cropped to the correct size.

on the live dev site the cropping is completly ignored by wordpress. the output of the image is

.../wp-content/uploads/2010/06/07.jpg

but it should be

...wp-content/uploads/2010/06/07-160x230.jpg

after i changed my settings on the live/local dev site i used the ajax-thumbnail-rebuild plugin to rebuild all the images.. it just wont work on the live site.

now i read somewhere that the wordpress hard crop function relies on some php library calld php_hd2. can anyone confirm this?

//UPDATE

Thanks to Fredleys link it seems to be the GD library i meant. Which is installed on my server. sadly in the comments on the link people still have the problem despite GD being installed (which i can confirm for my server tomorrow).

But there is one interesting comment in there on the end of fredleys link:

wp_get_attachment_metadata() returns a hash without 'sizes' key. And that hash is returned by a call to apply_filters()

which sounds like my problem. i have all options in the backend available, nothing greyed out, and the images are available on the server.. they just won't get called on the frontend.

// UPDATE 2 & SOLVED

Ok. Found the Problem. The Server is running on Debian which has the gd_lib installed - BUT not the bundled Version. So there are things missing in this package. If you need to install the right version of gd_lib on Debian you'll find a nice solution here.

  • 写回答

1条回答 默认 最新

  • duanlaiyin2356 2010-11-14 23:41
    关注

    I think you mean gd2 and yes, you need to have it installed.

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

报告相同问题?

悬赏问题

  • ¥15 拟通过pc下指令到安卓系统,如果追求响应速度,尽可能无延迟,是不是用安卓模拟器会优于实体的安卓手机?如果是,可以快多少毫秒?
  • ¥20 神经网络Sequential name=sequential, built=False
  • ¥16 Qphython 用xlrd读取excel报错
  • ¥15 单片机学习顺序问题!!
  • ¥15 ikuai客户端多拨vpn,重启总是有个别重拨不上
  • ¥20 关于#anlogic#sdram#的问题,如何解决?(关键词-performance)
  • ¥15 相敏解调 matlab
  • ¥15 求lingo代码和思路
  • ¥15 公交车和无人机协同运输
  • ¥15 stm32代码移植没反应