duananyu9231 2011-08-08 05:48
浏览 47
已采纳

(Wordpress)的Php图像调整大小/缩略图方法

My goal is to create a website for a client that needs the site to be heavily based as image galleries.

I am making the site through Wordpress so the client can upload the pictures through the friendly wordpress admin panel and then the site will display a parent image for the gallery and several thumbnails (scrolling with Jquery).

My question is for advice on good ways to resize the images as thumbnails. Currently I have some "hack-ish" code that simply changes the image dimensions, but as far as I know this doesn't reduce loading time and is quite inefficient.

Any ides on how to do it better? Possibly by using PHP GD? Thanks!

  • 写回答

3条回答 默认 最新

  • dty47696 2011-08-08 08:00
    关注

    Timthumb might be a good solution for this. The built-in wordpress media settings can only be set once for three different image options (thumbnail, medium and large). If you change the settings, anything already uploaded won't be readjusted. Most of the time this is acceptable, but for a photo heavy site, you might need more size options and dynamic adjustments. This simple php script will create any size image and save a cache copy for quick delivery. Lots of WordPress themes use it.

    http://code.google.com/p/timthumb/

    -- EDIT --

    So, you know that advice about TimThumb I gave yesterday? Well, check out the big news today. Just make sure you're using the latest version.

    http://ma.tt/2011/08/the-timthumb-saga/

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)

报告相同问题?

悬赏问题

  • ¥15 使用ESP8266连接阿里云出现问题
  • ¥15 被蓝屏搞吐了,有偿求帮解答,Ai回复直接拉黑
  • ¥15 BP神经网络控制倒立摆
  • ¥20 要这个数学建模编程的代码 并且能完整允许出来结果 完整的过程和数据的结果
  • ¥15 html5+css和javascript有人可以帮吗?图片要怎么插入代码里面啊
  • ¥30 Unity接入微信SDK 无法开启摄像头
  • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并