Understanding Images
Next to E-mail, images are one of the most misunderstood aspects that impacts users of 68C. So what I would like to do is convey some basic info about images to help you better understand how 68C deals with them and why there are limitations on their size and why its important to have your administration settings for your site set properly.
Image Size
When it comes to images the word “size” can have many different meanings.
File Size
Images, like everything else computer related, are stored in containers called files. These files have a “size” which indicates how much space they take up on a computers hard disk.
Memory Size
What most people dont realize however is that most files used on the internet today are compressed. In other words special standards and algorithms are used to try and retain the data within the file but increase the space the file uses on a computers hard disk.
In order for the data within the file to be accessed however a compressed file needs to be uncompressed. This is done in a computers memory. A file that takes up 1 megabyte on the hard disk may actually take up 20 megabytes in memory depending on its contents and what type of compression is used.
Physical pixel dimension size
Images are made up of pixels which are tiny segments of information which contain color data. These pixels are arranged in a manner that is typically grid like and expressed in width x height.
68 Classifieds and images
68Clasifieds uses a high quality image upload class for handling the resizing of images. When you as a site admin or an ad poster places an ad and uploads an image many things need to take place.
1) the web server works together with the back end scripts and the clients browser to send the image to the web server where it is temporarily stored in its original format. There are certain PHP settings that are out of the control of most users on shared hosting plans which limit the size of the file that can be sent to the server. Additionally there are time limits placed on how long a script can run. If a user has a very slow connection to the internet and is uploading a very large file this execution time limit may be reached and the upload can fail.
It may also happen that your host has a very small temporary space allocated to you and if you and the other server users all are uploading images this temp spae may fill up and in turn the upload may fail.
2) Once the file is on the server in its temporary location 68C uncompresses the images and creates a small duplicate of it for a thumbnail using the settings you provided in admin. It also creates another image to use for the new full size image for the site based on admin settings as well. When done the original image is deleted from the temporary space.
When a file is uncompressed it resides in memory and the amount of memory your scripts are allowed to use is set by the php configuration file. This is totally outside the scope of 68C and is set by your web host. If your admin settings allow your users to upload images that are larger than your server can handle the script will fail. Once again this is NOT a problem with 68C but a limitation you host has imposed.
68 Classifieds Admin settings
68Classifieds allows you to set the image sizes for your thumbnails and your large images (those that get displayed in ads).
In addition you can also specify a max file size for an image as well as max height and width of an uploaded image.
As the pixel dimensions for an image increase the data contained in the file increase exponentially. Also depending on the quality setting for an image when it is saved, the same exact image saved at 2 different quality settings will have very different file sizes and also occupy different amounts of memory when uncompressed.
Most image editing software will show you the size (in kilobytes or megabytes) that an image is using in memory when it is opened. You can simply create empty images of varying pixel dimensions to get a feel for what pixel size images use in terms of system memory.
To view your servers current memory limit you can create a new file, call it what ever you would like as long as it end in .php and place it somewhere on your site. In the file have the following code……
<?php phpinfo(); ?>
The point a browser to it and look for a line called “memory_limit” and that will tell you how much memory your scripts have to work with.
If you open a bunch of files in an image editing application and see that are consuming 20mg etc and your memory_limit on your site is 16mg then trying to upload one of those images will likely fail.
What you are going to have to do is find out your hosts memory limit and then experiment with images that have different dimensions and see how large they are in memory and when saved to disk and use these numbers for your admin settings.
Then lastly, take a minute to alter your sites templates or FAQ to let people know what you file size and dimensional limitations are to save them the hassle of trying to upload images that are too large.
Most modern cameras create images that are much larger than can be processed by most shared hosting plans. Once again this is a limitation with your host and not the 68C software, 68C will handle the images just fine if it is allowed to use enough memory to process the image.
This was written by lhotch at Techconnx.net. Larry is a third party developer and has several modules for 68 Classifieds which can be found at ClassifiedMods.com.









