At 4:46 PM -0500 4/28/07, Edward Vermillion wrote:
On Apr 28, 2007, at 12:21 PM, tedd wrote:
At 9:22 AM -0500 4/28/07, Edward Vermillion wrote:
It should, but instead try this:
$image_size = getimagesize($filename);
echo $image_size['mime'];
$image_size['mime'] ? Where did that come from?
On Apr 29, 2007, at 8:03 AM, tedd wrote:
At 4:46 PM -0500 4/28/07, Edward Vermillion wrote:
On Apr 28, 2007, at 12:21 PM, tedd wrote:
At 9:22 AM -0500 4/28/07, Edward Vermillion wrote:
It should, but instead try this:
$image_size = getimagesize($filename);
echo $image_size['mime'];
At 9:53 AM -0500 4/29/07, Edward Vermillion wrote:
On Apr 29, 2007, at 8:03 AM, tedd wrote:
The php functions that provide data about files, do just that. They
inspect the header of the file and report what they have found. How
you use them, is your business.
Well, from the example it
On 4/28/07, Tim [EMAIL PROTECTED] wrote:
On 21.04.2007 12:45, Alain Roger wrote:
Hi,
In my web application, end user is able to load images (png, jpeg,
gif,..) into database. I would like to know how can i detect
automatically the type of image (pnd, jpeg,...) ? i do not want to
check the
At 2:10 AM +0200 4/28/07, Tim wrote:
On 21.04.2007 12:45, Alain Roger wrote:
Hi,
In my web application, end user is able to load images (png, jpeg,
gif,..) into database. I would like to know how can i detect
automatically the type of image (pnd, jpeg,...) ? i do not want to
check the
On 4/28/07, tedd [EMAIL PROTECTED] wrote:
At 2:10 AM +0200 4/28/07, Tim wrote:
On 21.04.2007 12:45, Alain Roger wrote:
Hi,
In my web application, end user is able to load images (png, jpeg,
gif,..) into database. I would like to know how can i detect
automatically the type of image (pnd,
On Apr 28, 2007, at 6:54 AM, tedd wrote:
At 2:10 AM +0200 4/28/07, Tim wrote:
On 21.04.2007 12:45, Alain Roger wrote:
Hi,
In my web application, end user is able to load images (png, jpeg,
gif,..) into database. I would like to know how can i detect
automatically the type of image (pnd,
On 4/28/07, Edward Vermillion [EMAIL PROTECTED] wrote:
On Apr 28, 2007, at 6:54 AM, tedd wrote:
At 2:10 AM +0200 4/28/07, Tim wrote:
On 21.04.2007 12:45, Alain Roger wrote:
Hi,
In my web application, end user is able to load images (png, jpeg,
gif,..) into database. I would like to know
At 9:22 AM -0500 4/28/07, Edward Vermillion wrote:
It should, but instead try this:
$image_size = getimagesize($filename);
echo $image_size['mime'];
$image_size['mime'] ? Where did that come from?
I duno, maybe the manual.
http://us2.php.net/getimagesize -- 5th or 6th example down.
On 28.04.2007 10:39, Tijnema ! wrote:
First of all, i don't see any reason why this works better then other
functions, as it also relies on the magic bytes.
Second, for your switch, you should use the constants
(IMAGETYPE_GIF,IMAGETYPE_JPEG,...) instead of just using decimal
values.
Tijnema
If it's critical that you can detect the image type accurately, I'd suggest using ImageMagick's identify command. It
will tell you about everything that you'd ever want to know about an image. http://www.imagemagick.org/script/index.php
Post your question on their forum
On Apr 28, 2007, at 12:21 PM, tedd wrote:
At 9:22 AM -0500 4/28/07, Edward Vermillion wrote:
It should, but instead try this:
$image_size = getimagesize($filename);
echo $image_size['mime'];
$image_size['mime'] ? Where did that come from?
I duno, maybe the manual.
: how to detect type of image
On Sun, April 22, 2007 10:35 am, Jonathan wrote:
Alain Roger wrote:
Hi,
In my web application, end user is able to load images (png, jpeg,
gif,..)
into database.
I would like to know how can i detect automatically the type of
image (pnd,
jpeg,...) ?
i do not want
.
- Original Message -
From: Richard Lynch [EMAIL PROTECTED]
To: Jonathan [EMAIL PROTECTED]
Cc: php-general@lists.php.net
Sent: Wednesday, April 25, 2007 4:30 AM
Subject: Re: [PHP] Re: how to detect type of image
On Sun, April 22, 2007 10:35 am, Jonathan wrote:
Alain Roger wrote:
Hi,
In my web
Tijnema ! wrote:
I believe that mime_content_type does this, by reading a .magic file.
In a magic file, there are these described i believe. But how would
you detect (by a magic number) if a script is HTML or PHP? No way :P
mime_content_type is deprecated, use the FileInfo functions instead.
On Wednesday 25 April 2007 14:14, Richard Davey wrote:
Tijnema ! wrote:
I believe that mime_content_type does this, by reading a .magic file.
In a magic file, there are these described i believe. But how would
you detect (by a magic number) if a script is HTML or PHP? No way :P
On Wed, April 25, 2007 2:51 am, Satyam wrote:
Sorry I'm late to this thread, I don't know if it has been mentioned,
but
most files have a 'magic number' at the begining of the file, which
usually
reads as a couple of letters or more. I think EXE files start with
MZ, gifs
with GIFxx where
On Wed, April 25, 2007 7:00 am, Tijnema ! wrote:
On 4/25/07, Satyam [EMAIL PROTECTED] wrote:
Sorry I'm late to this thread, I don't know if it has been
mentioned, but
most files have a 'magic number' at the begining of the file, which
usually
reads as a couple of letters or more. I think
On Sun, April 22, 2007 10:35 am, Jonathan wrote:
Alain Roger wrote:
Hi,
In my web application, end user is able to load images (png, jpeg,
gif,..)
into database.
I would like to know how can i detect automatically the type of
image (pnd,
jpeg,...) ?
i do not want to check the extension
On Sun, April 22, 2007 12:14 pm, Tijnema ! wrote:
Yeah right, a time bomb with an image header :P
It should have an ELF header :) But then it would be detected by the
mime_content_type i guess.
mime_content_type would not detect, say, a PHP script embedded into
the comments section of a JPEG
Alain Roger wrote:
Hi,
In my web application, end user is able to load images (png, jpeg, gif,..)
into database.
I would like to know how can i detect automatically the type of image (pnd,
jpeg,...) ?
i do not want to check the extension because this is easily faked...
just by
renaming it.
Jonathan wrote:
Alain Roger wrote:
Hi,
In my web application, end user is able to load images (png, jpeg,
gif,..)
into database.
I would like to know how can i detect automatically the type of image
(pnd,
jpeg,...) ?
i do not want to check the extension because this is easily faked...
On Sunday 22 April 2007 17:35, Jonathan wrote:
Alain Roger wrote:
Hi,
In my web application, end user is able to load images (png, jpeg,
gif,..) into database.
I would like to know how can i detect automatically the type of image
(pnd, jpeg,...) ?
i do not want to check the
On 4/22/07, Myron Turner [EMAIL PROTECTED] wrote:
Jonathan wrote:
Alain Roger wrote:
Hi,
In my web application, end user is able to load images (png, jpeg,
gif,..)
into database.
I would like to know how can i detect automatically the type of image
(pnd,
jpeg,...) ?
i do not want to
Alain Roger escreveu:
Hi,
In my web application, end user is able to load images (png, jpeg, gif,..)
into database.
I would like to know how can i detect automatically the type of image (pnd,
jpeg,...) ?
i do not want to check the extension because this is easily faked...
just by
renaming it.
25 matches
Mail list logo