Memory limit when using imagecreatefromjpeg

images php coding issues or problems here.

Moderators: macek, egami, gesf

User avatar
WoozyDuck
New php-forum User
New php-forum User
Posts: 191
Joined: Wed May 05, 2004 10:14 am

Memory limit when using imagecreatefromjpeg

Postby WoozyDuck » Sat Jan 01, 2005 11:00 am

Hi

I am trying to use (imagecreatefromjpeg) to make a jpeg file
from another file.
it works fine but whenever the file is too big the function just die!
I know we have to change something in php.ini or something
could anyone please help me how can I do that ?

or is there any way to copy and resize a jpeg file without any limit?

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Sat Jan 01, 2005 11:05 am

i think you will need to change the max excecution time that is by default set to 30 second... this might be not enought for big and hi quality images..

Therefore i recommend changing it to somethin bigger..however not too big.. otherwise you might have some problems...

I think thats the problem :)

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Sat Jan 01, 2005 11:07 am

or... you can look in comments on php.net

They have several different functions in those comments :D

take a look atresize functiond :)

User avatar
WoozyDuck
New php-forum User
New php-forum User
Posts: 191
Joined: Wed May 05, 2004 10:14 am

Postby WoozyDuck » Sat Jan 01, 2005 4:25 pm

Nope
I did looked at PHP comments too
but they didnt have anything about this problem!

actually now I have another problem too
whenever I am trying to make a image using (imagecreatefromwbmp)
it wont accept BMP as a picture and says:

Warning: imagecreatefromwbmp(): /images/test.BMP' is not a valid WBMP file in ...


thats so strange cause I am sure that file is a BITMAP FILE! (BMP)!!!

I am so **** with this coding
hahahaha :D

someone heeeeeeeeeeelp me :D

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Sun Jan 02, 2005 3:10 am

This tells me that you have NOT looked at all of the comments.. WBMP is NOT BMP.. its absolutely different thing...

WBMP images are Wireless Bitmaps, not Windows Bitmaps. WBMP is used for bandwidth constrained, black and white, limited devices such as old PDAs and Cell Phones.

And therefore you will not be able to make it...
And i told you to look at those comments because they have good functions there... and therefore you dont need to bothere about emomry/time problem... but try increasing max excecution time in PHP.ini

User avatar
WoozyDuck
New php-forum User
New php-forum User
Posts: 191
Joined: Wed May 05, 2004 10:14 am

Postby WoozyDuck » Sun Jan 02, 2005 5:07 am

Alexi
Thanx for your answer
ths is what Ive looked at
http://uk.php.net/manual/en/function.im ... omjpeg.php
can you tell me where about it says anything about memory limit problem?
besides if you say that command doesnt support windows BITMAP,
so why dont you say its command so I can read about it

User avatar
WoozyDuck
New php-forum User
New php-forum User
Posts: 191
Joined: Wed May 05, 2004 10:14 am

Postby WoozyDuck » Sun Jan 02, 2005 6:15 am

Ive found my sulotion mr Perfect (Alexi) MYSELF:

To change the memory limit for one specific script by including a line such as this at the top of the script:

Code: Select all

ini_set("memory_limit","12M");


The 12M sets the limit to 12 megabytes (12582912 bytes). If this doesn't work, keep increasing the memory limit until your script fits or your server squeals for mercy.

You can also make this change permanently for all PHP scripts running on the server by adding a line like this to the server's php.ini file:

Code: Select all

memory_limit = 12M


NOw its easy for other people who has the same problem with me just to see and copy this code from here , not directing them to other places!

RESOURCE : http://www.tech-recipes.com/php_program ... ps777.html

User avatar
Redcircle
Moderator
Moderator
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

Postby Redcircle » Sun Jan 02, 2005 6:27 am

WoozyDuck

The problem you are experiencing can be the cause of two problems . Memeory limit and max time limit.

Alexei is trying to help you out.

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Sun Jan 02, 2005 7:07 am

Well... i told you to change php ini... but i think you didnt listen... wait a second.. you DIDNT!

you want to resize the Image -- here you go!

http://se2.php.net/manual/en/function.i ... ampled.php
http://se2.php.net/manual/en/function.i ... esized.php

WBMP is another format... there is no function to take a BMP... sorry... you will need to write your own..

Please read more here..
http://se2.php.net/manual/en/function.i ... ension.php

And stop accusing me in not helping while you dont follow the things i tell you to do..

So how do you expect to get any help?!

User avatar
Redcircle
Moderator
Moderator
Posts: 830
Joined: Tue Jan 21, 2003 10:42 pm
Location: Michigan USA
Contact:

Postby Redcircle » Sun Jan 02, 2005 7:23 am

Simmer down

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Sun Jan 02, 2005 7:25 am

Im calm.. hehe... just wanted to give him those things that he was missing..

**Breeze in -- Breeze out **

hehe.
CAlm and happy...as usuall :)

User avatar
WoozyDuck
New php-forum User
New php-forum User
Posts: 191
Joined: Wed May 05, 2004 10:14 am

Postby WoozyDuck » Sun Jan 02, 2005 9:15 am

Redcircle wrote:WoozyDuck

The problem you are experiencing can be the cause of two problems . Memeory limit and max time limit.

Alexei is trying to help you out.


yes thats right
but if you see his answers you can find out that he is not helping
he is just giving some tips which is not about my problem!
I am a beginner at PHP and thats why I am using this forum!

He said (change the max excecution time)
but he didnt say HOW!
he said (or... you can look in comments on php.net )
but he didnt say WHERE? php.net has millions of comments!

trust me If I knew HOW or WHERE I will never use this froum mate!

besides he cannot judge me like this:
(This tells me that you have NOT looked at all of the comments)
cause I did that and I couldnt find anything related to MEMORY LIMIT
I found that in another web site not the one he told me!

BTW Ive found my problem which was MEMORY LIMIT as I mentioned
before and I solved it. still have problem with BMP which I have to
think how can I at least convert it to another format so I can do
whatever I want with it.

Ciao

User avatar
WoozyDuck
New php-forum User
New php-forum User
Posts: 191
Joined: Wed May 05, 2004 10:14 am

Postby WoozyDuck » Sun Jan 02, 2005 9:29 am

Thete you go
Everything is possible and I dont have to write it my own :

http://gvtulder.f2o.org/articles/storage-1/

Have a nice day ! :D

User avatar
Alexej Kubarev
Site Admin
Site Admin
Posts: 2223
Joined: Fri Mar 05, 2004 7:15 am
Location: Täby, Stockholms län
Contact:

Postby Alexej Kubarev » Mon Jan 03, 2005 4:06 am

True, but:
the following converters found in the netpbm-toolkit: bmptoppm, , pngtopnm, pnmtopng, ppmtogif;
the gif2png utility.


I ment by using only image functions you will not be able to do it because there is no function to handle BMP..

I never said that there is nopossibility right?
I said you cant do it by using wbmp :)

But im glad that you found it :D


Return to “PHP coding => Images”

Who is online

Users browsing this forum: No registered users and 1 guest