Re: [PHP] Image size?
Cheers! :) ""Albert"" <[EMAIL PROTECTED]> kirjoitti viestissä:[EMAIL PROTECTED] > William Stokes wrote: >> Can I get pixel sizes from a uploaded web applicable image with PHP? I >> mean width and height as pixels. If so How? > > http://www.php.net/manual/en/function.getimagesize.php > > HTH > > Albert > > -- > No virus found in this outgoing message. > Checked by AVG Free Edition. > Version: 7.1.371 / Virus Database: 267.14.17/226 - Release Date: > 2006/01/10 > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Image size?
William Stokes wrote: > Can I get pixel sizes from a uploaded web applicable image with PHP? I > mean width and height as pixels. If so How? http://www.php.net/manual/en/function.getimagesize.php HTH Albert -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.371 / Virus Database: 267.14.17/226 - Release Date: 2006/01/10 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Image size?
Will, William Stokes wrote: > Can I get pixel sizes from a uploaded web applicable image with PHP? I mean > width and height as pixels. If so How? http://www.php.net/getimagesize David -- David Grant http://www.grant.org.uk/ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] Image size?
I would say this is what you need http://uk2.php.net/manual/en/function.getimagesize.php Dan -Original Message- From: William Stokes [mailto:[EMAIL PROTECTED] Sent: 11 January 2006 12:22 To: php-general@lists.php.net Subject: [PHP] Image size? Hello, Can I get pixel sizes from a uploaded web applicable image with PHP? I mean width and height as pixels. If so How? Thanks -Will -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php __ NOD32 1.1356 (20060108) Information __ This message was checked by NOD32 antivirus system. http://www.eset.com -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] image size?
You probably need this to set the Content-length: header, don't you? I'd go into: ob_start() imagegif($imageResource); // or whatever type of image you're writing $blob = ob_get_clean(); unset($imageResource); // free the memory once you're not using the image // size in bytes = strlen()+1, due to the \0 or null character at the end. $byteSize = strlen($blob)+1; On Fri, 10 Sep 2004 10:02:42 -0700, Ed Lazor <[EMAIL PROTECTED]> wrote: > > -Original Message- > > On Friday 10 September 2004 06:59, Ed Lazor wrote: > > > Is there a way to get the size of an image created using the imagecreate > > > function? > > > > Size as in ... ? > > I was looking for the size of the image in bytes. > > -Ed > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
RE: [PHP] image size?
> -Original Message- > On Friday 10 September 2004 06:59, Ed Lazor wrote: > > Is there a way to get the size of an image created using the imagecreate > > function? > > Size as in ... ? I was looking for the size of the image in bytes. -Ed -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] image size?
Hi, Friday, September 10, 2004, 8:59:30 AM, you wrote: EL> Is there a way to get the size of an image created using the imagecreate EL> function? EL> The PHP manual section on image functions mentions getimagesize, but that EL> only works on remote or local files. EL> Thanks, EL> Ed Something like this may work if your after the output image size http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] image size?
On Friday 10 September 2004 06:59, Ed Lazor wrote: > Is there a way to get the size of an image created using the imagecreate > function? Size as in ... ? You do realise that *you* specify the size when using imagecreate()? > The PHP manual section on image functions mentions getimagesize, but that > only works on remote or local files. getimagesize() would not give you any info you don't already know when using imagecreate(). -- Jason Wong -> Gremlins Associates -> www.gremlins.biz Open Source Software Systems Integrators * Web Design & Hosting * Internet & Intranet Applications Development * -- Search the list archives before you post http://marc.theaimsgroup.com/?l=php-general -- /* Everything ends badly. Otherwise it wouldn't end. */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Image size ??
http://www.php.net/getimagesize Tom Wuyts wrote: Hi, Is there any way to know the size of an image ?? Thanx in advance, RCTycooner - Admin of The Silver Luna Forums http://www.wuyts.org/tom/phpbb2/ [EMAIL PROTECTED] - -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Image size, (not weight) help
here is something for you from php manual The getimagesize() function will determine the size of any GIF, JPG, PNG, SWF, SWC, PSD, TIFF, BMP or IFF image file and return the dimensions along with the file type and a height/width text string to be used inside a normal HTML IMG tag. Returns an array with 4 elements. Index 0 contains the width of the image in pixels. Index 1 contains the height. Index 2 is a flag indicating the type of the image: 1 = GIF, 2 = JPG, 3 = PNG, 4 = SWF, 5 = PSD, 6 = BMP, 7 = TIFF(intel byte order), 8 = TIFF(motorola byte order), 9 = JPC, 10 = JP2, 11 = JPX, 12 = JB2, 13 = SWC, 14 = IFF. These values correspond to the IMAGETYPE constants that were added in PHP 4.3. Index 3 is a text string with the correct height="yyy" width="xxx" string that can be used directly in an IMG tag. Friendship is always a sweet responsibility, never an opportunity. HaSeEb IqBaL. 0300-4258030 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] image size from text/font size
ImageFtBbox() can do this for you. Here's a portion of my code that uses it. >> $string="This is some text"; $pointsize = 15; $fontfile = getcwd()."/arial.ttf"; $string_size = ImageFtBbox($pointsize, 0, $fontfile, $string, array("linespacing" => 1)); $s_width = $string_size[4]; $s_height = $string_size[5]; $i_width = $s_width+2; $i_height = -1 * $s_height+2; $im = imagecreate($i_width,$i_height ); do whatever you want ot do with $im and destroy it finally HTH -R'twick - Original Message - From: "Brian V Bonini" <[EMAIL PROTECTED]> To: "PHP Lists" <[EMAIL PROTECTED]> Sent: Monday, February 03, 2003 10:57 AM Subject: [PHP] image size from text/font size > Trying to set the image size based on the amount if text/fontsize, > etc... Looked through a bunch of the functions but nothing is jumping > out at me. Does anyone have an example and or can point me to the > correct function(s) for this. > > > > > -- > PHP General Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php