Jump to content

image: center, left or right side


bwakad
 Share

Recommended Posts

Unfortunatly I did not find information of front-end image crop. But I did notice images can be manipulated for output using:

$thumb = $page->image->size(200,200); echo "<img src='{$thumb->url}'/>";

It looks like a center -cropping, -clipping, or -resize (not sure).

Since an uploaded image in landscape let me see the center part of the big image.

My question: is there a function in pw, to be used in forms, that let users choose to display center, left or right ?

Link to comment
Share on other sites

I think not a "special PW-function" but what's about radio buttons in your form with left - center - right and within form processing you crop the images west - center or east, according to the selected radio button?

Link to comment
Share on other sites

link from the PW docs "images" (there are 2 entries for images) ... http://processwire.com/api/fieldtypes/images/

You may modify the default $options that your system uses by adding a $config->imageSizerOptions in your /site/config.php file:

$config->imageSizerOptions = array( 'upscaling' => true, 'cropping' => true, 'quality' => 90, );
A little further it says: You may specify any of the following for the $options array:of which cropping as direction is part of it.If I can set these in config, then I am bound by 1. Correct?
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...