version 1.1.1.2.2.1, 2013/07/22 01:44:16
|
version 1.1.1.5, 2014/06/15 20:03:57
|
Line 2
|
Line 2
|
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| PHP Version 5 | |
| PHP Version 5 | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| Copyright (c) 1997-2012 The PHP Group | | | Copyright (c) 1997-2014 The PHP Group | |
+----------------------------------------------------------------------+ |
+----------------------------------------------------------------------+ |
| This source file is subject to version 3.01 of the PHP license, | |
| This source file is subject to version 3.01 of the PHP license, | |
| that is bundled with this package in the file LICENSE, and is | |
| that is bundled with this package in the file LICENSE, and is | |
Line 30
|
Line 30
|
#include <unistd.h> |
#include <unistd.h> |
#endif |
#endif |
#include "php_image.h" |
#include "php_image.h" |
|
#ifdef PHP_WIN32 |
|
#include "win32/php_stdint.h" |
|
#endif |
|
|
#if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB) |
#if HAVE_ZLIB && !defined(COMPILE_DL_ZLIB) |
#include "zlib.h" |
#include "zlib.h" |
Line 112 static struct gfxinfo *php_handle_gif (php_stream * st
|
Line 115 static struct gfxinfo *php_handle_gif (php_stream * st
|
result->width = (unsigned int)dim[0] | (((unsigned int)dim[1])<<8); |
result->width = (unsigned int)dim[0] | (((unsigned int)dim[1])<<8); |
result->height = (unsigned int)dim[2] | (((unsigned int)dim[3])<<8); |
result->height = (unsigned int)dim[2] | (((unsigned int)dim[3])<<8); |
result->bits = dim[4]&0x80 ? ((((unsigned int)dim[4])&0x07) + 1) : 0; |
result->bits = dim[4]&0x80 ? ((((unsigned int)dim[4])&0x07) + 1) : 0; |
result->channels = 3; /* allways */ | result->channels = 3; /* always */ |
|
|
return result; |
return result; |
} |
} |
Line 159 static struct gfxinfo *php_handle_bmp (php_stream * st
|
Line 162 static struct gfxinfo *php_handle_bmp (php_stream * st
|
result->width = (((unsigned int)dim[ 5]) << 8) + ((unsigned int) dim[ 4]); |
result->width = (((unsigned int)dim[ 5]) << 8) + ((unsigned int) dim[ 4]); |
result->height = (((unsigned int)dim[ 7]) << 8) + ((unsigned int) dim[ 6]); |
result->height = (((unsigned int)dim[ 7]) << 8) + ((unsigned int) dim[ 6]); |
result->bits = ((unsigned int)dim[11]); |
result->bits = ((unsigned int)dim[11]); |
} else if (size > 12 && (size <= 64 || size == 108)) { | } else if (size > 12 && (size <= 64 || size == 108 || size == 124)) { |
result = (struct gfxinfo *) ecalloc (1, sizeof(struct gfxinfo)); |
result = (struct gfxinfo *) ecalloc (1, sizeof(struct gfxinfo)); |
result->width = (((unsigned int)dim[ 7]) << 24) + (((unsigned int)dim[ 6]) << 16) + (((unsigned int)dim[ 5]) << 8) + ((unsigned int) dim[ 4]); |
result->width = (((unsigned int)dim[ 7]) << 24) + (((unsigned int)dim[ 6]) << 16) + (((unsigned int)dim[ 5]) << 8) + ((unsigned int) dim[ 4]); |
result->height = (((unsigned int)dim[11]) << 24) + (((unsigned int)dim[10]) << 16) + (((unsigned int)dim[ 9]) << 8) + ((unsigned int) dim[ 8]); |
result->height = (((unsigned int)dim[11]) << 24) + (((unsigned int)dim[10]) << 16) + (((unsigned int)dim[ 9]) << 8) + ((unsigned int) dim[ 8]); |
|
result->height = abs((int32_t)result->height); |
result->bits = (((unsigned int)dim[15]) << 8) + ((unsigned int)dim[14]); |
result->bits = (((unsigned int)dim[15]) << 8) + ((unsigned int)dim[14]); |
} else { |
} else { |
return NULL; |
return NULL; |
Line 606 static struct gfxinfo *php_handle_jpc(php_stream * str
|
Line 610 static struct gfxinfo *php_handle_jpc(php_stream * str
|
|
|
/* JPEG 2000 components can be vastly different from one another. |
/* JPEG 2000 components can be vastly different from one another. |
Each component can be sampled at a different resolution, use |
Each component can be sampled at a different resolution, use |
a different colour space, have a seperate colour depth, and | a different colour space, have a separate colour depth, and |
be compressed totally differently! This makes giving a single |
be compressed totally differently! This makes giving a single |
"bit depth" answer somewhat problematic. For this implementation |
"bit depth" answer somewhat problematic. For this implementation |
we'll use the highest depth encountered. */ |
we'll use the highest depth encountered. */ |