0
votes

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
Can you narrow it down to a small bit of code that reproduces the problem? - Matt Gibson
@MattGibson of course: added in the post text. - Philippe
“and they look similar to me” – well if “similar” is the criterion by which you are trying to access this, then I’d say your images are probably “similar” as well, end of problem. Otherwise, you should acknowledge that “GD Version : bundled (2.1.0 compatible)” vs “GD Version : 2.0.36” and “libPNG Version : 1.6.2” vs “libPNG Version : 1.2.46” might be quite different and not very “similar” at all … - CBroe
@CBroe Well, excuse my great ignorance; note that I admit it the first time, writing "they look similar to me". I meant GD seems up-to-date (at least, nothing more came up with a apt-get install php5-gd), and that the difference of quality (which is quite important) seems too big (IMO) to be the result of a minor version change. But I can be wrong! I'll try to figure a way to install GD 2.1 on my ubuntu prod server, to see. - Philippe
@Philippe, could you also post the "dev" thumbnail? - Glenn Randers-Pehrson

1 Answers

1
votes

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.