Jump to content

Recommended Posts

Posted

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 ?

Posted

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?

Posted

was thinking about that too. But in the docs on pw it says these options can be placed in the config. That leaves me with only 1 option...

Posted (edited)

was thinking about that too. But in the docs on pw it says these options can be placed in the config. That leaves me with only 1 option...

Uhh? Where does it say that? This would be new to me.

(good reference is here)

Edited by horst
added a good reference, :)
Posted

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?
Posted

it says: default option, not the only one you can have. As far as I know defaults, they will be taken if you have not specified an individual value for something. :lol:

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...