Uploading and importing very large images

Pixaria is designed to allow you to easily upload and import high-resolution images into your library and automatically resize them into the thumbnail and screen resolution images used in the Pixaria user interface.

Your ability to upload and import images has some limits which are imposed by limits of the PHP scripting language itself:

Limits on uploading files

The maximum size of any file (i.e. a JPEG image) that you can upload to Pixaria is dependent on the file upload size limit setting in the php.ini configuration file on your server. Files larger than this size, will fail on import.

Limits on resizing large images

Importing large images involves resizing them into the screen resolution and thumbnail images you see when you browse Pixaria.

The maximum size of any image that you can import into Pixaria after it's been uploaded is dependent on two factors:

1) The dimensions of the image in pixels - determines how much memory will be used to resize it.
2) The amount of memory Pixaria (PHP) can use at one time.

The amount of memory used to resize an image depends on the number of pixels in the image and the larger image dimensions the more memory will be needed.

Modifying settings to allow larger image uploads

To ensure that you and your users can work effectively with very large images, you may need to increase the limits on various PHP settings by editing the PHP configuration file php.ini on your server.

Note: Modifying the settings in php.ini may cause your site to cease functioning correctly if you make a mistake. Always take a back-up first or consult your hosting company for advice

If you don't have access to php.ini, some of these settings can also be modified by using a .htaccess file. For help with this, please consult your favourite search engine.

PHP settings for file uploads


;;;;;;;;;;;;;;;;
; File Uploads ;
;;;;;;;;;;;;;;;;

; Whether to allow HTTP file uploads.
file_uploads = On

; Temporary directory for HTTP uploaded files (will use system default if not
; specified).

upload_tmp_dir = /Applications/MAMP/tmp/php

; Maximum allowed size for uploaded files.
upload_max_filesize = 32M

Upload limit:

This is how much data any web page can send to PHP in one go. When you submit a form to your website, the data in the form is encoded before it is sent to the server and any files you attach are included in this. If you have a form with a large image attached, the image will only be accepted by PHP if the total size of all the form data including the attached image is less than the upload limit in PHP's settings. The default for this value is 2 MB.

PHP memory and execution time settings


;;;;;;;;;;;;;;;;;;;
; Resource Limits ;
;;;;;;;;;;;;;;;;;;;

max_execution_time = 30     ; Maximum execution time of script, in seconds
max_input_time = 60    ; Maximum time script may spend parsing request data
memory_limit = 8M      ; Maximum amount of memory a script may consume (8MB)

Memory Limit:

This is how much memory a single PHP script can use at one time. Resizing images requires a lot of physical memory on your web server and larger images need more than smaller ones. The default setting for this in PHP is 8 MB and setting this to a much higher value is recommended if your server supports it.

Maximum execution time:

This is how long a PHP script has to do everything it needs to. Any script which hasn't finished running its instructions before the end of this time will be aborted irrespective of whether it has finished.

Maximum input time:

This is how long a script can spend processing the data that is sent to it. Any data not processed before this time elapses will be ignored.

PHP form data input settings


; Maximum size of POST data that PHP will accept.
post_max_size = 32M

Post max size:

This is the maximum amount of data that can be sent to a PHP script by means of the HTTP 'post' method for sending form data. The 'upload limit' cannot be set to a value higher than this as file uploads are a type of post data.

Troubleshooting modifying settings

  1. If you don't have access to php.ini on your server, speak to your hosting company about changing these settings.
  2. If, after making changes to php.ini, you still have problems importing large images, contact your hosting company, they may have placed their own limits on image uploading and importing.

Go back to contents

Created: Monday, November 5, 2007
Last edited: Monday, November 5, 2007


image Pixaria Gallery Divestock