First I want to apologize for my terrible English:) and here is my question:
I just finished a script with different manipulations and resizing of images. For this project I am using GD lirbrary. The script is working just fine, but there is a little problem. Most of the images are passing with no problems at all, but in few cases the image failed. I checked the images for errors with some script for checking jpeg and png images and it appeared that the images are corrupt. The confusing part is that the pitures are looking perfectly fine and they may be open in every application for manipulation of images and image viewers. Even from the Apache server and any kind of browser.
Did anyone encounter such problem, and have any idea what is the problem in this case.
GD library image problem
Moderators: onion2k, General Moderators
There are a few image variations that GD can't handle. GD is very strict about things like that. For example, CMYK encoded Jpegs were only added very recently, some jpegs from mobile phone cameras add headers GD doesn't like, some slightly corrupted jpegs will open in Photoshop but not with GD .. it's annoying but there's no way around it. You just have to make sure your error checks are in place.
Weak mode for imagecreatefromjpeg
In the next version of PHP 5.1 (5.1.3), you will have an ini setting to be able to load corrupted JPEG:
gd.jpeg_ignore_warning
You can set it to true in your script using ini_set, by default it is set to false.
You can try it already using the php 5.1.3RC1 available here:
http://downloads.php.net/ilia/php-5.1.3RC1.tar.bz2
or using snaps.php.net
gd.jpeg_ignore_warning
You can set it to true in your script using ini_set, by default it is set to false.
You can try it already using the php 5.1.3RC1 available here:
http://downloads.php.net/ilia/php-5.1.3RC1.tar.bz2
or using snaps.php.net
-
jonwondering
- Forum Commoner
- Posts: 39
- Joined: Mon Mar 13, 2006 6:26 pm