whenever I try to submit images (usually larger than 140K, but it's not always true) I get this:
Fatal error: Allowed memory size of 12582912 bytes exhausted (tried to allocate 6400 bytes) in /web/htdocs/www.smartart.it/home/includes/image.inc on line 288
This error seems not strictly related to the image size as stated before.
The temp directory, inside files/images/ holds the files correctly uploaded (of the correct size).
I've opened a forum thread but when I felt like I had no other choice I opened this issue. I hope I can help.
You can find the modules I have enabled in the thread just above.

Regards,
ThePeach

Comments

heine’s picture

Category: bug » support
Priority: Critical » Normal

Increase php's memory_limit, see http://drupal.org/node/76156 in the Troubleshooting FAQ.

killes@www.drop.org’s picture

Status: Active » Fixed
ThePeach’s picture

Status: Fixed » Closed (won't fix)

as already stated in other threads the memory limit is already at 12MB, as it can be read from the output error (12582912 bytes), I tried to set higher values (up to 20MB) via ini_set with no changes, instead sometimes the exhausted value will be higher that the one reported in the first post. Seems like a loop eating the whole memory... dunno.

ThePeach’s picture

Category: support » bug
Priority: Normal » Critical

Update: the image that causes these problems is THIS (and others if you need more proofs like this jpeg compressed version of the same)
I've tried also to upload it on other drupal powered sites but the result is the same error.
Fatal error: Allowed memory size of 16777216 bytes exhausted (tried to allocate 6400 bytes) in /var/www/html/xxxxx.it/public_html/htdocs/includes/image.inc on line 288
This is not an apache problem.
It seems like moving the image from the temp directory can cause this kind of problems.

Some image info:

$ identify  -ping -verbose p_executioner-2_1600x1200.png
Image: p_executioner-2_1600x1200.png
  Format: PNG (Portable Network Graphics)
  Class: DirectClass
  Geometry: 1600x1200
  Type: TrueColor
  Endianess: Undefined
  Colorspace: RGB
  Channel depth:
    Red: 8-bits
    Green: 8-bits
    Blue: 8-bits
    Alpha: 1-bits
  Channel statistics:
    Red:
      Min: 0 (0)
      Max: 255 (1)
      Mean: 62.4996 (0.245097)
      Standard deviation: 85.7998 (0.33647)
    Green:
      Min: 0 (0)
      Max: 255 (1)
      Mean: 104.904 (0.411388)
      Standard deviation: 96.8337 (0.37974)
    Blue:
      Min: 0 (0)
      Max: 255 (1)
      Mean: 42.0853 (0.16504)
      Standard deviation: 87.9842 (0.345036)
    Alpha:
      Min: 255 (1)
      Max: 255 (1)
      Mean: 255 (1)
      Standard deviation: 0 (0)
  Colors: 27902
  Rendering intent: Undefined
  Resolution: 28.35x28.35
  Units: PixelsPerCentimeter
  Filesize: 2.8mb
  Interlace: None
  Background color: #00000000
  Border color: #DFDFDF00
  Matte color: grey74
  Page geometry: 1600x1200+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: Zip
  Orientation: Undefined
  Signature: fdbba4fbdcfa806537c2262d6505479c4ab61026c190d81196b5b4a9e9c6d138
  Tainted: False
  Version: ImageMagick 6.2.8 08/08/06 Q16 http://www.imagemagick.org

and here for the second linked (the jpg)

$ display -identify -verbose p_executioner-2_1600x1200.jpg 
p_executioner-2_1600x1200.jpg JPEG 1600x1200 1600x1200+0+0 DirectClass 7.9e+02kb 
Image: p_executioner-2_1600x1200.jpg
  Format: JPEG (Joint Photographic Experts Group JFIF format)
  Class: DirectClass
  Geometry: 1600x1200
  Type: TrueColor
  Endianess: Undefined
  Colorspace: RGB
  Channel depth:
    Red: 8-bits
    Green: 8-bits
    Blue: 8-bits
  Channel statistics:
    Red:
      Min: 0 (0)
      Max: 255 (1)
      Mean: 63.7297 (0.24992)
      Standard deviation: 84.3217 (0.330673)
    Green:
      Min: 0 (0)
      Max: 255 (1)
      Mean: 103.995 (0.407823)
      Standard deviation: 92.8979 (0.364306)
    Blue:
      Min: 0 (0)
      Max: 255 (1)
      Mean: 46.982 (0.184243)
      Standard deviation: 82.3721 (0.323028)
  Colors: 195031
  Rendering intent: Undefined
  Resolution: 72x72
  Units: PixelsPerInch
  Filesize: 7.9e+02kb
  Interlace: None
  Background color: white
  Border color: #DFDFDF
  Matte color: grey74
  Page geometry: 1600x1200+0+0
  Dispose: Undefined
  Iterations: 0
  Compression: JPEG
  Quality: 85
  Orientation: Undefined
  Comment: made by The Peach
  JPEG-Colorspace: 2
  JPEG-Sampling-factors: 2x2,1x1,1x1
  Signature: 246b685b0de937eccb38e3b31b14f1e84ae8de8ae9fa1998cc6e2df0cb739e47
  Profile-exif: 20 bytes
0x00000000: 78696600 004d4d00 2a000000 08000000 00000000  Exif--MM-*----------
  Tainted: False
  Version: ImageMagick 6.2.8 08/08/06 Q16 http://www.imagemagick.org

as you can see I can upload it (used gallery1) and anyway I've also raised upload limits in order to be sure (and -again- it seems not related to image weight).

I don't know if the issue is strictly related to the include file shown in the error (include/image.inc or it is a problem of the image module.
Please correct it if necessary.

virgo’s picture

I think I have exactly the same problem . php_ini is not fixing problems, I increased to 40MB, same thing still happening

Any suggestions ?

ThePeach’s picture

Status: Closed (won't fix) » Active

@virgo
I do notice that it seems related to the image size not the weight: I get these problems usually with images larger than 1024px per side. Can you confirm?
The image, as stated before is correctly uploaded into the tmp directory, the error happens when the program tries to resize it and move it to files/images/.

cyrusthevirus’s picture

Php use raw images.
A 1000x1000 pixel totally blank image (as a JPG it must be 1 kb or so) uses 3,000,000 bytes or more (1000 x 1000 x 3 colors).
As a rule of thumb, you'll have:
bytes = height x width x 4
The 4 is because the image can have supplemental informations (exif, etc.).
Hint: with getimagesize() you can know the height and the width.

HTH

f5design’s picture

has this issue been solved? has it been decided that the issue is a php memory limit issue when dealing with large images?

Just looking for an update or a resolution :)

s

robertdouglass’s picture

Category: bug » support
Priority: Critical » Normal
Status: Active » Fixed

This is almost certainly a PHP configuration issue. There is nothing special about the image that was linked to above, I was able to upload it to my default 5.0 installation. Make sure that you address the following php.ini variables:
post_max_size
upload_max_filesize

robertdouglass’s picture

Tested on 4.7.4 as well. It isn't a Drupal problem.

Anonymous’s picture

Status: Fixed » Closed (fixed)