Welcome Guest, Not a member yet? Register   Sign In
Image Manipulation Class: JPG Colour Problem
#1

[eluser]blizeH[/eluser]
Hi,

We've implemented Code Igniter's Image Manipulation Class and it works great, for the most part.

It's set to crop images and does that no problem for GIF and PNG file, and whilst it crops JPG files too, the colours are completely wrong, and it seems the larger the file is, the worst the colours are. For example a small 100px by 100px JPG will look relatively okay (but far from perfect) whereas if you upload a 200px by 200px it'll look slightly sepia, and anything about 300px would be completely black and white.

It's probably worth noting that the actual image being uploaded is fine as we just tested that, but as soon as it's run through the GD image manipulater all of the colours go wrong. Quality is set to 100, although the quality looks fine to be honest,it's not grainy, just colourless.

In summary:
- It crops the files (and resizes, flips, whatever) just fine, but the colours for JPG files are completely out.
- PNG and GIF files work perfectly; it only effects JPG files.
- The image being uploaded is also fine; it's only messing up when ran through the GD class.

Any suggestions would be fantastic, many thanks.
#2

[eluser]blizeH[/eluser]
Sorry to bump this, but I'm really at a bit of a loss as to why it's doing this...

Cheers!
#3

[eluser]Bogdan Tanase[/eluser]
Hi,

have you checked to see if the jpeg files are in RGB format? Maybe they're saved in CMYK and this might cause some issues?

I've used Image Class without any problems so far...

Perhaps you could attach a file, to test on other configurations?
#4

[eluser]blizeH[/eluser]
Hi,

Many thanks for the reply - turned out we were being silly and removed the 2 from gd2 whilst testing, set it to gd2 now and it's working a treat.

Cheers again
#5

[eluser]Unknown[/eluser]
Hi, I encountered the same issue as blizeH. The thing is, I do not have GD2 enable on my Web server. Is there a way to make it work using GD? Thanks.

Edit: I talked too fast. I managed to make it wok with GD2. I must have read the phpinfo() too quickly. My bad!




Theme © iAndrew 2016 - Forum software by © MyBB