[PHP] getimagesize()

2006-04-07 Thread Ed Curtis

 Can you call getimagesize() multiple times in one script? I'm trying to
use it multiple times but it only seems to work in the first loop I call
it in. I read something in the docs about it cacheing the results and
didn't know if this has something to do with it.

 I also tried creating an array out of the results I get from it but it
will only output the size values when it's building the array, never when
I try to loop back through it and output the values.

Thanks,

Ed

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] getimagesize()

2006-04-07 Thread John Nichel

Ed Curtis wrote:

 Can you call getimagesize() multiple times in one script? I'm trying to
use it multiple times but it only seems to work in the first loop I call
it in. I read something in the docs about it cacheing the results and
didn't know if this has something to do with it.


That 'something' you read was a user comment, not the manual.  AFAIK, 
getimagesize() *does no* cache.



 I also tried creating an array out of the results I get from it but it
will only output the size values when it's building the array, never when
I try to loop back through it and output the values.



Without seeing any code, I can only guess that you're doing something 
wrong, and need to fix it.


--
John C. Nichel IV
Programmer/System Admin (ÜberGeek)
Dot Com Holdings of Buffalo
716.856.9675
[EMAIL PROTECTED]

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] getimagesize()

2006-04-07 Thread tedd

At 9:14 AM -0500 4/7/06, Ed Curtis wrote:

 Can you call getimagesize() multiple times in one script? I'm trying to
use it multiple times but it only seems to work in the first loop I call
it in. I read something in the docs about it cacheing the results and
didn't know if this has something to do with it.

 I also tried creating an array out of the results I get from it but it
will only output the size values when it's building the array, never when
I try to loop back through it and output the values.

Thanks,

Ed


Ed:

Have you tried flush?

http://www.weberdev.com/flush

or

http://www.weberdev.com/ob_flush

I haven't used that before, but that's where I would start.

HTH's.

tedd
--

http://sperling.com

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] getimagesize not working on images from MYSQL

2005-07-16 Thread timothy johnson
$id = $_GET['id'];
$query = SELECT * FROM myPhotos WHERE photoId='$id';
$result = mysql_query($query);
$row = mysql_fetch_assoc($result);
$im = imagecreatefromstring($row[photoData]);

$size = getimagesize($im);

header('Content-Type: image/jpeg');
imagejpeg($im, NULL, 100);

I have this nice little php page to return my images from a database,
and everything runs fine except then I try to  use getimagesize, I
then get..

Warning: getimagesize(Resource id #4): failed to open stream:

do I have to do something else, this function works fine if I am using
it on a fileimage, why not an image from a database???

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] getimagesize not working on images from MYSQL

2005-07-16 Thread Burhan Khalid

timothy johnson wrote:

$id = $_GET['id'];
$query = SELECT * FROM myPhotos WHERE photoId='$id';
$result = mysql_query($query);
$row = mysql_fetch_assoc($result);
$im = imagecreatefromstring($row[photoData]);

$size = getimagesize($im);

header('Content-Type: image/jpeg');
imagejpeg($im, NULL, 100);

I have this nice little php page to return my images from a database,
and everything runs fine except then I try to  use getimagesize, I
then get..

Warning: getimagesize(Resource id #4): failed to open stream:

do I have to do something else, this function works fine if I am using
it on a fileimage, why not an image from a database???


Because the function expects a filename, not an image.  Read the 
documentation for getimagesize.


Regards,
Burhan

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] getimagesize() for image resources

2004-12-13 Thread Greg Donald
Does anyone know a way to get the size of an an image while it exists
as an image resource?  getimagesize() appears to work on image files,
but not image resources.   I need something that works on image
resources like those created with the PHP imagecreatefrom* functions.

I realize I can write the file to disk, then acquire the info.. that's
the step I'm trying to avoid if possible.

TIA..


-- 
Greg Donald
Zend Certified Engineer
http://gdconsultants.com/
http://destiney.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] getimagesize() not working between Dirs?

2004-06-18 Thread Theisen, Gary
Hi all,
 
I've got two web forms that handle photo uploads.  In one directory ...
getimagesize() works fine, in the other... it doesn't:
 
Directory that it works.

/php/webForm1.html  (has action to /php/submitForm.php)
/php/submitForm.php 

Directory that doesn't work.
/otherDir/webForm2.html (has action to /php/submitForm.php) //same as above.

 
the submitForm.php is the script that processes both webForms found in
different directory's.  Everything else on the form from
/otherDir/webForm2.html can be echo'd out fine.
excerpt from submitForm.php script:

if ($Photo) {
$photoSize=GetImageSize($Photo);
if ($photoSize[2]==1) {
   $photofinal=$uniqueID._1..gif;
   rename (lPhoto,$photofinal);
} elseif ($photoSize[2]==2) {
   $photofinal=$uniqueID._1..jpg;
   rename ($Photo,$photofinal); //WORKS HERE WITH 1ST EX.
} elseif ($photoSize[2]==3) {
   $photofinal=$uniqueID._1..png;
   rename (lPhoto,$photofinal);
} else {
   echo p p;
   echo strongYour photo must be in .gif, .jpg or .png format
only./strongp;
   echo a href=\javascript:history.back()\Back/a;
   exit;  //THIS IS WHERE IT'S EXITING EVEN THOUGH THE PHOTO IS TYPE
.jpg IN BOTH TEST CASES.
}
} //End if Photo.

submitForm.php has 775 permissions.
 
I think it has to do with the fact that the file is uploaded to forms in the
two different dir's.
But why would one work and the other not?
Any ideas??
 
Thanks in advance.


[PHP] getimagesize() to find type?

2004-01-16 Thread Matt Hedges
On Friday 16 January 2004 10:32, Matt Hedges wrote:

 if ($_FILES['imagefile']['type'] != image/pjpeg)

The 'type' in $_FILES is provided by the browser. IIRC only IE uses
image/pjpeg whilst other browsers use  image/jpeg. But regardless of
what
the browser sets, it is more reliable to get the image type from
getimagesize().


(1)  How would I do that (use getimagesize() instead to find type)?



(2)  Stupid question:  how do I say

if ($_FILES['imagefile']['type'] != image/pjpeg)

and add image/jpeg to that constraint?


thanks
Matt




-- 


-- 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] getimagesize() to find type?

2004-01-16 Thread Matt Matijevich
[snip]
(1)  How would I do that (use getimagesize() instead to find type)?
[/snip]

http://php.net/getimagesize


[snip]
(2)  Stupid question:  how do I say

if ($_FILES['imagefile']['type'] != image/pjpeg)

and add image/jpeg to that constraint?
[/snip]

there are many ways, I will show you an easy one

if ($_FILES['imagefile']['type'] != image/pjpeg 
$_FILES['imagefile']['type'] != image/jpeg)

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] getimagesize() MySQL Image Storage (Running functions on contents of variables)

2003-12-07 Thread Galen
I'm using a MySQL database to store images as BLOBs. I know how to 
handle all the MySQL stuff, it's easy, and really makes keeping track 
of files nice an clean. No permissions, no risk of getting things out 
of sync, finding stuff is as easy as SQL.

My question is about handling stuff once you pull it out of the 
database. When I store images in the database, I currently stash the 
format and the resolution in the database, which works but is a bit 
messy. I can't find any easy way to run getimagesize on the contents of 
a variable, not a file. I could write the image to a file if I needed 
to, but that can be slow and rather inelegant, I'd rather store the 
values in the DB. Any ideas on how I could use getimagesize or similar 
function to determine the format and resolution of the image in a 
variable?

I have had a similar problem with ftp uploading. There was no way to 
upload the contents of a variable, so I had to write everything to the 
disk, kind of annoying when I have 1,000 files. The script wasn't a 
very heavily used script nor could the public execute it, but it bugged 
me to no end. I think there are some other functions that also only 
operate on files and I've fought with them too.

Is there any kind of generic solution for this? Some kind of wrapper I 
could use to make a variable act like a reference to a file but 
actually be in memory only?

If this seems totally pointless, please tell me. But it seems like 
there should be a way for almost any function that runs off a file to 
run off the contents of a variable, it's just binary data.

Thanks,
Galen
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] getimagesize() MySQL Image Storage (Running functions on contents of variables)

2003-12-07 Thread Tom Rogers
Hi,

Sunday, December 7, 2003, 6:38:13 PM, you wrote:
G I'm using a MySQL database to store images as BLOBs. I know how to 
G handle all the MySQL stuff, it's easy, and really makes keeping track 
G of files nice an clean. No permissions, no risk of getting things out 
G of sync, finding stuff is as easy as SQL.

G My question is about handling stuff once you pull it out of the 
G database. When I store images in the database, I currently stash the 
G format and the resolution in the database, which works but is a bit 
G messy. I can't find any easy way to run getimagesize on the contents of 
G a variable, not a file. I could write the image to a file if I needed 
G to, but that can be slow and rather inelegant, I'd rather store the 
G values in the DB. Any ideas on how I could use getimagesize or similar 
G function to determine the format and resolution of the image in a 
G variable?

