dongpou7275 2014-02-14 08:22
浏览 57

PHP GD(干预/图像):质量因服务器而异

I use the intervention/image library (which use GD) for my Laravel 4.1 project to resize some images (jpg and png). Everything is great on dev server, but in production, the quality of the thumbnails is very poor.

I thought it was a GD problem, but here are the installed versions, and they look similar to me:

dev : OSX Mavericks, php 5.4.19

  • GD Support : enabled
  • GD Version : bundled (2.1.0 compatible)
  • FreeType Support : enabled
  • FreeType Linkage : with freetype
  • FreeType Version : 2.4.10
  • T1Lib Support : enabled
  • GIF Read Support : enabled
  • GIF Create Support : enabled
  • JPEG Support : enabled
  • libJPEG Version : 8
  • PNG Support : enabled
  • libPNG Version : 1.6.2
  • WBMP Support : enabled
  • XBM Support: enabled

prod : Ubuntu 12.04, php 5.4.25

  • GD Support : enabled
  • GD Version : 2.0.36
  • FreeType Support : enabled
  • FreeType Linkage : with freetype
  • FreeType Version : 2.4.8
  • GIF Read Support : enabled
  • GIF Create Support : enabled
  • JPEG Support : enabled
  • libJPEG Version : unknown
  • PNG Support : enabled
  • libPNG Version : 1.2.46
  • WBMP Support : enabled

Am I missing something with those configs? Can somebody figures another problem?

Thanks a lot.

Edit: add code sample:

$image = Image::make(public_path("data/Bandeau/2/picto-sylvestre.png"))->resize(null, 70, true);

And as an example, thumb result on "prod" server is here (source image). On dev server, result is a lot better : example here (ok, I admit "a lot" is a little exaggerated, but on some image it's more obvious, and even on this one look at the thin lines around the eyes).

  • 写回答

1条回答 默认 最新

  • dongyi1982 2014-02-22 14:50
    关注

    I finally posted this issue at Ask Ubuntu, and it seems that php 5.4 is not compatible with GD 2.1 (@GlennRanders-Pehrson found out there's probably a major algorithm change between 2.0 and 2.1 -- see comments). It's strange, because I've got this config (Php 5.4 and GD 2.1) on my OSX dev machine.

    评论

报告相同问题?

悬赏问题

  • ¥15 WPF 大屏看板表格背景图片设置
  • ¥15 这个主板怎么能扩出一两个sata口
  • ¥15 不是,这到底错哪儿了😭
  • ¥15 2020长安杯与连接网探
  • ¥15 关于#matlab#的问题:在模糊控制器中选出线路信息,在simulink中根据线路信息生成速度时间目标曲线(初速度为20m/s,15秒后减为0的速度时间图像)我想问线路信息是什么
  • ¥15 banner广告展示设置多少时间不怎么会消耗用户价值
  • ¥16 mybatis的代理对象无法通过@Autowired装填
  • ¥15 可见光定位matlab仿真
  • ¥15 arduino 四自由度机械臂
  • ¥15 wordpress 产品图片 GIF 没法显示