Image sizes

When user upload picture/image on listing, Osclass generate 4 types of images:

  • Thumbnail – Used mostly on home/search page or as thumbnails on item page. Standard dimension is 240×200 px.
  • Preview – Used usually on listing page in image gallery, or if theme needs that, on search page when larger image (than thumbnail) is needed.
  • Normal – Used on item page as large showcase image. Standard dimension is 640×480 px.
  • Original – Is copy of original image. This option should be considered, as will increase file size significantly.

Dimension of images generated by Osclass can be set in “Settings > Media” section of backoffice.

Media sizes classifieds
Osclass image sizes

Image format and ratio

Osclass provides powerful options to customize format, ratio and content of images in order to match your classifieds design / theme design.

Image settings classifieds
Image advanced settings

Force JPEG (force JPEG extension)

This option will convert all images in JPG/JPEG format. This means, when customer tries to upload PNG image with transparent background, Osclass will convert this image into PNG with white background.

Crop image (best image crop)

Automatically pick/crop most suitable content from uploaded image. Osclass will try to catch as much from image as possible, but primary function of this option is to not have any white space on images and is most suitable, if image aspect ratio of uploaded images is pretty much same.

Force aspect (force image aspect)

Osclass will not add any white space to generated images, instead will keep generated images in aspect ratio of uploaded image. This means, that size of thumbnail, preview and normal images will not perfectly match to what you set, only 1 dimension will usually match.

Warning: Test well before using this option in production. Using force image aspect usually shuffle listing gallery as height of boxes will not be different. This is expected behavior in most of themes.

Example: user upload image of size 2000×1000 px (aspect ratio 2:1) and you have thumbnail size 240x200px. Osclass will generate thumbnail of size 240×120 px, keeping aspect ratio 2:1 and one of thumbnail dimensions (it could be also 400×200 px, but in that case width would exceed defined thumbnail width).

Maximum size

Maximum size of uploaded image (per image) in kilobytes. You should keep this value between 4000 – 16000KB. Note that at the end, Osclass will generate images of sizes you have defined, but it will cost more resources to generate those images from larger images.

This setting may have negative impact on file size, if you selected “Keep original image” option, as original resources will be stored in your file system.

Warning: Before increasing maximum image size, it should be well tested if you have enough memory on your hosting to do that (maximum allowed memory size).

ImageMagick (use ImageMagick library instead of GD library)

This option should be enabled always it is available, as ImageMagick library is much more efficient comparing to GD library. To explain better, consider you have set in PHP maximum allowed memory size to 256MB and customer uploads image of size 20MB, it may not be possible to process this image using GD library, as it will consume much more memory.

Having ImageMagick enabled, using same memory Osclass will be able to manage much larger images (2-3x larger).

Besides better memory & resources handling, there is no difference between ImageMagicsk & GD library at all, at least no difference those standard user would notice.

Notice: Warning that ImageMagick library is not loaded in your hosting is not problem, but you should always discuss with your hosting provider possibility to have this extension/library installed on your server.

Canvas background

Configure background color of canvas when generating different image sizes. This option has no effect when force image aspect or best crop options are enabled.

On most Osclass installations, this setting should be set to “white”, the “black” should be used in case it is much better for your theme design.

Watermark

This feature helps to protect your content (media content) of being copied on other classifieds by adding watermark text or image into every generated image size.

Watermark image classifieds
Watermark option in Osclass

Osclass support text watermarks or image watermarks.

Warning: original image size is not affected by watermark, means if you use original images on your site together with watermark option, you should consider this.

Regenerate images

Very important feature when image sizes or different image configuration parameters are changed.

When you regenerate images, Osclass will pick every single image and will regenerate it. This means if you changed i.e. size of thumbnails or image aspect ratio option, in order to take effect on existing listings/images, you must regenerate them.

Regenerate images in classifieds
Regenerate images

Regeneration is resource consuming operation, you should set maximum allowed memory size and maximum allowed execution time to maximum values on your hosting before regeneration process.

Warning: If you are not sure what image size and preferences you will use, you should enable “keep original images” option, as regeneration process will use these images and regeneration process will not lower quality of images. When original image version is not available, Osclass will use normal size of image – this will cause quality loss of regenerated images.

Tip: Latest versions of Osclass will stop execution when it is close to reach maximum execution time. When stopped, you can continue with process from point where it stopped. This procedure allows you to regenerate thousands of images, that would not be possible on Osclass 3.x.

Tip: Make sure to save your settings before pressing regenerate button.