Uploading 300dpi picture not possible

Permalink
Hi there,

When I try to upload a high density picture (300 dpi) I got this error message.

" Allowed memory size of 134217728 bytes exhausted (tried to allocate 37223953 bytes)"

When I change the quality to 150 dpi it functions well.

For my concert venues I need to have a 300dpi poster on my website for downloading. So how can I solve this problem?

The size of the file is not the problem. 0,8Mb. I uploaded PDF files which where bigger.

I read somewhere on the forum that the density/quality of the picture can cause this problem, so I changed the quality from 300 dpi to 150 dpi and that worked.

Well I wonder how to solve this problem?

Have a nice day,

Stefan.

websitehttp://stefanvandesande.nl

alxbob8
 
rritz replied on at Permalink Reply
rritz
Upload via ftp !
alxbob8 replied on at Permalink Reply
alxbob8
No, that's not the way I like to work. It should be working with a 0.7Mb image in my opinion. Never had it before. I uploaded often bigger images. But perhaps there is something wrong with the way my publisher software is storing the file ...
tallacman replied on at Permalink Reply
tallacman
can you upload the image here so we can take a look?
alxbob8 replied on at Permalink Reply 1 Attachment
alxbob8
here it is :-)
Mainio replied on at Permalink Best Answer Reply
Mainio
This is because PHP's GD image manipulation library will try to load the whole image bitmap into memory when manipulating it. And when uploading an image to the system, it is automatically trying to create the thumbnails from that image (thus, trying to manipulate it).

The amount of needed memory is the higher the bigger image resolution you are trying to upload. Only ways to fix this using GD for image manipulation are to a) increase the PHP memory limit or b) upload smaller resolution image.

If you have ImageMagick installed on your target machine, you can configure concrete5 to use it instead of PHP's GD. See:
http://www.imagemagick.org/

In addition, you need to have the Imagick extension installed for PHP.

In order to figure out whether this is installed on your machine, take a look at your PHP info (http://php.net/manual/en/function.phpinfo.php) and search for "imagick". If you find no references, it is not installed/enabled on your machine.

If you can successfully verify that it is installed on your machine, you can configure concrete5 to use it. Open your /application/config/concrete.php and make it look like this:

<?php
// In /application/config/concrete.php:
return array(
    'file_manager' => array(
        'images' => array(
            'manipulation_library' => 'imagick',
        ),
    ),
);


Once that is done, concrete5 will use the Imagick PHP extension to call the ImageMagick API for image manipulation instead of using PHP's GD library.

Obviously this will fail if you do not have ImageMagick or PHP's Imagick extension installed on the machine (as mentioned).