Jump to content

Recommended Posts

Posted

Hello!

I often have to change image sizes in templates using the ->width() or size functions and on a image heavy site this a cause timeout errors or massie lag before all the images are resized when changing to the new template.

I was wondering if there was a good way of creating these images without having to hit each page on the site for the template to be called and images updated? Basically to avoid the errors?

Thanks

Posted

The images are created as soon as the api is called, so you could just build a module, which created the thumb for each page. Could for example be a pageaction, which are currently mostly used for listerpro.

Posted

Hello,

in PW I really like possibility to dynamic resize images in template, but also maybe - one day - there can be and option for multiple thumbnails creation over upload process.

Also in some cases cron jobs (background server scheduled tasks) are solution.

regards,

Sasa

  • Like 1
Posted

Think the crop images module is probably the best option here as it creates the image straight away but slightly fustrating if you dont want to install any new modules etc. if you changes the image field to a crop field would it create the crop images for the site or only when you edit that page?

not sure how i would set up a cron job - might be time to try

Posted

should work with a little API snippet...to save all pages and create the thumbs on save...didn't mentioned this before since i've this module in my setup from the start building a site...

//not tested!!
$mypages = $pages->find(template=mytemplatewithimages);
foreach($mypages as $p) {
    $p->save();
}

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...