Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix cropping of OrganInformation images #1712

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions module/Decision/src/Service/Organ.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
use function array_filter;
use function array_merge;
use function count;
use function floatval;
use function getimagesize;
use function getrandmax;
use function in_array;
use function intval;
use function random_int;
use function round;
use function sys_get_temp_dir;
Expand Down Expand Up @@ -195,10 +195,10 @@ public function updateOrganInformation(
if ($data['cover']['size'] > 0) {
$coverPath = $this->makeOrganInformationImage(
$data['cover']['tmp_name'],
intval($data['coverCropX']),
intval($data['coverCropY']),
intval($data['coverCropWidth']),
intval($data['coverCropHeight']),
floatval($data['coverCropX']),
floatval($data['coverCropY']),
floatval($data['coverCropWidth']),
floatval($data['coverCropHeight']),
$config['cover_width'],
$config['cover_height'],
);
Expand All @@ -209,10 +209,10 @@ public function updateOrganInformation(
if ($data['thumbnail']['size'] > 0) {
$thumbnailPath = $this->makeOrganInformationImage(
$data['thumbnail']['tmp_name'],
intval($data['thumbnailCropX']),
intval($data['thumbnailCropY']),
intval($data['thumbnailCropWidth']),
intval($data['thumbnailCropHeight']),
floatval($data['thumbnailCropX']),
floatval($data['thumbnailCropY']),
floatval($data['thumbnailCropWidth']),
floatval($data['thumbnailCropHeight']),
$config['thumbnail_width'],
$config['thumbnail_height'],
);
Expand Down Expand Up @@ -240,10 +240,10 @@ public function updateOrganInformation(
* Create a thumbnail of the given file at the given location and scale.
*
* @param string $file The file to create the thumbnail of
* @param int $x The start x position in the image
* @param int $y The start y position in the image
* @param int $width The width of the area to crop
* @param int $height The height of the are to crop
* @param float $x The start x position in the image
* @param float $y The start y position in the image
* @param float $width The width of the area to crop
* @param float $height The height of the are to crop
* @param int $thumbWidth The width of the final thumbnail
* @param int $thumbHeight The height of the final thumbnail
*
Expand All @@ -253,10 +253,10 @@ public function updateOrganInformation(
*/
public function makeOrganInformationImage(
string $file,
int $x,
int $y,
int $width,
int $height,
float $x,
float $y,
float $width,
float $height,
int $thumbWidth,
int $thumbHeight,
): string {
Expand Down
Loading