engine/lib/filestore.php 1 location
|
@@ 269-278 (lines=10) @@
|
266 |
|
$selection_width = $selection_height = min($selection_width, $selection_height); |
267 |
|
|
268 |
|
// set offsets for crop |
269 |
|
if ($crop) { |
270 |
|
$widthoffset = $x1; |
271 |
|
$heightoffset = $y1; |
272 |
|
$width = $x2 - $x1; |
273 |
|
$height = $width; |
274 |
|
} else { |
275 |
|
// place square region in the center |
276 |
|
$widthoffset = floor(($width - $selection_width) / 2); |
277 |
|
$heightoffset = floor(($height - $selection_height) / 2); |
278 |
|
} |
279 |
|
} else { |
280 |
|
// non-square new image |
281 |
|
$new_width = $maxwidth; |
mod/tidypics/lib/resize.php 1 location
|
@@ 519-528 (lines=10) @@
|
516 |
|
$region_width = $region_height = min($region_width, $region_height); |
517 |
|
|
518 |
|
// set offsets for crop |
519 |
|
if ($crop) { |
520 |
|
$widthoffset = $x1; |
521 |
|
$heightoffset = $y1; |
522 |
|
$orig_width = $x2 - $x1; |
523 |
|
$orig_height = $orig_width; |
524 |
|
} else { |
525 |
|
// place square region in the center |
526 |
|
$widthoffset = floor(($orig_width - $region_width) / 2); |
527 |
|
$heightoffset = floor(($orig_height - $region_height) / 2); |
528 |
|
} |
529 |
|
} else { |
530 |
|
// non-square new image |
531 |
|
|