View Issue Details

IDProjectCategoryView StatusLast Update
0002553OXID eShop (all versions)4.05. Performancepublic2012-12-10 13:29
Reporteralexwichti Assigned To 
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionwon't fix 
Product Version4.4.7 revision 33396 
Summary0002553: Oxid exits with fatal error when oxUtils::_resize exceeds memory limit
DescriptionWhen uploading an image whose dimensions result in a size that exceeds PHP's memory_limit-setting, it fails with a fatal error.
The failure occurs in file core/oxutilspic.php at line 306 (assuming an upload of JPEG), when calling imagejpeg().
Example: memory_limit set to 50M. Uploading an image of 8 Megapixel results in an internal memory usage of ~34MB. When called _copyAlteredImage() we are already over the limit.

Possible solution: Calculate memory_get_usage() + memory we want to have for the image calculations. If result is > memory_limit, we can say for certain that PHP will fail. Even though, we cannot cover every case, this should be a good start.

memory_get_usage + speicher den ich gleich haben will > memory limit -> fehler
Steps To ReproduceUpload an image which is big enough to exceed PHP's memory_limit.
TagsPerformance
Theme
BrowserAll
PHP Version5.3
Database Version5.1

Activities

alexwichti

2011-02-23 15:41

reporter   ~0004151

Ignore the last line in description.

birute_meilutyte

2011-04-29 14:55

reporter   ~0004421

@developers: check from source code side if such issue still exist

Linas Kukulskis

2011-08-10 16:30

reporter   ~0004978

because there are no proper method to calculate or control memory limits, so we decided to add some notes to documentation about limitations, and we added some notes to admin labels near picture upload buttons that max dimensions is 1500x1500px calculated for 12MB (min for EE 32MB, recommended for CE 30MB) of memory only for picture re-sizing.