diff options
author | Ilia Alshanetsky <iliaa@php.net> | 2002-11-12 16:14:18 +0000 |
---|---|---|
committer | Ilia Alshanetsky <iliaa@php.net> | 2002-11-12 16:14:18 +0000 |
commit | 619fc2c3c0a3d91e0c8853e0b5471744b97c6e5b (patch) | |
tree | 450eec73299c3f0c074b5e5a0dbea4c00fef3518 /ext/standard/image.c | |
parent | 976c16b7c8b9ac194d7306e9e7586d889e6d68df (diff) | |
download | php-git-619fc2c3c0a3d91e0c8853e0b5471744b97c6e5b.tar.gz |
Data manipulation (for big endian transformation) should occur after the
data has been read from file.
Diffstat (limited to 'ext/standard/image.c')
-rw-r--r-- | ext/standard/image.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ext/standard/image.c b/ext/standard/image.c index 806d11a276..34247e0bcb 100644 --- a/ext/standard/image.c +++ b/ext/standard/image.c @@ -174,14 +174,14 @@ static struct gfxinfo *php_handle_bmp (php_stream * stream TSRMLS_DC) result = (struct gfxinfo *) ecalloc (1, sizeof(struct gfxinfo)); php_stream_read(stream, temp, sizeof(temp)); - + php_stream_read(stream, (char*) &dim, sizeof(dim)); + #ifdef WORDS_BIGENDIAN dim.in_width = (dim.in_width & 0x000000FF) << 24 | (dim.in_width & 0x0000FF00) << 8 | (dim.in_width & 0x00FF0000) >> 8 | (dim.in_width & 0xFF000000) >> 24; dim.in_height = (dim.in_height & 0x000000FF) << 24 | (dim.in_height & 0x0000FF00) << 8 | (dim.in_height & 0x00FF0000) >> 8 | (dim.in_height & 0xFF000000) >> 24; dim.bits = (dim.bits & 0x00FF) << 8 | (dim.bits & 0xFF00) >> 8; #endif - php_stream_read(stream, (char*) &dim, sizeof(dim)); result->width = dim.in_width; result->height = dim.in_height; result->bits = dim.bits; |