hmmm... doesn't appear to be pel or anything like that seems that my image resources aren't being completely freed or something and the memory usage accumulates, until it crashes
[EMAIL PROTECTED] wrote: > hello > > i'm using gd to resize my images, and pel to re-attach the exif data after > gd has finished > but i've run into a problem with the memory limit > > i'm using php 5.2.0 on fedora core 4 > pel is updated via svn from trunk > > php memory limit is set at 48MB > > i have a php script that iterates through images in a directory, and > processes each one > > without using pel, i am able to resize at least nine (2272x1704) photos to > three different sizes, so a total of 27 images > > but when i add the pel code in, to get the original exif, and then > re-attach it to the new image(s), i can only do four images at a time, > before the memory runs out > > the offending code is > > public function createImage($imageResource, $fullFilePath, > $maxQuality) { > $origJpeg = new PelJpeg(); > $origJpeg->loadFile($fullFilePath); > > $exif = $origJpeg->getExif(); > if (!is_null($exif)) { > // add the copyright message > $tiff = $exif->getTiff(); > $ifd0 = $tiff->getIfd(); > > $username = Session::get('username'); > if (empty($username)) { > $username = 'username'; > } > > $copyright = new PelEntryCopyright($username, > 'site'); > $ifd0->addEntry($copyright); > file_put_contents($fullFilePath, > $origJpeg->getBytes()); > } > imagejpeg($imageResource, $fullFilePath, $maxQuality); > > if (!is_null($exif)) { > > $newJpeg = new PelJpeg(); > $newJpeg->loadFile($fullFilePath); > > $newJpeg->setExif($exif); > file_put_contents($fullFilePath, > $newJpeg->getBytes()); > $newJpeg = null; > } > $origJpeg = null; > } > } > > if i comment out all the pel code, there are no issues > so obviously, the pel objects aren't releasing the memory they are using > or file_put_contents isn't or something > > i am using imagedestroy, that is in another section of the code that is > not visible here > > from my calculations, each original image takes up 11614464 bytes in > memory (so approx 11.5MB) -> 2272x1704x3 (for RGB images) > each of the newly created images uses subsequently less > 1500x1500 (max), 640x480 (max), and 150x150 (max) are the other image sizes > > can anyone help me out here, i really want to keep the exif data > > thanks > dave > > > ------------------------------------------------------------------------- > Take Surveys. Earn Cash. Influence the Future of IT > Join SourceForge.net's Techsay panel and you'll get the chance to share your > opinions on IT & business topics through brief surveys - and earn cash > http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV > _______________________________________________ > PEL-devel mailing list > PEL-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/pel-devel > > -- http://dtracorp.com ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys - and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV _______________________________________________ PEL-devel mailing list PEL-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/pel-devel