Jump to content

Resizing images via hooks: two questions


DrQuincy
 Share

Recommended Posts

Hi,

I have done a few sites with PW now and love it — thanks so much for it.

Up to now, I've done image resizing in the templates but this can make the font-end very slow when images are generated (but is fine for subsequent pages loads).

To speed it up I have:

  1. Enabled client-side browser-resizing so huge images are scaled down before upload
  2. Added an InputfieldFile::fileAdded hook so images are re-sized in the admin so the front-end should never have to resize

This seems to work great, I just wanted a second opinion to confirm that:

  1. Variations created this way will be deleted when the page is deleted, i.e. I do not need a fileDeleted hook
  2. The front-end will never re-generate the images (presuming the admin created them) when I call $image->size($imgWidth, $imgHeight)

I believe the above two assumptions are correct; I just wanted it confirming. ?

Thanks!

Link to comment
Share on other sites

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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...