views:

90

answers:

2

Warning: I don't have much experience with CodeIgniter and I am updating a site originally create by another developer.

For some reason the CodeIgniter image class is creating thumbnails with a black pixel in the top left corner. Here is an example:

alt text

This only seems to happen in production (this site is being hosted on a super lame shared host). Thumbnails are created just fine on my OS X dev machine and my Ubuntu machine on Slicehost.

The code is pretty boilerplate, and from what I can tell the image library doesn't have a whole lot of options to screw up.

The options look like this:

$this->Image_Resize['image_library'] = 'gd2';
$this->Image_Resize['thumb_marker'] = 'thumb_';
$this->Image_Resize['create_thumb'] = TRUE;
$this->Image_Resize['maintain_ratio'] = TRUE;
$this->Image_Resize['width'] = 200;
$this->Image_Resize['height'] = 200;

And then the image is processed like this:

$this->Image_Resize['source_image'] = 'images/news/'.$image['file_name'];
$this->image_lib->initialize($this->Image_Resize);
$this->image_lib->resize();

Has anyone run into this issue before? Google & SO searches aren't getting me anywhere. These pixels are driving me nuts.

Update: As I was afraid, this didn't have anything to do with CodeIgniter. Something is screwy with the host's GD library and they don't support anything else. It's just weird that I can't find anyone else in the world who's had this problem.

Anyway my advice is to never, ever, ever use Doteasy. They are a nightmare.

+1  A: 

If it's the host that's causing it, maybe it's their image library that's having problems. The codeigniter Image Manipulation class is really just abstracted above that level, so you can actually choose what image library to use. Find out what ones are available from your host and maybe try a different one and see if the results are the same. Possible options for the ['image_library'] are:

  1. GD
  2. GD2
  3. ImageMagick
  4. NetPBM

Image Manipulation Class - Codeigniter Documentation

Matthew
Yep, it definitely looks like GD's fault. I have a simple resize function that I use and it has the exact same problem. Crap.
joeynelson
A: 

.$image['file_name'];

^---- see period

someguy