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 vs2022无法联网
  • ¥15 TCP的客户端和服务器的互联
  • ¥15 VB.NET操作免驱摄像头
  • ¥15 笔记本上移动热点开关状态查询
  • ¥85 类鸟群Boids——仿真鸟群避障的相关问题
  • ¥15 CFEDEM自带算例错误,如何解决?
  • ¥15 有没有会使用flac3d软件的家人
  • ¥20 360摄像头无法解绑使用,请教解绑当前账号绑定问题,
  • ¥15 docker实践项目
  • ¥15 利用pthon计算薄膜结构的光导纳