G I have had a similar problem with ftp uploading. There was no way to 
G upload the contents of a variable, so I had to write everything to the 
G disk, kind of annoying when I have 1,000 files. The script wasn't a 
G very heavily used script nor could the public execute it, but it bugged 
G me to no end. I think there are some other functions that also only 
G operate on files and I've fought with them too.

G Is there any kind of generic solution for this? Some kind of wrapper I 
G could use to make a variable act like a reference to a file but 
G actually be in memory only?

G If this seems totally pointless, please tell me. But it seems like 
G there should be a way for almost any function that runs off a file to 
G run off the contents of a variable, it's just binary data.

G Thanks,
G  Galen


Do the get sizes while it is still as a file after upload then save the size
info with the file in the db or use unpack to get the size from the raw data, it
is usually in the header somewhere.

-- 
regards,
Tom

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] GetImageSize-craziness

2003-07-01 Thread Bernhard Döbler
Hi,

I'd like to insert the URL of a picture, it's dimensions an an accompanying text into 
a database.
I enter the URL and the text in a form and post it to a script, the dimensions shall 
be retrieved by GetImageSize in the second script.
That worked well while all URLs were from another Server. I now tried to enter a URL 
that points to the very same server the script is running on. That strangely didn't 
work, GetImageSize gave no result.
When I entered a path relative to the script (img/picture.jpg) or the absolute path on 
the server (/home/user3456/www/img/picture.jpg) it worked very well, not when I 
entered the URL (http://domain/img/picture.jpg). As I said, it worked with 
http://domain-from-other-server/img/picture.jpg. 

Is there a reported bug in the PHP 4.3.2 implementation of GetImageSize?

Thanks,
Bernhard

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] @getimagesize

2003-06-04 Thread Diana Castillo
THANKS FOR all your help, I found out it was a custom error handling program
that we had that was putting out that error.

John Coggeshall [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Are you using PHP 4.3.2? Try upgrading :)

 John

 On Tue, 2003-06-03 at 05:23, Diana Castillo wrote:
  I use @getimagesize to resize pictures that I get from a url which comes
  from a database which is always changing.  The problem is that sometimes
the
  url does not contain the picture is is supposed to , and then I get the
  following error - I can't seem to get rid of this error, does anyone
know
  how to capture the error so it doesnt come out in a message like this?
  getimagesize(http://www.hotelresb2b.com/images/hoteles/P1KYHC014833.JPG)
  [function.getimagesize]: failed to create stream: HTTP request failed!
  HTTP/1.1 404 Not Found at ReservationManager.php line 299.
 
 
 
 
  --
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, visit: http://www.php.net/unsub.php
 
 --
 -~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~-
 John Coggeshall
 john at coggeshall dot org http://www.coggeshall.org/
 -~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~-



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] @getimagesize

2003-06-03 Thread Diana Castillo
I use @getimagesize to resize pictures that I get from a url which comes
from a database which is always changing.  The problem is that sometimes the
url does not contain the picture is is supposed to , and then I get the
following error - I can't seem to get rid of this error, does anyone know
how to capture the error so it doesnt come out in a message like this?
getimagesize(http://www.hotelresb2b.com/images/hoteles/P1KYHC014833.JPG)
[function.getimagesize]: failed to create stream: HTTP request failed!
HTTP/1.1 404 Not Found at ReservationManager.php line 299.




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] @getimagesize

2003-06-03 Thread electroteque
try an fopen to check if the file is there first ?

-Original Message-
From: Diana Castillo [mailto:[EMAIL PROTECTED]
Sent: Tuesday, June 03, 2003 7:24 PM
To: [EMAIL PROTECTED]
Subject: [PHP] @getimagesize


I use @getimagesize to resize pictures that I get from a url which comes
from a database which is always changing.  The problem is that sometimes the
url does not contain the picture is is supposed to , and then I get the
following error - I can't seem to get rid of this error, does anyone know
how to capture the error so it doesnt come out in a message like this?
getimagesize(http://www.hotelresb2b.com/images/hoteles/P1KYHC014833.JPG)
[function.getimagesize]: failed to create stream: HTTP request failed!
HTTP/1.1 404 Not Found at ReservationManager.php line 299.




--
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] @getimagesize

2003-06-03 Thread John Coggeshall
Are you using PHP 4.3.2? Try upgrading :)

John

On Tue, 2003-06-03 at 05:23, Diana Castillo wrote:
 I use @getimagesize to resize pictures that I get from a url which comes
 from a database which is always changing.  The problem is that sometimes the
 url does not contain the picture is is supposed to , and then I get the
 following error - I can't seem to get rid of this error, does anyone know
 how to capture the error so it doesnt come out in a message like this?
 getimagesize(http://www.hotelresb2b.com/images/hoteles/P1KYHC014833.JPG)
 [function.getimagesize]: failed to create stream: HTTP request failed!
 HTTP/1.1 404 Not Found at ReservationManager.php line 299.
 
 
 
 
 -- 
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, visit: http://www.php.net/unsub.php
 
-- 
-~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~-
John Coggeshall
john at coggeshall dot org http://www.coggeshall.org/
-~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~--~=~-

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] @getimagesize

2003-04-03 Thread Diana Castillo
even though I use a @getimagesize , I still get the following Warning when the image 
is not on the server.  I need to somehow not have the warning come out when there is 
no image there.

