Jump to content

Different settings of the same thumbnail size not possible?


Recommended Posts

I discovered that if I create two thumbnails with the same size but different additional settings 

only one file (the first setting) is created because the settings are not reflected in the filename.


$image->size(200, 100, array('cropping' => false));
$image->size(200, 100, array('cropping' => true));

In this case the second image won't be cropped.

I would expect that two different thumbnail will be generated.

Link to comment
Share on other sites

There really isn't much point in a cropping=false value to this particular call, because that would force a stretched image... something that there is almost never a practical use for. You'd be better off just specifying only a width or height, to ensure you don't get a stretched image. But you are correct in that for the most part, ProcessWire only maintains one thumbnail per dimension. There is one exception: if you specify details about where it should crop, it should keep separate copies, i.e.

$img1 = $image->size(200, 100, array("cropping" => "center")); 
$img2 = $image->size(200, 100, array("cropping" => "northwest")); 
  • Like 1
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

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Create New...