CVS update: php3/functions
| From: | thies | Date: | Wed, 23 Dec 1998 11:33:21 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-3017@lists.php.net to get a copy of this message | ||
Date: Wednesday December 23, 1998 @ 6:33
Author: thies
Update of /repository/php3/functions
In directory asf:/u/temp/cvs-serv5726
Modified Files:
image.c
Log Message:
i hope the last fix for GetImageSize
Index: php3/functions/image.c
diff -c php3/functions/image.c:1.42 php3/functions/image.c:1.43
*** php3/functions/image.c:1.42 Wed Dec 23 05:51:16 1998
--- php3/functions/image.c Wed Dec 23 06:33:19 1998
***************
*** 26,32 ****
| Authors: Rasmus Lerdorf |
+----------------------------------------------------------------------+
*/
! /* $Id: image.c,v 1.42 1998/12/23 10:51:16 thies Exp $ */
/*
* Based on Daniel Schmitt's imageinfo.c which carried the following
* Copyright notice.
--- 26,32 ----
| Authors: Rasmus Lerdorf |
+----------------------------------------------------------------------+
*/
! /* $Id: image.c,v 1.43 1998/12/23 11:33:19 thies Exp $ */
/*
* Based on Daniel Schmitt's imageinfo.c which carried the following
* Copyright notice.
***************
*** 133,138 ****
--- 133,139 ----
#define M_SOF13 0xCD
#define M_SOF14 0xCE
#define M_SOF15 0xCF
+ #define M_SOI 0xD8
#define M_EOI 0xD9 /* End Of Image (end of datastream) */
#define M_SOS 0xDA /* Start Of Scan (begins compressed data) */
#define M_APP0 0xe0
***************
*** 221,231 ****
/* main loop to parse JPEG structure */
{
struct gfxinfo *result = NULL;
! int marker;
unsigned short in_width, in_height;
! fseek(fp, 2L, SEEK_CUR); /* position file pointer on first marker */
for (;;) {
marker = php3_next_marker(fp);
switch (marker) {
--- 222,238 ----
/* main loop to parse JPEG structure */
{
struct gfxinfo *result = NULL;
! unsigned int marker;
unsigned short in_width, in_height;
! fseek(fp, 0L, SEEK_SET); /* position file pointer on SOF */
+ if (getc(fp) != 0xFF) /* JPEG header... */
+ return NULL;
+
+ if (getc(fp) != M_SOI) /* JPEG header... */
+ return NULL;
+
for (;;) {
marker = php3_next_marker(fp);
switch (marker) {
***************
*** 255,261 ****
if (! info) /* if we don't want an extanded info -> return */
return result;
! }
break;
case M_APP0:
--- 262,270 ----
if (! info) /* if we don't want an extanded info -> return */
return result;
! } else {
! php3_skip_variable(fp);
! }
break;
case M_APP0:
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net