onlyican Posted January 29, 2007 Share Posted January 29, 2007 Hey peopleI dont understand thisI created a class to upload / manipulate images.I have just been informed of the following errorFatal 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 360Now I can not see my class exceeding the 8MB limitLine 360 is $image = imagecreatefromjpeg($_FILES[$this->form_file_name]["tmp_name"]);The class can be found athttp://onlyican.com/class.uploadimg.phpsThere is an Image Upload Max Size set to 1MBI know I can set the Memory Limit higher, but I want to know WHY I am getting this message. Quote Link to comment https://forums.phpfreaks.com/topic/36178-8mb-allocated-memory-used/ Share on other sites More sharing options...
HuggieBear Posted January 29, 2007 Share Posted January 29, 2007 [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. RegardsHuggie Quote Link to comment https://forums.phpfreaks.com/topic/36178-8mb-allocated-memory-used/#findComment-171820 Share on other sites More sharing options...
onlyican Posted January 29, 2007 Author Share Posted January 29, 2007 something confusing me, the person has just emailed me the picture he is using.Its 3072px Wide BY 2048px High300DPIbut only 768kbso 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 Link to comment https://forums.phpfreaks.com/topic/36178-8mb-allocated-memory-used/#findComment-171832 Share on other sites More sharing options...
HuggieBear Posted January 29, 2007 Share Posted January 29, 2007 [quote author=onlyican link=topic=124534.msg516096#msg516096 date=1170081728]Its 3072px Wide BY 2048px High300DPIbut 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 Quote Link to comment https://forums.phpfreaks.com/topic/36178-8mb-allocated-memory-used/#findComment-171840 Share on other sites More sharing options...
onlyican Posted January 29, 2007 Author Share Posted January 29, 2007 The quality is good, I made it a FireWorks PNG, and the size is 11.3 MBBut for some reason, JPG is making it too small. Quote Link to comment https://forums.phpfreaks.com/topic/36178-8mb-allocated-memory-used/#findComment-171856 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.