Jump to content

Recommended Posts

Hey people

I dont understand this

I created a class to upload / manipulate images.

I have just been informed of the following error
Fatal error: Allowed memory size of 8388608 bytes exhausted (tried to allocate 3072 bytes) in /home/httpd/vhosts/****.co.uk/httpdocs/administration/includes/class.uploadimg.php on line 360

Now I can not see my class exceeding the 8MB limit
Line 360 is
$image = imagecreatefromjpeg($_FILES[$this->form_file_name]["tmp_name"]);

The class can be found at

http://onlyican.com/class.uploadimg.phps

There is an Image Upload Max Size set to 1MB

I know I can set the Memory Limit higher, but I want to know WHY I am getting this message.
Link to comment
https://forums.phpfreaks.com/topic/36178-8mb-allocated-memory-used/
Share on other sites

[quote author=onlyican link=topic=124534.msg516057#msg516057 date=1170079144]
I know I can set the Memory Limit higher, but I want to know WHY I am getting this message.
[/quote]

The GD library uses a lot of memory.

I included a link in a [url=http://www.phpfreaks.com/forums/index.php/topic,121661.msg500680.html#msg500680]previous post[/url] that details this.

Regards
Huggie
something confusing me, the person has just emailed me the picture he is using.

Its 3072px Wide BY 2048px High
300DPI
but only 768kb

so what I think is happening is that when I resize the image, it still uses the 300 dpi size, which is making the file size larger, as it should be.

Is there a way in PHP, to check the DPI, and change it to 72dpi
[quote author=onlyican link=topic=124534.msg516096#msg516096 date=1170081728]
Its 3072px Wide BY 2048px High
300DPI
but only 768kb
[/quote]

The quality of that must be extremely poor!

As for setting the quality to 72dpi, I'd suggest looking through all the [url=http://uk.php.net/manual/en/ref.image.php]image functions[/url].

Huggie
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.