Warning: getimagesize(http://www.hotelresb2b.com/planos/PLHAHC019330.GIF) 
[function.getimagesize]: failed to create stream: HTTP request failed! HTTP/1.1 404 
Not Found at c:\inetpub\wwwroot\web\site\ReservationManager.php line 190.

I am using PHP Version 4.3.1
Thank you , Diana 


RE: [PHP] @getimagesize

2003-04-03 Thread Niklas Lampén
Check if file exists with file_exists().


Niklas


-Original Message-
From: Diana Castillo [mailto:[EMAIL PROTECTED] 
Sent: 3. huhtikuuta 2003 11:42
To: [EMAIL PROTECTED]
Subject: [PHP] @getimagesize


even though I use a @getimagesize , I still get the following Warning
when the image is not on the server.  I need to somehow not have the
warning come out when there is no image there.

Warning:
getimagesize(http://www.hotelresb2b.com/planos/PLHAHC019330.GIF)
[function.getimagesize]: failed to create stream: HTTP request failed!
HTTP/1.1 404 Not Found at
c:\inetpub\wwwroot\web\site\ReservationManager.php line 190.

I am using PHP Version 4.3.1
Thank you , Diana 

###
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] @getimagesize

2003-04-03 Thread Diana Castillo
according to the documentation on  php.net , This function will not work on
remote files; the file to be examined must be accessible via the server's
filesystem.

so it wont work for http

Niklas lampén [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Check if file exists with file_exists().


 Niklas


 -Original Message-
 From: Diana Castillo [mailto:[EMAIL PROTECTED]
 Sent: 3. huhtikuuta 2003 11:42
 To: [EMAIL PROTECTED]
 Subject: [PHP] @getimagesize


 even though I use a @getimagesize , I still get the following Warning
 when the image is not on the server.  I need to somehow not have the
 warning come out when there is no image there.

 Warning:
 getimagesize(http://www.hotelresb2b.com/planos/PLHAHC019330.GIF)
 [function.getimagesize]: failed to create stream: HTTP request failed!
 HTTP/1.1 404 Not Found at
 c:\inetpub\wwwroot\web\site\ReservationManager.php line 190.

 I am using PHP Version 4.3.1
 Thank you , Diana

 ###
 This message has been scanned by F-Secure Anti-Virus for Internet Mail.
 For more information, connect to http://www.F-Secure.com/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] @getimagesize

2003-04-03 Thread Niklas Lampén
Check the error reporting level on your server.
I tried @getimagesize(http://www.hotelresb2b.com/planos/Pasdasda.gif;)
and I got no error at all. One thing you could try is if
fopen(http://file;, r) success, but I don't know if it gives you this
stream creating error as well. Remember to close the file right away, if
you use that! :)


Niklas


-Original Message-
From: Diana Castillo [mailto:[EMAIL PROTECTED] 
Sent: 3. huhtikuuta 2003 13:42
To: [EMAIL PROTECTED]
Subject: Re: [PHP] @getimagesize


according to the documentation on  php.net , This function will not work
on
remote files; the file to be examined must be accessible via the
server's
filesystem.

so it wont work for http

Niklas lampén [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 Check if file exists with file_exists().


 Niklas


 -Original Message-
 From: Diana Castillo [mailto:[EMAIL PROTECTED]
 Sent: 3. huhtikuuta 2003 11:42
 To: [EMAIL PROTECTED]
 Subject: [PHP] @getimagesize


 even though I use a @getimagesize , I still get the following Warning
 when the image is not on the server.  I need to somehow not have the
 warning come out when there is no image there.

 Warning:
 getimagesize(http://www.hotelresb2b.com/planos/PLHAHC019330.GIF)
 [function.getimagesize]: failed to create stream: HTTP request failed!
 HTTP/1.1 404 Not Found at
 c:\inetpub\wwwroot\web\site\ReservationManager.php line 190.

 I am using PHP Version 4.3.1
 Thank you , Diana

 ###
 This message has been scanned by F-Secure Anti-Virus for Internet
Mail.
 For more information, connect to http://www.F-Secure.com/



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

###
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

###
This message has been scanned by F-Secure Anti-Virus for Internet Mail.
For more information, connect to http://www.F-Secure.com/

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] getimagesize

2003-04-01 Thread Sebastian
little problem with getimagesize function. I have a form upload and want the
images resized only if greater than 1024, if greater than 1024 then i want
it to resized, the problem is i do not know if getimagesize is getting the
form data:


FORM action= encType=multipart/form-data method=post name=sendform
INPUT name=MAX_FILE_SIZE type=hidden value=1000
INPUT maxLength=128 name=image type=file ACCEPT=image/jpeg, image/jpg
INPUT name=Submit type=submit value=Submit
INPUT name=Reset  type=reset value=Reset

// some if's ...

$imagewidth = getimagesize($form_data);

if($imagewidth[0] = 1024) {
$img_width  = 1024;
} else {
$img_width  = *;
}

// rest of the script to resize...

so an i doing it the proper way of getting $form_data?


cheers,
- Sebastian


RE: [PHP] getimagesize

2003-04-01 Thread daniel
wow wots this

INPUT maxLength=128 name=image type=file ACCEPT=image/jpeg, image/jpg

this is a first i never knew you could do that ?

$imagewidth = getimagesize($_FILES['image']);
= Original Message From Sebastian [EMAIL PROTECTED] =
little problem with getimagesize function. I have a form upload and want the
images resized only if greater than 1024, if greater than 1024 then i want
it to resized, the problem is i do not know if getimagesize is getting the
form data:


FORM action= encType=multipart/form-data method=post name=sendform
INPUT name=MAX_FILE_SIZE type=hidden value=1000
INPUT maxLength=128 name=image type=file ACCEPT=image/jpeg, image/jpg
INPUT name=Submit type=submit value=Submit
INPUT name=Reset  type=reset value=Reset

// some if's ...

$imagewidth = getimagesize($form_data);

if($imagewidth[0] = 1024) {
$img_width  = 1024;
} else {
$img_width  = *;
}

// rest of the script to resize...

so an i doing it the proper way of getting $form_data?


cheers,
- Sebastian



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] getimagesize

2003-04-01 Thread Sebastian
What? the ACCEPT? yes it can be done :)

http://www.w3.org/TR/REC-html32.html#rfc1867

cheers,
- Sebastian

- Original Message -
From: daniel [EMAIL PROTECTED]


| wow wots this
|
| INPUT maxLength=128 name=image type=file ACCEPT=image/jpeg, image/jpg
|
| this is a first i never knew you could do that ?
|
| $imagewidth = getimagesize($_FILES['image']);
| = Original Message From Sebastian [EMAIL PROTECTED] =
| little problem with getimagesize function. I have a form upload and want
the
| images resized only if greater than 1024, if greater than 1024 then i
want
| it to resized, the problem is i do not know if getimagesize is getting
the
| form data:
| 
| 
| FORM action= encType=multipart/form-data method=post
name=sendform
| INPUT name=MAX_FILE_SIZE type=hidden value=1000
| INPUT maxLength=128 name=image type=file ACCEPT=image/jpeg, image/jpg
| INPUT name=Submit type=submit value=Submit
| INPUT name=Reset  type=reset value=Reset
| 
| // some if's ...
| 
| $imagewidth = getimagesize($form_data);
| 
| if($imagewidth[0] = 1024) {
| $img_width  = 1024;
| } else {
| $img_width  = *;
| }
| 
| // rest of the script to resize...
| 
| so an i doing it the proper way of getting $form_data?
| 
| 
| cheers,
| - Sebastian
|
|
|
| --
| 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] getimagesize

2003-04-01 Thread daniel
well does this not work ? $imagewidth = getimagesize($_FILES['image']);

and i already have mimetypes checking in my modded pear uploader class, so it 
can send error handling bak

= Original Message From Sebastian [EMAIL PROTECTED] =
What? the ACCEPT? yes it can be done :)

http://www.w3.org/TR/REC-html32.html#rfc1867

cheers,
- Sebastian

- Original Message -
From: daniel [EMAIL PROTECTED]


| wow wots this
|
| INPUT maxLength=128 name=image type=file ACCEPT=image/jpeg, image/jpg
|
| this is a first i never knew you could do that ?
|
| $imagewidth = getimagesize($_FILES['image']);
| = Original Message From Sebastian [EMAIL PROTECTED] =
| little problem with getimagesize function. I have a form upload and want
the
| images resized only if greater than 1024, if greater than 1024 then i
want
| it to resized, the problem is i do not know if getimagesize is getting
the
| form data:
| 
| 
| FORM action= encType=multipart/form-data method=post
name=sendform
| INPUT name=MAX_FILE_SIZE type=hidden value=1000
| INPUT maxLength=128 name=image type=file ACCEPT=image/jpeg, image/jpg
| INPUT name=Submit type=submit value=Submit
| INPUT name=Reset  type=reset value=Reset
| 
| // some if's ...
| 
| $imagewidth = getimagesize($form_data);
| 
| if($imagewidth[0] = 1024) {
| $img_width  = 1024;
| } else {
| $img_width  = *;
| }
| 
| // rest of the script to resize...
| 
| so an i doing it the proper way of getting $form_data?
| 
| 
| cheers,
| - Sebastian
|
|
|
| --
| 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] getimagesize

2003-04-01 Thread Sebastian
no it doesn't work, it returns this: Warning: getimagesize(Array)
so its not getting the image from the form hmmm

cheers,
- Sebastian

- Original Message -
From: daniel [EMAIL PROTECTED]


| well does this not work ? $imagewidth = getimagesize($_FILES['image']);
|
| and i already have mimetypes checking in my modded pear uploader class, so
it
| can send error handling bak
|
| = Original Message From Sebastian [EMAIL PROTECTED] =
| What? the ACCEPT? yes it can be done :)
| 
| http://www.w3.org/TR/REC-html32.html#rfc1867
| 
| cheers,
| - Sebastian
| 
| - Original Message -
| From: daniel [EMAIL PROTECTED]
| 
| 
| | wow wots this
| |
| | INPUT maxLength=128 name=image type=file ACCEPT=image/jpeg,
image/jpg
| |
| | this is a first i never knew you could do that ?
| |
| | $imagewidth = getimagesize($_FILES['image']);
| | = Original Message From Sebastian [EMAIL PROTECTED] =
| | little problem with getimagesize function. I have a form upload and
want
| the
| | images resized only if greater than 1024, if greater than 1024 then i
| want
| | it to resized, the problem is i do not know if getimagesize is getting
| the
| | form data:
| | 
| | 
| | FORM action= encType=multipart/form-data method=post
| name=sendform
| | INPUT name=MAX_FILE_SIZE type=hidden value=1000
| | INPUT maxLength=128 name=image type=file ACCEPT=image/jpeg,
image/jpg
| | INPUT name=Submit type=submit value=Submit
| | INPUT name=Reset  type=reset value=Reset
| | 
| | // some if's ...
| | 
| | $imagewidth = getimagesize($form_data);
| | 
| | if($imagewidth[0] = 1024) {
| | $img_width  = 1024;
| | } else {
| | $img_width  = *;
| | }
| | 
| | // rest of the script to resize...
| | 
| | so an i doing it the proper way of getting $form_data?
| | 
| | 
| | cheers,
| | - Sebastian



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] getimagesize

2003-04-01 Thread Sebastian
nope, still get Warning: getimagesize(Array)
i've tried everything and it just doesn't get the form data :|

cheers,
- Sebastian

- Original Message - 
From: daniel [EMAIL PROTECTED]


| try removing that mime check , and put this to lower case encType 
| try INPUT name=image type=file for now
| , let me know


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] getimagesize

2003-04-01 Thread Sebastian
php 4.3.1.

I got it working, this is what i had to use:

$imagewidth = getimagesize($_FILES [image][tmp_name]);

if($imagewidth[0] = 1042) {
$img_width  = 1024;
} else {
$img_width = *;
} 

i guess i had to add the tmp_name :)
Thanks for the help.

cheers,
- Sebastian

- Original Message - 
From: daniel [EMAIL PROTECTED]


| what php version ? try putting $_SERVER['PHP_SELF'] in action aswell
| 
| = Original Message From Sebastian [EMAIL PROTECTED] =
| nope, still get Warning: getimagesize(Array)
| i've tried everything and it just doesn't get the form data :|
| 
| cheers,
| - Sebastian
| 
| - Original Message -
| From: daniel [EMAIL PROTECTED]
| 
| 
| | try removing that mime check , and put this to lower case encType
| | try INPUT name=image type=file for now
| | , let me know
| 
| 


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



Re: [PHP] getimagesize

2003-03-27 Thread Diana Castillo
no that doesnt work, anything else?
Dan Rossi [EMAIL PROTECTED] wrote in message
news:[EMAIL PROTECTED]
 @getimagesize ?

 -Original Message-
 From: Diana Castillo [mailto:[EMAIL PROTECTED]
 Sent: Thursday, March 27, 2003 5:04 AM
 To: [EMAIL PROTECTED]
 Subject: [PHP] getimagesize


 anyway to not get an error when doing getimagesize if you get this
response?
 HTTP request failed! HTTP/1.1 404 Not Found



 --
 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] getimagesize

2003-03-27 Thread Marek Kilimajer
Where you get this error from? Does it come from the browser or is it 
the script output?

Diana Castillo wrote:

anyway to not get an error when doing getimagesize if you get this response?
HTTP request failed! HTTP/1.1 404 Not Found


 



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] getimagesize

2003-03-26 Thread Diana Castillo
anyway to not get an error when doing getimagesize if you get this response?
HTTP request failed! HTTP/1.1 404 Not Found



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



RE: [PHP] getimagesize

2003-03-26 Thread Dan Rossi
@getimagesize ?

-Original Message-
From: Diana Castillo [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 27, 2003 5:04 AM
To: [EMAIL PROTECTED]
Subject: [PHP] getimagesize


anyway to not get an error when doing getimagesize if you get this response?
HTTP request failed! HTTP/1.1 404 Not Found



--
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] getimagesize() issues starting with PHP 4.3..

2003-02-26 Thread Jason DiCioccio


--On Wednesday, February 26, 2003 16:35 +1000 Tom Rogers 
[EMAIL PROTECTED] wrote:

Hi,

Wednesday, February 26, 2003, 2:27:10 PM, you wrote:
JD Can anyone reproduce this problem?
[...]
JD ?
JD
$retval=getimagesize('http://armanii.c.crosslink.net/arcticsilver/dtmsig4
.j JD pg');
JD echo $retval[0] $retval[1] $retval[3] \n\n\n;
?
[...]
Try
$retval=getimagesize(http://armanii.c.crosslink.net/arcticsilver/dtmsig4
.jpg,$info);
..seems to wake it up :) ..possible bug??

--
regards,
Tom
Thanks!  It would appear so, as it's documented as being an optional 
argument..  It works for me that way too, though.

Cheers,
-JD-
--
Jason DiCioccio - [EMAIL PROTECTED]  - Useless .sig
Open Domain Service - [EMAIL PROTECTED]- http://www.ods.org/
Ruby- [EMAIL PROTECTED]   - http://www.ruby-lang.org/
PGP Fingerprint - C442 04E2 26B0 3809 8357  96AB D350 9596 0436 7C08

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP] getimagesize() issues starting with PHP 4.3..

2003-02-25 Thread Jason DiCioccio
Can anyone reproduce this problem?

I am involved in running a large forum, and ever since our upgrade to PHP 
4.3.1, there have been fairly random issues with getimagesize().  It 
happens only on certain images it seems.  However, it wasn't happening with 
4.2.  When using the following code:

?
$retval=getimagesize('http://armanii.c.crosslink.net/arcticsilver/dtmsig4.j
pg');
echo $retval[0] $retval[1] $retval[3] \n\n\n;
?
I get echo'd back.  It does go an fetch the image according to a tcpdump, 
but something fails after that.  That is an example of one of the images 
that is failing.

I am running PHP 4.3.1 w/ Apache 1.3.27 on FreeBSD 4.7.  Is there something 
I'm missing?  Is this a bug as I think it is?

Thanks in advance!

-JD-

--
Jason DiCioccio - [EMAIL PROTECTED]  - Useless .sig
Open Domain Service - [EMAIL PROTECTED]- http://www.ods.org/
Ruby- [EMAIL PROTECTED]   - http://www.ruby-lang.org/
PGP Fingerprint - C442 04E2 26B0 3809 8357  96AB D350 9596 0436 7C08

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP] getimagesize() issues starting with PHP 4.3..

2003-02-25 Thread Tom Rogers
Hi,

Wednesday, February 26, 2003, 2:27:10 PM, you wrote:
JD Can anyone reproduce this problem?

JD I am involved in running a large forum, and ever since our upgrade to PHP 
JD 4.3.1, there have been fairly random issues with getimagesize().  It 
JD happens only on certain images it seems.  However, it wasn't happening with 
JD 4.2.  When using the following code:

JD ?
JD $retval=getimagesize('http://armanii.c.crosslink.net/arcticsilver/dtmsig4.j
JD pg');
JD echo $retval[0] $retval[1] $retval[3] \n\n\n;
?

JD I get echo'd back.  It does go an fetch the image according to a tcpdump, 
JD but something fails after that.  That is an example of one of the images 
JD that is failing.

JD I am running PHP 4.3.1 w/ Apache 1.3.27 on FreeBSD 4.7.  Is there something 
JD I'm missing?  Is this a bug as I think it is?

JD Thanks in advance!

JD -JD-

JD --
JD Jason DiCioccio - [EMAIL PROTECTED]  - Useless .sig
JD Open Domain Service - [EMAIL PROTECTED]- http://www.ods.org/
JD Ruby- [EMAIL PROTECTED]   - http://www.ruby-lang.org/

JD PGP Fingerprint - C442 04E2 26B0 3809 8357  96AB D350 9596 0436 7C08


Try
$retval=getimagesize(http://armanii.c.crosslink.net/arcticsilver/dtmsig4.jpg,$info);

..seems to wake it up :) ..possible bug??

-- 
regards,
Tom


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[PHP] getimagesize() with ftp-url?

2002-10-13 Thread Stefan Wessman

Hi!

Can anyone tell me if the getimagesize() function is supposed to work with
ftp-url's?
The PHP Manual states URL support was added in PHP 4.0.5, but maby that is
supposed to mean http-url's only?

The following is an expample of how i would like to be able to use
getimagesize():

?php
$size =
getimagesize(ftp://user:[EMAIL PROTECTED]/pictures/image.jpg;);

echo 'pre';
print_r($size);
echo '/pre';
?

This code yields the following errors in my log:

[12-Oct-2002 23:32:14] PHP Warning:  getimagesize(): php_hostconnect:
connect failed in getimagesize.php on line 2
[12-Oct-2002 23:32:14] PHP Warning:  getimagesize(...): failed to create
stream: FTP server reports 227 Entering Passive Mode (194.236.xxx.xxx in
getimagesize.php on line 2

Is this a bug, or is it a missing feature, or maby a documentation issue?
I've tried it on a few different ftp-servers, so i don't think that is the
problem.. but who knows?

Any thoghts would be appreciated.

/OnionMan



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] getimagesize() with ftp-url?

2002-10-13 Thread Marek Kilimajer

I remember I got these kinds of errors when I wanted to connect to a 
slow server, the last message was always something like port command 
successfull, and that was it. Try connection to localhost, if that works?

Stefan Wessman wrote:

Hi!

Can anyone tell me if the getimagesize() function is supposed to work with
ftp-url's?
The PHP Manual states URL support was added in PHP 4.0.5, but maby that is
supposed to mean http-url's only?

The following is an expample of how i would like to be able to use
getimagesize():

?php
$size =
getimagesize(ftp://user:[EMAIL PROTECTED]/pictures/image.jpg;);

echo 'pre';
print_r($size);
echo '/pre';
?

This code yields the following errors in my log:

[12-Oct-2002 23:32:14] PHP Warning:  getimagesize(): php_hostconnect:
connect failed in getimagesize.php on line 2
[12-Oct-2002 23:32:14] PHP Warning:  getimagesize(...): failed to create
stream: FTP server reports 227 Entering Passive Mode (194.236.xxx.xxx in
getimagesize.php on line 2

Is this a bug, or is it a missing feature, or maby a documentation issue?
I've tried it on a few different ftp-servers, so i don't think that is the
problem.. but who knows?

Any thoghts would be appreciated.

/OnionMan



  



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] getimagesize or loop pblm

2002-10-06 Thread arnaud gonzales

Hi all,
Does anybody can tell me why i have this error :Fatal error: Maximum
execution time of 5 seconds exceeded in photos2.php on line 28
whith this


$tab_img = array();
$tab_img_size = array();
for($i=0;$i=56;$i++){
$tab_img[$i] = 
images/tof/real_size/techp02_.$i..jpg;
$tab_img_size = array(
/*  line 28 */  $i = getimagesize($tab_img[$i]));
}

Is the getimagesize function too long for making it 56 times??
What do u think ?
In fact i want to get all the image size to make a popup link on the
thumnail at the real size of the image.Because images don't have the same
size and i want to have a clean window whith the popup.
I've ever tried this before :

$tab_img = array();
$tab_img_size = array();
for($i=0;$i=56;$i++){
$tab_img[$i] = 
images/tof/real_size/techp02_.$i..jpg;
$tab_img_size[$i] = getimagesize($tab_img[$i]);
}
Hope you understand.
TIA.
zeg



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] getimagesize or loop pblm

2002-10-06 Thread Rasmus Lerdorf

It could take a while.  Depends how fast your server's disk sub-system is.
Going to disk to stat and open an image and then parse through the initial
headers to get the sizing data can take some time.  I'd suggest caching
this data somewhere if you are going to need it on every request.

-Rasmus

On Mon, 7 Oct 2002, arnaud gonzales wrote:

 Hi all,
 Does anybody can tell me why i have this error :Fatal error: Maximum
 execution time of 5 seconds exceeded in photos2.php on line 28
 whith this


   $tab_img = array();
   $tab_img_size = array();
   for($i=0;$i=56;$i++){
   $tab_img[$i] = 
images/tof/real_size/techp02_.$i..jpg;
   $tab_img_size = array(
 /*line 28 */  $i = getimagesize($tab_img[$i]));
   }

 Is the getimagesize function too long for making it 56 times??
 What do u think ?
 In fact i want to get all the image size to make a popup link on the
 thumnail at the real size of the image.Because images don't have the same
 size and i want to have a clean window whith the popup.
 I've ever tried this before :

   $tab_img = array();
   $tab_img_size = array();
   for($i=0;$i=56;$i++){
   $tab_img[$i] = 
images/tof/real_size/techp02_.$i..jpg;
   $tab_img_size[$i] = getimagesize($tab_img[$i]);
   }
 Hope you understand.
 TIA.
 zeg



 --
 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] getimagesize or loop pblm

2002-10-06 Thread arnaud gonzales

So my code is clean ? There isn't a problem of infiny loop?
My server is free.fr.
How do u suggest i can cach the data?

-Message d'origine-
De : Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
Envoye : lundi 7 octobre 2002 03:07
A : arnaud gonzales
Cc : Php-General
Objet : Re: [PHP] getimagesize or loop pblm


It could take a while.  Depends how fast your server's disk sub-system is.
Going to disk to stat and open an image and then parse through the initial
headers to get the sizing data can take some time.  I'd suggest caching
this data somewhere if you are going to need it on every request.

-Rasmus

On Mon, 7 Oct 2002, arnaud gonzales wrote:

 Hi all,
 Does anybody can tell me why i have this error :Fatal error: Maximum
 execution time of 5 seconds exceeded in photos2.php on line 28
 whith this


   $tab_img = array();
   $tab_img_size = array();
   for($i=0;$i=56;$i++){
   $tab_img[$i] = 
images/tof/real_size/techp02_.$i..jpg;
   $tab_img_size = array(
 /*line 28 */  $i = getimagesize($tab_img[$i]));
   }

 Is the getimagesize function too long for making it 56 times??
 What do u think ?
 In fact i want to get all the image size to make a popup link on the
 thumnail at the real size of the image.Because images don't have the same
 size and i want to have a clean window whith the popup.
 I've ever tried this before :

   $tab_img = array();
   $tab_img_size = array();
   for($i=0;$i=56;$i++){
   $tab_img[$i] = 
images/tof/real_size/techp02_.$i..jpg;
   $tab_img_size[$i] = getimagesize($tab_img[$i]);
   }
 Hope you understand.
 TIA.
 zeg



 --
 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




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] getimagesize or loop pblm

2002-10-06 Thread Sascha Cunz

You can calculate the image size when adding the image (rather than when 
displaying it) and store the information in a file or a database. This file 
or database you could use for posting the right sizes for popup windows.

Sascha

Am Montag, 7. Oktober 2002 03:22 schrieb arnaud gonzales:
 So my code is clean ? There isn't a problem of infiny loop?
 My server is free.fr.
 How do u suggest i can cach the data?

 -Message d'origine-
 De : Rasmus Lerdorf [mailto:[EMAIL PROTECTED]]
 Envoye : lundi 7 octobre 2002 03:07
 A : arnaud gonzales
 Cc : Php-General
 Objet : Re: [PHP] getimagesize or loop pblm


 It could take a while.  Depends how fast your server's disk sub-system is.
 Going to disk to stat and open an image and then parse through the initial
 headers to get the sizing data can take some time.  I'd suggest caching
 this data somewhere if you are going to need it on every request.

 -Rasmus

 On Mon, 7 Oct 2002, arnaud gonzales wrote:
  Hi all,
  Does anybody can tell me why i have this error :Fatal error: Maximum
  execution time of 5 seconds exceeded in photos2.php on line 28
  whith this
 
 
  $tab_img = array();
  $tab_img_size = array();
  for($i=0;$i=56;$i++){
  $tab_img[$i] = 
images/tof/real_size/techp02_.$i..jpg;
  $tab_img_size = array(
  /*  line 28 */  $i = getimagesize($tab_img[$i]));
  }
 
  Is the getimagesize function too long for making it 56 times??
  What do u think ?
  In fact i want to get all the image size to make a popup link on the
  thumnail at the real size of the image.Because images don't have the same
  size and i want to have a clean window whith the popup.
  I've ever tried this before :
 
  $tab_img = array();
  $tab_img_size = array();
  for($i=0;$i=56;$i++){
  $tab_img[$i] = 
images/tof/real_size/techp02_.$i..jpg;
  $tab_img_size[$i] = getimagesize($tab_img[$i]);
  }
  Hope you understand.
  TIA.
  zeg
 
 
 
  --
  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




[PHP] getImageSize

2002-10-02 Thread Dan McCullough

anyone know what migth cause this error.  I changed the mode to 777, made sure that is 
was the
correct owner.group.  
getimagesize: Unable to open 'images/product/i3_berkeley_bed_2drw.jpg' for reading

=

Theres no such thing as a problem unless the servers are on fire!


__
Do you Yahoo!?
New DSL Internet Access from SBC  Yahoo!
http://sbc.yahoo.com

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] getImageSize

2002-10-02 Thread tuxen

check the permissions on the directory the image is in as well



On Wed, 2002-10-02 at 12:51, Dan McCullough wrote:
 anyone know what migth cause this error.  I changed the mode to 777, made sure that 
is was the
 correct owner.group.  
 getimagesize: Unable to open 'images/product/i3_berkeley_bed_2drw.jpg' for reading
 
 =
 
 Theres no such thing as a problem unless the servers are on fire!
 
 
 __
 Do you Yahoo!?
 New DSL Internet Access from SBC  Yahoo!
 http://sbc.yahoo.com
 
 -- 
 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




[PHP] getimagesize error

2002-09-20 Thread Sascha Braun

Please can somebody help my, why i get this errormessage:

Warning: getimagesize: Unable to open '../images/2002/11/jpg/' for reading. in 
C:\Webverzeichnis\docs\living_sports\living_sports\lsadmin\includes\image.handling.inc.php
 on line 852

While the echo $name says winter.jpg f.x.:

 echo $name;
  $size = getimagesize($path_to_dir.$images.$year.$month.$source.$name);
  if ($size[0]  $size[1]) {
   $faktor = ($size[1]/120);
   $newWidth = ($size[0]/$faktor);
   $command = 'convert -size 120x'.$newWidth.' 
'.$path_to_dir.$images.$year.$month.$source.$name.' -resize 120x'.$newWidth.' +profile 
* '.$path_to_dir.$images.$year.$month.$thumbs.$name;
   system($command);
   $Query = UPDATE bild_db SET thumb = '.$year.$month.$thumbs.$name.' WHERE 
bild_db.name = '.$name.';
   mysql_query($Query,$connect) or die(mysql_error());
  } else {
   $faktor = ($size[0]/120);
   $newHeight = ($size[1]/$faktor);
   $command = 'convert -size '.$newHeight.'x120 
'.$path_to_dir.$images.$year.$month.$source.$name.' -resize '.$newHeight.'x120 
+profile * '.$path_to_dir.$images.$year.$month.$thumbs.$name;
   system($command);
   $Query = UPDATE bild_db SET thumb = '.$year.$month.$thumbs.$name.' WHERE 
bild_db.name = '.$name.';
   mysql_query($Query,$connect) or die(mysql_error());
  }


Please gimme a hint

Sascha



[PHP] getimagesize with image in database

2002-09-01 Thread Chuck Barnett

Hi, I'm trying to get an image size from an image in a database.

here's my code
$imagesize = getimagesize(http://domain/image.jpg);
echo $imagesize[3];

but it returns nothing.  If I use a local file, without http  it works.

I have php 4.0.6

any suggestions.

Thanks,
Chuck 



Re: [PHP] getimagesize with image in database clairifation

2002-09-01 Thread Chuck Barnett

in my example I'm not pulling from a db.  It does not even work like I have
it in my example though.

Thanks,
Chuck
- Original Message -
From: Chuck Barnett [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Sunday, September 01, 2002 11:54 AM
Subject: [PHP] getimagesize with image in database


Hi, I'm trying to get an image size from an image in a database.

here's my code
$imagesize = getimagesize(http://domain/image.jpg);
echo $imagesize[3];

but it returns nothing.  If I use a local file, without http  it works.

I have php 4.0.6

any suggestions.

Thanks,
Chuck



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[PHP] GetImageSize and iptcparse problems

2002-02-06 Thread Steven Jarvis

I've read the manual, and I'm still stuck, partially due to the manual 
itself. This is the first time I've dealt with this particular issue 
(parsing IPTC info from JPEGs).

The example provided in the manual entry on GetImageSize:

?php
 $size = GetImageSize (testimg.jpg,$info);
 if (isset ($info[APP13])) {
 $iptc = iptcparse ($info[APP13]);
 var_dump ($iptc);
 }
?

Gives me the following error on php 4.0.6:

Warning: Call-time pass-by-reference has been deprecated - argument 
passed by value; If you would like to pass it by reference, modify the 
declaration of getimagesize(). If you would like to enable call-time 
pass-by-reference, you can set allow_call_time_pass_reference to true in 
your INI file. However, future versions may not support this any longer.

I don't understand what I need to pass to getImageSize in order to 
extract the IPTC info.

Can someone point me in the right direction with this?

Thanks,

Steven



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] GetImageSize and iptcparse problems

2002-02-06 Thread Jason Wong

On Thursday 07 February 2002 05:02, Steven Jarvis wrote:
 I've read the manual, and I'm still stuck, partially due to the manual
 itself. This is the first time I've dealt with this particular issue
 (parsing IPTC info from JPEGs).

 The example provided in the manual entry on GetImageSize:

 ?php
  $size = GetImageSize (testimg.jpg,$info);
  if (isset ($info[APP13])) {
  $iptc = iptcparse ($info[APP13]);
  var_dump ($iptc);
  }
 ?

 Gives me the following error on php 4.0.6:

 Warning: Call-time pass-by-reference has been deprecated - argument
 passed by value; If you would like to pass it by reference, modify the
 declaration of getimagesize(). If you would like to enable call-time
 pass-by-reference, you can set allow_call_time_pass_reference to true in
 your INI file. However, future versions may not support this any longer.

What this error is saying is that you cannot use $info ie:

 GetImageSize (testimg.jpg,$info);

 I don't understand what I need to pass to getImageSize in order to
 extract the IPTC info.

You can try:

 GetImageSize (testimg.jpg, $info);

 Can someone point me in the right direction with this?

If the above doesn't work, then you probably have to change your php.ini as 
per error message.


For more info on pass-by-reference see the chapter References Explained  
Passing by Reference.


-- 
Jason Wong - Gremlins Associates - www.gremlins.com.hk

/*
We gave you an atomic bomb, what do you want, mermaids?
-- I. I. Rabi to the Atomic Energy Commission
*/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




Re: [PHP] GetImageSize Problem

2001-12-19 Thread Mirek Novak



You can get this information from header of this image file. Structure
of BMP is here: http://www.dcs.ed.ac.uk/home/mxr/gfx/2d/BMP.txt (found
with google.com)
M.N.
---
[EMAIL PROTECTED] wrote:
Hello, I'm PHPer from Korea.
I have a problem with GetImageSize function.
I wanted to know some information about BMP image.
So, I tried to use GetImageSize on PHP 4.0.5 , Linux.
But, it didn't work. GetImageSize function returned nothing.
Then, I tried it on PHP 4.0.6, Windows2000.
Ooops.. I worked.. -.-;
I looked the php.net manual, but there's no mention about
my problem.
Does anyone know how to solve this problem.. ?



Do you know @MESSAGE? Powered by 3R
Soft, Inc.


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]






[PHP] GetImageSize Problem

2001-12-18 Thread seoz




Hello, I'm PHPer from Korea.

I have a problem with GetImageSize function.
I wanted to know some information about BMP image.
So, I tried to use GetImageSize on PHP 4.0.5 , Linux.
But, it didn't work. GetImageSize function returned nothing.
Then, I tried it on PHP 4.0.6, Windows2000.
Ooops.. I worked.. -.-;

I looked the php.net manual, but there's no mention about my problem.

Does anyone know how to solve this problem.. ?



Do you know @MESSAGE? Powered by 3R Soft, Inc.





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


[PHP] GetImageSize()

2001-08-02 Thread John Hurleston

I started to use this command in my soft about 3 months ago and all went
well, I've had to do some re-organising and I changed the varable that holds
the old image root, to the new image root and ofcouse moved the images, but
now my GetImageSize() doesn't work any more,

http://www.guia-marbella.com

shows two No's basicaly indicating that GetImageSize is not working

  Here is the code:

?
print (  td width=\175\ valign=\top\ align=\left\ \n);

  if ($Menu_Foto1 != )
{
  $Photo_Size = GetImageSize ($GS_Control_Gallery/$Menu_Foto1);
  $Photo_Size_W = $Photo_Size[0];
  $Photo_Size_H = $Photo_Size[1];


if ($Photo_Size_W  180)
  {
$Temp_Size1 = ($Photo_Size_W - 180 );
$Temp_Size2 = (180 / $Photo_Size_W);
$Photo_Size_W = ($Photo_Size_W - $Temp_Size1);
$Photo_Size_H = ($Photo_Size_H * $Temp_Size2);
  }

  print (  img border=\0\
src=\$GS_Control_Gallery/$Menu_Foto1\ width=\$Photo_Size_W\
height=\$Photo_Size_H\ \n);
  print (  brbr \n);

}

  if ($Menu_Text1 != )
{
  print (font size=\$GS_Text_Font_Size\
face=\$GS_Text_Font\ color=\$GS_Text_Colour\\n);

if ($Menu_Title1 != )
  {
print (b$Menu_Title1/bbr \n);
  }
  print ($Menu_Text1br \n);
  print (/font\n);
  print (br \n);
}

  if ($Menu_More1 != )
{
  print (  iba href=\$Menu_More1\font
size=\$GS_Text_Font_Size\ face=\$GS_Text_Font\
color=\$Menu_Link_Colour\More.../b/font/a/i \n);
}

print (  /td \n);
?

Just by the piont that you can see the images there means that the image
location is correct.
So, I dont know...

Can anyone shine any light...


John Hurleston





-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] GetImageSize

2001-07-10 Thread Matt Simpson

We are having some serious issues with GetImageSize in PHP 4.0.x and i'm
wondering if anyone else had similar issues and solved or came up with a
different solution.

For some reason, at random and without warning, the function just seems to
stop working and does nothing but wait and timeout at 80 seconds. When you
go to the page say www.somedomain.com it just waits and does not load
anything for 80 seconds, and when it does, the images that use GetImageSize
do not load.

--
Matt Simpson
Design Coordinator
[EMAIL PROTECTED]
Online Creator Inc

780 Midpark Dr. Suites 105  107
Phone: 613.389.8618
Fax: 613.389.7491
Toll Free: 1.877.768.9327

This transmission is intended only for the correct addressee(s).  It may
contain privileged or confidential information.  Any unauthorized
disclosure, copying or retransmission is strictly prohibited.  If you have
received this transmission in error, please so confirm by sending us a
return email copy immediately, then delete the original message.
  Thank you.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] getimagesize w/ URL conflicting messages ...

2001-07-03 Thread [EMAIL PROTECTED]

http://www.php.net/manual/en/function.getimagesize.php

Here it seems to say that you can use getimagesize with a URL

But here 

http://www.phpbuilder.com/mail/php-developer-list/282/2426.php


it says you can't 

Any comments? is it just in newer versions?

Susan



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] getimagesize (Bug? or error in PhP?)

2001-05-23 Thread bram

Hi,

I want to have the width and the height of an image, if I place the image on
my server then it works buth if i want to load the image from another server
then I have errors, is this a bug in PHP, or is there another solution.
Because in the php.net manual they use Getimagesize() too for loading an
image from another site
(http://www.php.net/manual/en/function.getimagesize.php)
Please post a message if you know what I must do, thanks
bram

html
head
 titleGetImageSize/title
/head
body
?
$url=http://toontime.dk/cli/pt09.jpg;;
$imagehw = GetImageSize($url);
$imagewidth = $imagehw[0];
$imageheight = $imagehw[1];
print$imagewidth ;
print$imageheight ;
?
/body
/html




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] getimagesize (Bug? or error in PhP?)

2001-05-23 Thread bram

I' have version Version 4.0.4pl1


 Hi,

 I want to have the width and the height of an image, if I place the image
on
 my server then it works buth if i want to load the image from another
server
 then I have errors, is this a bug in PHP, or is there another solution.
 Because in the php.net manual they use Getimagesize() too for loading an
 image from another site
 (http://www.php.net/manual/en/function.getimagesize.php)
 Please post a message if you know what I must do, thanks
 bram

 html
 head
  titleGetImageSize/title
 /head
 body
 ?
 $url=http://toontime.dk/cli/pt09.jpg;;
 $imagehw = GetImageSize($url);
 $imagewidth = $imagehw[0];
 $imageheight = $imagehw[1];
 print$imagewidth ;
 print$imageheight ;
 ?
 /body
 /html




 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] getimagesize (Bug? or error in PhP?)

2001-05-23 Thread Bert

On 23 May 2001 04:15:09 -0700, [EMAIL PROTECTED] (bram) wrote:

I' have version Version 4.0.4pl1


URL support was added in PHP 4.0.5 !
So it won't work with 4.04...

Bert

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] GetImageSize() problem...

2001-05-15 Thread Edwin van Elk


Eric Knudstrup [EMAIL PROTECTED] schreef in bericht
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 I am having an issue with 4.0.5 where the following code snippet:

 $orig = imagecreatefromjpeg($tmp);
 echo 'orig x: ' . imagesx($orig) . ' orig y: ' .
imagesy($orig)
 . 'br';
 $orig_size = getimagesize($tmp);
 echo orig x:  $orig_size[0] orig y: $orig_size[1] br;

 produces:

 orig x: 1200 orig y: 1600
 orig x: orig y:

 The test image was produced from my Canon S100 and the Canon image
 downloading software.

I might have the same problem with PHP 4.0.5 (win2k). Some of the images
from my Kodak DC-260 digital camera, are not recognized correctly by
getimagesize for some reason..

Example:

?php
   $imagehw =
