createimagefromstring / createimagefromjpeg 
July 7th, 2008, 08:55 AM
| | | createimagefromstring / createimagefromjpeg
I've tried uploading a couple of jpegs to my test application, thinking
that it was some how a header problem, and since I know these jpegs were
created with different programs, I figured I could root that out as the
cause.
My problem? Either of these functions, when attempting to load a JPEG
on my system are failing... they're causing PHP to crash and end the
script right then and there and I can't find any error logs that give me
any more information than that.
I've checked my memory limits and all of that, that's not the problem,
since I can load the contents of the file into a string, just fine... I
just cannot use the createimage functions.
I'm hoping someone's run into this problem, before, so I'm hoping
someone here can point me in the right direction with this one.
Thanks in advance! | 
July 7th, 2008, 10:45 AM
| | | Re: createimagefromstring / createimagefromjpeg
I've tried uploading a couple of jpegs to my test application, Quote:
thinking that it was some how a header problem, and since I know
these jpegs were created with different programs, I figured I could
root that out as the cause.
>
My problem? Either of these functions, when attempting to load a JPEG
on my system are failing... they're causing PHP to crash and end the
script right then and there and I can't find any error logs that give
me any more information than that.
>
I've checked my memory limits and all of that, that's not the problem,
since I can load the contents of the file into a string, just fine...
I just cannot use the createimage functions.
>
I'm hoping someone's run into this problem, before, so I'm hoping
someone here can point me in the right direction with this one.
>
Thanks in advance!
| Maybe: Check out how Captcha images are done; that's what I learned on.
Not the same, but similar processes; it just also creates its own image,
so toss that part. | 
July 7th, 2008, 08:45 PM
| | | Re: createimagefromstring / createimagefromjpeg
Nathan Moschkin wrote: Quote:
I've tried uploading a couple of jpegs to my test application, thinking
that it was some how a header problem, and since I know these jpegs were
created with different programs, I figured I could root that out as the
cause.
>
My problem? Either of these functions, when attempting to load a JPEG
on my system are failing... they're causing PHP to crash and end the
script right then and there and I can't find any error logs that give me
any more information than that.
>
I've checked my memory limits and all of that, that's not the problem,
since I can load the contents of the file into a string, just fine... I
just cannot use the createimage functions.
>
I'm hoping someone's run into this problem, before, so I'm hoping
someone here can point me in the right direction with this one.
>
Thanks in advance!
>
| How big are the jpegs? Just because you can load them into a string
doesn't mean you can use createimage(). That can take significantly
more memory.
The first thing you should do is enable all error reporting and display
errors. In your php.ini file, set
error_reporting=E_ALL
display_errors=on
You should always have these enabled on a development system (but not a
production system).
If you still don't see the problem, post your code and we can look at it.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. jstucklex@attglobal.net
================== | 
July 7th, 2008, 09:05 PM
| | | Re: createimagefromstring / createimagefromjpeg
Jerry Stuckle wrote: Quote:
>
How big are the jpegs? Just because you can load them into a string
doesn't mean you can use createimage(). That can take significantly
more memory.
>
The first thing you should do is enable all error reporting and display
errors. In your php.ini file, set
>
error_reporting=E_ALL
display_errors=on
>
You should always have these enabled on a development system (but not a
production system).
>
If you still don't see the problem, post your code and we can look at it.
>
|
I figured it out. My system wasn't configured properly. I was missing
the php-gd libraries installed on my system. I installed them and
everything instantly started working.
You know, I'm going to be working with exceptionally large files. Is
there any way to overcome the inherent 2 GB limit in PHP? | 
July 7th, 2008, 09:05 PM
| | | Re: createimagefromstring / createimagefromjpeg
On Jul 7, 3:51*am, Nathan Moschkin <ironyw...@verizon.netwrote: Quote:
I've tried uploading a couple of jpegs to my test application, thinking
that it was some how a header problem, and since I know these jpegs were
created with different programs, I figured I could root that out as the
cause.
>
My problem? *Either of these functions, when attempting to load a JPEG
on my system are failing... they're causing PHP to crash and end the
script right then and there and I can't find any error logs that give me
any more information than that.
>
I've checked my memory limits and all of that, that's not the problem,
since I can load the contents of the file into a string, just fine... I
just cannot use the createimage functions.
>
I'm hoping someone's run into this problem, before, so I'm hoping
someone here can point me in the right direction with this one.
>
Thanks in advance!
| I'd still think it may be some kind of memory or other resource
related issue. Have you tried processing a very small image, say some
1x1 px image? If that works, I'd say it's probably a memory issue. I
also remember on a previous webhost I had that sucked, Globat.com,
they used to restrict CPU cycles. So I had some CPU intensive image
manipulation scripts that would often fail because of their super
restricitive web server. That might be something else to investigate. | 
July 7th, 2008, 10:45 PM
| | | Re: createimagefromstring / createimagefromjpeg
Greetings, Nathan Moschkin.
In reply to Your message dated Tuesday, July 8, 2008, 0:59:25, Quote: Quote:
>How big are the jpegs? Just because you can load them into a string
>doesn't mean you can use createimage(). That can take significantly
>more memory.
>>
>The first thing you should do is enable all error reporting and display
>errors. In your php.ini file, set
>>
>error_reporting=E_ALL
>display_errors=on
>>
>You should always have these enabled on a development system (but not a
>production system).
>>
>If you still don't see the problem, post your code and we can look at it.
>>
| | Quote:
I figured it out. My system wasn't configured properly. I was missing
the php-gd libraries installed on my system. I installed them and
everything instantly started working.
| Quote:
You know, I'm going to be working with exceptionally large files. Is
there any way to overcome the inherent 2 GB limit in PHP?
| What you mean 'exceptionally'? 4000x3000x32b = about 45Mb.
memory_limit 128Mb will be most likely more than enough for you.
--
Sincerely Yours, AnrDaemon <anrdaemon@freemail.ru> | 
July 8th, 2008, 12:35 AM
| | | Re: createimagefromstring / createimagefromjpeg
Nathan Moschkin wrote: Quote:
Jerry Stuckle wrote: Quote:
>>
>How big are the jpegs? Just because you can load them into a string
>doesn't mean you can use createimage(). That can take significantly
>more memory.
>>
>The first thing you should do is enable all error reporting and
>display errors. In your php.ini file, set
>>
>error_reporting=E_ALL
>display_errors=on
>>
>You should always have these enabled on a development system (but not
>a production system).
>>
>If you still don't see the problem, post your code and we can look at it.
>>
| >
>
I figured it out. My system wasn't configured properly. I was missing
the php-gd libraries installed on my system. I installed them and
everything instantly started working.
>
You know, I'm going to be working with exceptionally large files. Is
there any way to overcome the inherent 2 GB limit in PHP?
>
| It's not a PHP limitation as much as a machine one. Get a 64 bit
processor and software. Then you'll have lots of memory.
But why would you EVER need more than 2GB for PHP? I've never used more
than 128MB or so - even on the heaviest systems.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. jstucklex@attglobal.net
================== | 
July 8th, 2008, 09:45 AM
| | | Re: createimagefromstring / createimagefromjpeg
Jerry Stuckle wrote: Quote:
It's not a PHP limitation as much as a machine one. Get a 64 bit
processor and software. Then you'll have lots of memory.
>
But why would you EVER need more than 2GB for PHP? I've never used more
than 128MB or so - even on the heaviest systems.
>
| I'm running on a 64 bit processor. That means I could upload 4 GB files?
I'm developing a digital asset management website... and some of the
clients for the company develop bus wraps ... that is, one gigantic
graphic image that wraps around, say ... a city bus... and those files
are on the border between massive and colossal. | 
July 8th, 2008, 10:05 AM
| | | Re: createimagefromstring / createimagefromjpeg
Nathan Moschkin wrote: Quote:
Jerry Stuckle wrote:
> Quote:
>It's not a PHP limitation as much as a machine one. Get a 64 bit
>processor and software. Then you'll have lots of memory.
>>
>But why would you EVER need more than 2GB for PHP? I've never used
>more than 128MB or so - even on the heaviest systems.
>>
| >
I'm running on a 64 bit processor. That means I could upload 4 GB files?
>
I'm developing a digital asset management website... and some of the
clients for the company develop bus wraps ... that is, one gigantic
graphic image that wraps around, say ... a city bus... and those files
are on the border between massive and colossal.
>
>
| File upload size has nothing to do with PHP memory size.
And if you're running on a 64 bit processor - are you using all 64 bit
software, also? From the OS on down?
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. jstucklex@attglobal.net
================== | 
July 8th, 2008, 12:05 PM
| | | Re: createimagefromstring / createimagefromjpeg
Jerry Stuckle wrote: Quote:
Nathan Moschkin wrote: Quote:
>Jerry Stuckle wrote:
>> Quote:
>>It's not a PHP limitation as much as a machine one. Get a 64 bit
>>processor and software. Then you'll have lots of memory.
>>>
>>But why would you EVER need more than 2GB for PHP? I've never used
>>more than 128MB or so - even on the heaviest systems.
>>>
| >>
>I'm running on a 64 bit processor. That means I could upload 4 GB files?
>>
>I'm developing a digital asset management website... and some of the
>clients for the company develop bus wraps ... that is, one gigantic
>graphic image that wraps around, say ... a city bus... and those files
>are on the border between massive and colossal.
>>
>>
| >
File upload size has nothing to do with PHP memory size.
>
And if you're running on a 64 bit processor - are you using all 64 bit
software, also? From the OS on down?
>
| openSUSE 11.0 AMD 64 compile. 2 Gig of ram, nice 350 GB drive ... this
is just my development platform... the live system will be hosted by a
professional web hosting service with RAID arrays, clustering and all
that jazz...
at any rate .. I was under the impression that the two did have
something tied into one another, all the books state that your memory
size should always be greater than your post size, and that should
always be greater than max file size. | 
July 8th, 2008, 08:45 PM
| | | Re: createimagefromstring / createimagefromjpeg
Nathan Moschkin wrote: Quote:
Jerry Stuckle wrote: Quote:
>Nathan Moschkin wrote: Quote:
>>Jerry Stuckle wrote:
>>>
>>>It's not a PHP limitation as much as a machine one. Get a 64 bit
>>>processor and software. Then you'll have lots of memory.
>>>>
>>>But why would you EVER need more than 2GB for PHP? I've never used
>>>more than 128MB or so - even on the heaviest systems.
>>>>
>>>
>>I'm running on a 64 bit processor. That means I could upload 4 GB
>>files?
>>>
>>I'm developing a digital asset management website... and some of the
>>clients for the company develop bus wraps ... that is, one gigantic
>>graphic image that wraps around, say ... a city bus... and those
>>files are on the border between massive and colossal.
>>>
>>>
| >>
>File upload size has nothing to do with PHP memory size.
>>
>And if you're running on a 64 bit processor - are you using all 64 bit
>software, also? From the OS on down?
>>
| >
openSUSE 11.0 AMD 64 compile. 2 Gig of ram, nice 350 GB drive ... this
is just my development platform... the live system will be hosted by a
professional web hosting service with RAID arrays, clustering and all
that jazz...
>
at any rate .. I was under the impression that the two did have
something tied into one another, all the books state that your memory
size should always be greater than your post size, and that should
always be greater than max file size.
>
>
| Yes, memory size needs to be big enough - but not necessarily as big as
the file. It is sent in chunks, not as all one packet.
And PHP memory size has no bearing on upload file size. The web server
handles the transfer of the file to your temp directory (usually /tmp).
Once it has been uploaded, PHP gets control.
PHP has nothing to do with the actual file transfer.
BTW - have you though of how long it's going to take to transfer a 4GB
file, and what that's going to do to your allocated bandwidth for the
server? It could get expensive real quick.
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp. jstucklex@attglobal.net
================== | 
July 9th, 2008, 11:05 PM
| | | Re: createimagefromstring / createimagefromjpeg
Jerry Stuckle wrote: Quote:
>
Yes, memory size needs to be big enough - but not necessarily as big as
the file. It is sent in chunks, not as all one packet.
>
And PHP memory size has no bearing on upload file size. The web server
handles the transfer of the file to your temp directory (usually /tmp).
Once it has been uploaded, PHP gets control.
>
PHP has nothing to do with the actual file transfer.
>
BTW - have you though of how long it's going to take to transfer a 4GB
file, and what that's going to do to your allocated bandwidth for the
server? It could get expensive real quick.
>
| Thank you very much for that useful bit of information, and yes, the
people I'm doing the project for, and I have thought of everything in
this regard.
They're in the business of catering to people who need that capability
.... and they're quite prepared to handle band-width and metering issues. | | Thread Tools | Search this Thread | | | |
Posting Rules
| You may not post new threads You may not post replies You may not post attachments You may not edit your posts HTML code is Off | | | | | | What is Bytes?
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 220,989 network members.
|