You are here

function imagecrop_scale_options in Image javascript crop 5

Add scale options

Parameters

unknown_type original width of image:

unknown_type width of give cropboxx:

Return value

possible width options

1 call to imagecrop_scale_options()
imageoffsets in ./imagecrop.module
Callback to return offsets, height & width

File

./imagecrop.module, line 371
Provides a javascript toolbox through an imagecache action.

Code

function imagecrop_scale_options($width, $cropboxwidth) {
  $options['original'] = 'Original (' . $width . 'px)';

  // experimental, we give the width always a bit more
  $cropboxwidth += 60;
  while ($width > $cropboxwidth) {
    $width -= 50;
    $options[$width] = $width . 'px';
  }
  return $options;
}