GetImageSize(http://maasdelta.eve-software.com/foto/kinderspelen/P0007811.J
PG);
   print $imagehw . BR;
   print $imagehw[0]  . BR;
   print $imagehw[1]  . BR;
   print $imagehw[3]  . BR;
?
IMG SRC=http://maasdelta.eve-software.com/foto/kinderspelen/P0007811.JPG;

This image is just a normal JPG (1536x1024) taken directly from my camera.

GetImageSize however, thinks it's dimensions are: 51088x38655 ??? This also
happens when I access the file from a local drive.

Anyone got a clue ?

Edwin.



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] GetImageSize() problem...

2001-05-15 Thread Rasmus Lerdorf

 I might have the same problem with PHP 4.0.5 (win2k). Some of the images
 from my Kodak DC-260 digital camera, are not recognized correctly by
 getimagesize for some reason..

 Example:

 ?php
$imagehw =
 GetImageSize(http://maasdelta.eve-software.com/foto/kinderspelen/P0007811.J
 PG);
print $imagehw . BR;
print $imagehw[0]  . BR;
print $imagehw[1]  . BR;
print $imagehw[3]  . BR;
 ?
 IMG SRC=http://maasdelta.eve-software.com/foto/kinderspelen/P0007811.JPG;

 This image is just a normal JPG (1536x1024) taken directly from my camera.

 GetImageSize however, thinks it's dimensions are: 51088x38655 ??? This also
 happens when I access the file from a local drive.

 Anyone got a clue ?

I had a look at this problem in the plane coming back from Europe
yesterday.  There is definitely a problem in the code.  The
php_handle_jpeg() function is not hitting the right markers for some
reason.  My brain was too oxygen-deprived to see the cause, but I will try
to get to it.

As a workaround for now I suggest you use the read_exif_data() function
instead.  Compile using --enable-exif.  That will definitely get you the
right dimensions along with many other properties.

-Rasmus


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] GetImageSize

2001-05-09 Thread Joseph Bannon

For some reason, I can get the image image size for an image on the local
machine, but remotely give me an error


My code

?php
$size = GetImageSize (images/title.gif);
echo size: $size[0]p;
echo size: $size[1]p;
echo size: $size[2]p;
echo size: $size[3]p;
$size = GetImageSize
(http://www.picpage.com/users/ka/kaurisma1331/images/image0.jpg;); 
echo size: $size[0]p;
echo size: $size[1]p;
echo size: $size[2]p;
echo size: $size[3]p;
?



Output


size: 310
size: 80
size: 1
size: width=310 height=80
Warning: Unable to open
http://www.picpage.com/users/ka/kaurisma1331/images/image0.jpg in
web/imagetest.php on line 13
size: 
size: 
size: 
size: 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] GetImageSize

2001-05-09 Thread Moody

What version of PHP are you using? According to the manual:
URL support was added in PHP 4.0.5

Moody


Joseph Bannon [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
 For some reason, I can get the image image size for an image on the local
 machine, but remotely give me an error


 My code

 ?php
 $size = GetImageSize (images/title.gif);
 echo size: $size[0]p;
 echo size: $size[1]p;
 echo size: $size[2]p;
 echo size: $size[3]p;
 $size = GetImageSize
 (http://www.picpage.com/users/ka/kaurisma1331/images/image0.jpg;);
 echo size: $size[0]p;
 echo size: $size[1]p;
 echo size: $size[2]p;
 echo size: $size[3]p;
 ?



 Output


 size: 310
 size: 80
 size: 1
 size: width=310 height=80
 Warning: Unable to open
 http://www.picpage.com/users/ka/kaurisma1331/images/image0.jpg in
 web/imagetest.php on line 13
 size:
 size:
 size:
 size:

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] GetImageSize

2001-05-09 Thread Joseph Bannon

 What version of PHP are you using? According to the manual:
 URL support was added in PHP 4.0.5



Oh, I have 4.0.4. I need to upgrade don't I?!?

Thanks, 
J

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] GetImageSize

2001-05-09 Thread Richard

It appears like so.


Joseph Bannon [EMAIL PROTECTED] wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
  What version of PHP are you using? According to the manual:
  URL support was added in PHP 4.0.5



 Oh, I have 4.0.4. I need to upgrade don't I?!?

 Thanks,
 J

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] getimagesize

2001-05-07 Thread todd kennedy

i'm having some odd problems with getimagesize.

sometimes it works, sometimes it doesn't.

this is the code i'm calling it with:
$p_size = getimagesize($photos[$start]);

where $photos[$start] has the value im000301.jpg.  the php file and the
image file are located in the same directory.

this does work however:
$p_size = getimagesize(im000301.jpg);


any clues?

thanks.
todd


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] GetImageSize() problem...

2001-05-03 Thread Eric Knudstrup

I think that was the first thing I tried.
It might have something to do with the actual image itself.
Images created with th PHP/GD routines come up with acceptable results.

Thanks,

Eric

Quoting Dan Lowe [EMAIL PROTECTED]:

 Previously, Eric Knudstrup said:
  I am having an issue with 4.0.5 where the following code snippet:
  
  $orig = imagecreatefromjpeg($tmp);
  echo 'orig x: ' . imagesx($orig) . ' orig y: ' .
 imagesy($orig)
  . 'br';
  $orig_size = getimagesize($tmp);
  echo orig x:  $orig_size[0] orig y: $orig_size[1]
 br;
 
 have you tried this as the last line instead?
 
 echo 'orig x: ' . $orig_size[0] . ' orig y: ' . $orig_size[1] .
 'br';
 
  -dan
 
  produces:
  
  orig x: 1200 orig y: 1600
  orig x: orig y:
  
  The test image was produced from my Canon S100 and the Canon image
  downloading software.
  
  Can anyone help?
  
  Thanks,
  
  Eric
  
  
  -- 
  PHP General Mailing List (http://www.php.net/)
  To unsubscribe, e-mail: [EMAIL PROTECTED]
  For additional commands, e-mail: [EMAIL PROTECTED]
  To contact the list administrators, e-mail:
 [EMAIL PROTECTED]
 
 -- 
 All good technology should be used to piss off people's parents. -Neil
 Gaiman
 

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] getimagesize question

2001-02-04 Thread PHPBeginner.com

$size = getimagesize($Frame."top.gif");

I think you should read this :
http://www.zend.com/zend/tut/using-strings.php


Sincerely,

 Maxim Maletsky
 Founder, Chief Developer

 PHPBeginner.com (Where PHP Begins)
 [EMAIL PROTECTED]
 www.phpbeginner.com


-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Sunday, February 04, 2001 5:28 AM
To: [EMAIL PROTECTED]
Subject: [PHP] getimagesize question


Hi,

I`m using the following to get the image size...

$size = getimagesize("$Frame");

My problem is $Frame can`t contain the full name of the image for various
reasons, so what I need to do is somehow add the rest, something along the
lines of this...

$size = getimagesize("$Frame'top.gif'");

If $Frame = Hello then the getimagesize would perform on Hellotop.gif but as
yet it isn`t working anyone have a suggestion? I have tried a few variations
such as

("$Frame" + "top.gif")
("$Frame\"top.gif\"")
($Frame"top.gif")

Thanks
Ade

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] getimagesize question

2001-02-03 Thread Website4S

Hi,

I`m using the following to get the image size...

$size = getimagesize("$Frame");

My problem is $Frame can`t contain the full name of the image for various 
reasons, so what I need to do is somehow add the rest, something along the 
lines of this...

$size = getimagesize("$Frame'top.gif'");

If $Frame = Hello then the getimagesize would perform on Hellotop.gif but as 
yet it isn`t working anyone have a suggestion? I have tried a few variations 
such as

("$Frame" + "top.gif")
("$Frame\"top.gif\"")
($Frame"top.gif")

Thanks
Ade

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




RE: [PHP] getimagesize question

2001-02-03 Thread Dundee \(Roland\)

To get the imagesize

$PictSize = GetImageSize ($file_image_path . $PictName);
$pictW = $PictSize[0];
$pictH = $PictSize[1];



-Original Message-
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]
Sent: Saturday, 3 February 2001 9:28 PM
To: [EMAIL PROTECTED]
Subject: [PHP] getimagesize question


Hi,

I`m using the following to get the image size...

$size = getimagesize("$Frame");

My problem is $Frame can`t contain the full name of the image for various
reasons, so what I need to do is somehow add the rest, something along the
lines of this...

$size = getimagesize("$Frame'top.gif'");

If $Frame = Hello then the getimagesize would perform on Hellotop.gif but as
yet it isn`t working anyone have a suggestion? I have tried a few variations
such as

("$Frame" + "top.gif")
("$Frame\"top.gif\"")
($Frame"top.gif")

Thanks
Ade

--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]


-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] getimagesize question

2001-02-03 Thread Tom Meininger

Hi Ade,

To combine strings, you simply use a period.  For example:

$image = $frame . "top.gif";

If $frame is "hello", then $image will come out as "hellotop.gif".

Hope that helped...

Regards,

Tom
_
Tomeeboy.com - Your place for the best stuff on the net!
Visit http://www.tomeeboy.com today!


- Original Message -
From: [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, February 03, 2001 3:27 PM
Subject: [PHP] getimagesize question


 Hi,

 I`m using the following to get the image size...

 $size = getimagesize("$Frame");

 My problem is $Frame can`t contain the full name of the image for various
 reasons, so what I need to do is somehow add the rest, something along the
 lines of this...

 $size = getimagesize("$Frame'top.gif'");

 If $Frame = Hello then the getimagesize would perform on Hellotop.gif but
as
 yet it isn`t working anyone have a suggestion? I have tried a few
