forked from leftypol/leftypol
GdThumbGenerator.php: update
This commit is contained in:
parent
b4c2c7ab56
commit
92a3bb7610
1 changed files with 15 additions and 14 deletions
|
@ -103,13 +103,14 @@ class GdThumbGenerator implements ThumbGenerator {
|
|||
if (!link_or_copy($source_file_path, $out_path)) {
|
||||
throw new \RuntimeException("Could not link or copy '$source_file_path' to '$out_path'");
|
||||
}
|
||||
$res = new ThumbGenerationResult();
|
||||
$res->thumb_file_path = $out_path;
|
||||
$res->thumb_mime = $source_file_mime;
|
||||
$res->is_thumb_file_temporary = false;
|
||||
$res->width = $width;
|
||||
$res->height = $height;
|
||||
return $res;
|
||||
|
||||
return new ThumbGenerationResult(
|
||||
$out_path,
|
||||
$source_file_mime,
|
||||
false,
|
||||
$width,
|
||||
$height
|
||||
);
|
||||
} else {
|
||||
$out_path = $preferred_out_file_path . '.' . self::MIME_TO_EXT[$preferred_out_mime];
|
||||
|
||||
|
@ -120,13 +121,13 @@ class GdThumbGenerator implements ThumbGenerator {
|
|||
throw new \RuntimeException("Could not create thumbnail file at '$out_path'");
|
||||
}
|
||||
|
||||
$res = new ThumbGenerationResult();
|
||||
$res->thumb_file_path = $out_path;
|
||||
$res->thumb_mime = $preferred_out_mime;
|
||||
$res->is_thumb_file_temporary = false;
|
||||
$res->width = $max_width;
|
||||
$res->height = $max_height;
|
||||
return $res;
|
||||
return new ThumbGenerationResult(
|
||||
$out_path,
|
||||
$preferred_out_mime,
|
||||
false,
|
||||
$max_width,
|
||||
$max_height
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue