473,326 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

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!
Jul 7 '08 #1
11 3188
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!
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.
Jul 7 '08 #2
Nathan Moschkin wrote:
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.
js*******@attglobal.net
==================

Jul 7 '08 #3
Jerry Stuckle wrote:
>
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?
Jul 7 '08 #4
On Jul 7, 3:51*am, Nathan Moschkin <ironyw...@verizon.netwrote:
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.
Jul 7 '08 #5
Greetings, Nathan Moschkin.
In reply to Your message dated Tuesday, July 8, 2008, 0:59:25,
>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?
What you mean 'exceptionally'? 4000x3000x32b = about 45Mb.
memory_limit 128Mb will be most likely more than enough for you.
--
Sincerely Yours, AnrDaemon <an*******@freemail.ru>

Jul 7 '08 #6
Nathan Moschkin wrote:
Jerry Stuckle wrote:
>>
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.
js*******@attglobal.net
==================

Jul 8 '08 #7
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.

Jul 8 '08 #8
Nathan Moschkin wrote:
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?

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================

Jul 8 '08 #9
Jerry Stuckle wrote:
Nathan Moschkin wrote:
>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.

Jul 8 '08 #10
Nathan Moschkin wrote:
Jerry Stuckle wrote:
>Nathan Moschkin wrote:
>>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.
js*******@attglobal.net
==================

Jul 8 '08 #11
Jerry Stuckle wrote:
>
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.
Jul 9 '08 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Darren Gamble | last post by:
Good day, I've sent a message on this to the php-general list already, but unfortunately no one replied. Sorry for the repost. to those that read both... I'm having a problem working with an...
2
by: Dynamo | last post by:
Hi yet again, I am trying to resize a previously uploaded image on my server to a thumbnail but am getting a fatal error message as follows Fatal error: Call to undefined function:...
1
by: Snef | last post by:
Hi, It should be possible (as far as I know) to use createimagefromjpg('<urltoimage>'); In PHP4.3.11 it worked just fine, but now I use PHP4.4 and it is not working anymore! I only can do:...
1
by: Bob Bedford | last post by:
Hi all, I've this error on the createimagefromjpeg with many image on my server. Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 11264 bytes) in .... The worse...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.