summaryrefslogtreecommitdiff
path: root/app/Report/ReportParserGenerate.php
diff options
context:
space:
mode:
authorGreg Roach <fisharebest@webtrees.net>2018-05-25 12:09:08 +0100
committerGreg Roach <fisharebest@webtrees.net>2018-05-25 12:09:08 +0100
commit86a63f517ec206f19194ec99c5a279ba93f98c00 (patch)
tree2c012358a29ba54cbece3212e61744aa10ca6023 /app/Report/ReportParserGenerate.php
parent5225fdfc946018075eec2860e0b84c418dea4a02 (diff)
downloadwebtrees-86a63f517ec206f19194ec99c5a279ba93f98c00.tar.gz
webtrees-86a63f517ec206f19194ec99c5a279ba93f98c00.tar.bz2
webtrees-86a63f517ec206f19194ec99c5a279ba93f98c00.zip
Remove old code
Diffstat (limited to 'app/Report/ReportParserGenerate.php')
-rw-r--r--app/Report/ReportParserGenerate.php31
1 files changed, 15 insertions, 16 deletions
diff --git a/app/Report/ReportParserGenerate.php b/app/Report/ReportParserGenerate.php
index 7b6c580501..ba74ed910e 100644
--- a/app/Report/ReportParserGenerate.php
+++ b/app/Report/ReportParserGenerate.php
@@ -1606,22 +1606,21 @@ class ReportParserGenerate extends ReportParserBase {
$person = Individual::getInstance($id, $this->tree);
$media_file = $person->findHighlightedMediaFile();
- if ($media_file) {
- $attributes = $media_file->getImageAttributes();
- if ($media_file->fileExists()) {
- if ($width > 0 && $height == 0) {
- $perc = $width / $attributes[0];
- $height = round($attributes[1] * $perc);
- } elseif ($height > 0 && $width == 0) {
- $perc = $height / $attributes[1];
- $width = round($attributes[0] * $perc);
- } else {
- $width = $attributes[0];
- $height = $attributes[1];
- }
- $image = $this->report_root->createImageFromObject($media_file, $left, $top, $width, $height, $align, $ln);
- $this->wt_report->addElement($image);
+
+ if ($media_file !== null && $media_file->fileExists()) {
+ $attributes = getimagesize($media_file->getServerFilename()) ?: [0, 0];
+ if ($width > 0 && $height == 0) {
+ $perc = $width / $attributes[0];
+ $height = round($attributes[1] * $perc);
+ } elseif ($height > 0 && $width == 0) {
+ $perc = $height / $attributes[1];
+ $width = round($attributes[0] * $perc);
+ } else {
+ $width = $attributes[0];
+ $height = $attributes[1];
}
+ $image = $this->report_root->createImageFromObject($media_file, $left, $top, $width, $height, $align, $ln);
+ $this->wt_report->addElement($image);
}
}
@@ -1687,7 +1686,7 @@ class ReportParserGenerate extends ReportParserBase {
$media_file = $mediaobject->firstImageFile();
if ($media_file !== null && $media_file->fileExists()) {
- $attributes = $media_file->getImageAttributes();
+ $attributes = getimagesize($media_file->getServerFilename()) ?: [0, 0];
if ($width > 0 && $height == 0) {
$perc = $width / $attributes[0];
$height = round($attributes[1] * $perc);