XAO::ImageCache is a Perl module that will cache images stored in XAO::FS database.
# Making new instance of Image Cache object
my $image_Cache = XAO::ImageCache->new(
list => $odb->fetch("/Products"),
cache_path => "/var/httpd/shop/product/images/",
cache_url => "/products/images/",
source_url_key => "source_img",
) || die "Can't make Image cache!";
# Init new empty Cache
$image_cache->init() || die "Can't init new cache!";
# Start images checking and downloading to cache
When we store images links on own database we have no real images on own site. Some time it may be a problem cause images may have no right dimension or may be deleted from source site.
XAO::ImageCache made for cache locally images his URL stored in XAO Founsation Server. Also, images may be resized automaticaly.
This module provide easy methodes to scan XAO Foundation Server data lists, extract images source URLs from data objects, downloading images to local cache, resize local copy of image to feet in to given dimensions and store new local URL of image back to data object.