variations
 such as

 ("$Frame" + "top.gif")
 ("$Frame\"top.gif\"")
 ($Frame"top.gif")

 Thanks
 Ade

 --
 PHP General Mailing List (http://www.php.net/)
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]
 To contact the list administrators, e-mail: [EMAIL PROTECTED]




-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] getimagesize question

2001-02-03 Thread Website4S

Tom,

Thanks for that, worked a treat.

Ade

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




[PHP] GetImageSize problem

2001-01-21 Thread Sue Bailey

I have a bunch of images living on one ISP's server which I want to use
on another page on another ISP's server, with GetImageSize. I RTFM, and
see "The filename needs to be either relative to the current document,
or an absolute filesystem path. Thus absolute URL paths will not work."
which is absolutely correct - I get an error msg "cannot open file".
$DOCUMENT_ROOT  is obviously no use to me - does anyone know any way
round this?

TIA, 

Sue

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] GetImageSize problem

2001-01-21 Thread Romulo Roberto Pereira

Hello!

First - some ISP block you from get files from their server by a httpd
request (that is what php does... I think!). To be sure if this is set or
not, in the other ISP (not the one that the images are) write a simple html
like this:

htmlheadtitleloading images between servers/title/headbody
brbr
img src="http://Domain/ImagesDir/ImagesName.gif"
/body/html

In "http://Domain/ImagesDir/ImagesName.gif" be sure to put the correct
domain and location of the image.

This should show the image... If not you could have two problems: the link
is wrong or the filter is set.

Imagine this - I have a web site in an ISP with my domain like:
http://www.mydomain.com and all the paths are gting the images from a free
server like geocities.com so I don;t expend money on buying large amounts of
bandwith for my site... If you think this way you know why they do that.

if this works, just use thi path "http://Domain/ImagesDir/ImagesName.gif" in
all your scripts for getimagesize...

I expect that this helps.

Rom



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] GetImageSize problem

2001-01-21 Thread Romulo Roberto Pereira

If you relly don't like the text jumping you can do a little script
that can parse the width and height for each image, I mean get this info
from the html files... But you will have to pin point each one... The good
thing that the script is here...

? #
   ## GetURLImageSize( $urlpic ) determines the
   ## dimensions of local/remote URL pictures.
   ## returns array with ( $width,$height,$type )
   ##
   ## Thanks to: Oyvind Hallsteinsen aka Gosub / ELq - [EMAIL PROTECTED]
   ## for the original size determining code
   ##
   ## PHP Hack by Filipe Laborde-Basto Oct 21/2000
   ## FREELY DISTRIBUTABLE -- use at your sole discretion! :) Enjoy.
   ## (Not to be sold in commercial packages though, keep it free!)
   ## Feel free to contact me at [EMAIL PROTECTED] (http://www.rezox.com)
   #

define(GIF_SIG, "\x47\x49\x46");
define(JPG_SIG, "\xff\xd8\xff");
define(PNG_SIG, "\x89\x50\x4e\x47\x0d\x0a\x1a\x0a");
define(JPG_SOF0, "\xc0");  /* Start Of Frame N */
define(JPG_SOF1, "\xc1");  /* N indicates which compression process */
define(JPG_SOF2, "\xc2");  /* Only SOF0-SOF2 are now in common use */
define(JPG_SOF3, "\xc3");
define(JPG_SOF5, "\xc5");  /* NB: codes C4 and CC are NOT SOF markers */
define(JPG_SOF6, "\xc6");
define(JPG_SOF7, "\xc7");
define(JPG_SOF9, "\xc9");
define(JPG_SOF10, "\xca");
define(JPG_SOF11, "\xcb");
define(JPG_SOF13, "\xcd");
define(JPG_SOF14, "\xce");
define(JPG_SOF15, "\xcf");
define(JPG_EOI, "\xd9");   /* End Of Image (end of datastream) */
define(JPG_SOS, "\xda");  /* Start Of Scan - image data start */
define(RD_BUF, 512);   /* amount of data to initially read */

function GetURLImageSize( $urlpic

   $fd= @fopen($urlpic,"r");

fd){  
  #read in 1k, enough for GIF,PNG. 
  #continue to read from file, if the JPG chunk exceeds this 
  $imgData = fread( $fd,RD_BUF ); 


  if( substr($imgData,0,3)==GIF_SIG

 $dim =unpack ("v2dim",substr($imgData,6,4) );
 $width=$dim["dim1"]; $height=$dim["dim2"];
 $type = 1;
  } elseif( substr($imgData,0,8)==PNG_SIG

 $dim =unpack ("N2dim",substr($imgData,16,8) );
 $width=$dim["dim1"]; $height=$dim["dim2"];
 $type = 3;
  } elseif( substr($imgData,0,3)==JPG_SIG

 # JPG CHUNK SCAN 
 $imgPos = 2; $type = 2; $buffer = RD_BUF-2;
 while($imgPos  strlen($imgData))

/* synchronize to the marker 0xFF */
$imgPos=strpos($imgData,0xFF,$imgPos)+1;
$marker = $imgData[$imgPos];
do { $marker = ord($imgData[$imgPos++]); } while ($marker ==
255);
/* find dimensions of block */
switch (chr($marker))

  /* Grab width/height from SOF segment (these are acceptable
chunk types) */
  case JPG_SOF0:  case JPG_SOF1:  case JPG_SOF2:
  case JPG_SOF3:  case JPG_SOF5:  case JPG_SOF6:
  case JPG_SOF7:  case JPG_SOF9:  case JPG_SOF10:
  case JPG_SOF11: case JPG_SOF12: case JPG_SOF13:
  case JPG_SOF14: case JPG_SOF15:
  $dim =unpack ("n2dim",substr($imgData,$imgPos+3,4) );
  $height=$dim["dim1"]; $width=$dim["dim2"];
  break 2; file://found it so exit
case JPG_EOI:
case JPG_SOS:
  return FALSE;/* End loop in case we find one of these
markers */
default:/* We're not interested in other markers */
  $skiplen =
(ord($imgData[$imgPos++])8)+ord($imgData[$imgPos++])-2;
  /* if the skip is more than what we've read in, read more */
  $buffer -= $skiplen;
  if( $buffer512 ){ #if the buffer of data is too low,read more
file.
  $imgData .= fread( $fd,$skiplen+1024 );
  $buffer += $skiplen+1024;
  };
  $imgPos += $skiplen;
  break;
}; file://endif check marker type
 }; file://endif loop through JPG chunks
  }; file://endif chk for valid file types

  # got the pic dimensions, close the file
  fclose ($fd);

  return array( $width,$height,$type );
} else

  return array( '','','' );
    }; file://endif valid file pointer chk
}; // end function
?

Rom
- Original Message -
From: Sue Bailey [EMAIL PROTECTED]
To: Romulo Roberto Pereira [EMAIL PROTECTED]
Cc: php-general [EMAIL PROTECTED]
Sent: Sunday, January 21, 2001 10:35 AM
Subject: Re: [PHP] GetImageSize problem


Thanks Rom - I can get the pics with an img src tag, which is why I
assumed that Get

Re: [PHP] GetImageSize problem

2001-01-21 Thread Thies C. Arntzen

On Sun, Jan 21, 2001 at 03:05:31PM +, Sue Bailey wrote:
 I have a bunch of images living on one ISP's server which I want to use
 on another page on another ISP's server, with GetImageSize. I RTFM, and
 see "The filename needs to be either relative to the current document,
 or an absolute filesystem path. Thus absolute URL paths will not work."
 which is absolutely correct - I get an error msg "cannot open file".
 $DOCUMENT_ROOT  is obviously no use to me - does anyone know any way
 round this?

try the latest snapshot of PHP 4 from snaps.php.net. it
supports URLs in the getinagesize() function.

tc

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]




Re: [PHP] GetImageSize problem

2001-01-21 Thread eschmid+sic

On Sun, Jan 21, 2001 at 07:02:07PM +0100, Thies C. Arntzen wrote:
 On Sun, Jan 21, 2001 at 03:05:31PM +, Sue Bailey wrote:
  I have a bunch of images living on one ISP's server which I want to use
  on another page on another ISP's server, with GetImageSize. I RTFM, and
  see "The filename needs to be either relative to the current document,
  or an absolute filesystem path. Thus absolute URL paths will not work."
  which is absolutely correct - I get an error msg "cannot open file".
  $DOCUMENT_ROOT  is obviously no use to me - does anyone know any way
  round this?
 
 try the latest snapshot of PHP 4 from snaps.php.net. it
 supports URLs in the getinagesize() function.

Hi Sue,

Thies Arntzen made a typo, it is the getimagesize() function. Look at page
497 and use "string imagefile" in newer versions as URL.

-Egon

-- 
http://www.linuxtag.de/
http://php.net/books.php 
http://www.concert-band.de/
mailto:[EMAIL PROTECTED]

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]