Reply to 100KB image that takes up 2mb of memory uses up all 8mb of memory - help!

Your name:

Reply:


Posted by comp.lang.php on 09/25/06 20:41

I have an image that's only 100K in size, and I am working with 8mb of
memory. If I do this:

[PHP]
print_r(ceil((int)ini_get('memory_limit') * 10 *
filesize(actual_path("$locationPath/$this->fileName")) / 1000000) .
'M'); // PRINTS OUT "2M" for 2mb
]/PHP]

The image itself requires far less than the maximum amount of memory
required.

However, the moment I do this:

[PHP]
$imagestring =
@file_get_contents(actual_path(realpath("$locationPath/" .
$this->{$section . '_name'})));
[/PHP]

It locks up and forces a download of "index.php" (which indicates to me
that the memory allotment of 8mb has been used up).

How in the world can a 100KB image that uses only 2mb of 8mb use up 8mb
of memory on file_get_contents() alone? I'm completely confused!

Thanx
Phil

[Back to original message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация