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)) {
|
if (!link_or_copy($source_file_path, $out_path)) {
|
||||||
throw new \RuntimeException("Could not link or copy '$source_file_path' to '$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;
|
return new ThumbGenerationResult(
|
||||||
$res->thumb_mime = $source_file_mime;
|
$out_path,
|
||||||
$res->is_thumb_file_temporary = false;
|
$source_file_mime,
|
||||||
$res->width = $width;
|
false,
|
||||||
$res->height = $height;
|
$width,
|
||||||
return $res;
|
$height
|
||||||
|
);
|
||||||
} else {
|
} else {
|
||||||
$out_path = $preferred_out_file_path . '.' . self::MIME_TO_EXT[$preferred_out_mime];
|
$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'");
|
throw new \RuntimeException("Could not create thumbnail file at '$out_path'");
|
||||||
}
|
}
|
||||||
|
|
||||||
$res = new ThumbGenerationResult();
|
return new ThumbGenerationResult(
|
||||||
$res->thumb_file_path = $out_path;
|
$out_path,
|
||||||
$res->thumb_mime = $preferred_out_mime;
|
$preferred_out_mime,
|
||||||
$res->is_thumb_file_temporary = false;
|
false,
|
||||||
$res->width = $max_width;
|
$max_width,
|
||||||
$res->height = $max_height;
|
$max_height
|
||||||
return $res;
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue