mirror of
https://github.com/NyaaStudios/nyaabooru.git
synced 2025-12-09 21:42:57 +00:00
Add image info, increase php limits
This commit is contained in:
parent
cb086c4708
commit
68d316cd86
5 changed files with 24 additions and 3 deletions
|
|
@ -78,6 +78,17 @@ class Post extends Model
|
|||
return getimagesize($this->getFullUrl());
|
||||
}
|
||||
|
||||
public function getDimensionsStr(): string
|
||||
{
|
||||
[$width, $height] = $this->getDimensions();
|
||||
return "$width x $height";
|
||||
}
|
||||
|
||||
public function getFileSize(): int
|
||||
{
|
||||
return Storage::size("posts/$this->id/full");
|
||||
}
|
||||
|
||||
public function getAspectRatio(): string
|
||||
{
|
||||
list($width, $height) = $this->getDimensions();
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
FROM dunglas/frankenphp
|
||||
|
||||
# Copy php.ini
|
||||
COPY ./deploy/php.ini $PHP_INI_DIR/php.ini
|
||||
COPY ./deploy/php.ini $PHP_INI_DIR/php-app-config.ini
|
||||
|
||||
RUN apt update -y && apt install -y --no-install-recommends git nodejs npm
|
||||
COPY --from=composer:lts /usr/bin/composer /usr/bin/composer
|
||||
|
|
|
|||
|
|
@ -1,2 +1,5 @@
|
|||
upload_max_filesize = 80M
|
||||
post_max_filesize = 100M
|
||||
[php]
|
||||
upload_max_filesize = 100M
|
||||
post_max_filesize = 128M
|
||||
memory_limit = 1G
|
||||
max_execution_time = 120
|
||||
|
|
|
|||
|
|
@ -49,6 +49,12 @@
|
|||
</wa-format-date>
|
||||
</div>
|
||||
|
||||
{{-- Post dimensions --}}
|
||||
<div class="wa-cluster">
|
||||
<wa-icon fixed-width name="image"></wa-icon>
|
||||
<span>{{ $post->getDimensionsStr() }}, <wa-format-bytes value="{{ $post->getFileSize() }}"></wa-format-bytes> {{ $post->extension }}</span>
|
||||
</div>
|
||||
|
||||
{{-- Post rating --}}
|
||||
<div class="wa-cluster">
|
||||
<wa-icon fixed-width name="face-hand-peeking"></wa-icon>
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ Route::middleware('auth')->group(function () {
|
|||
Route::get('/upload', UploadPage::class)->name('upload');
|
||||
Route::get('/profiles/{user}', ProfilePage::class);
|
||||
Route::get('/users', UsersPage::class)->name('users');
|
||||
Route::get('/phpinfo', function () { return phpinfo(); });
|
||||
});
|
||||
|
||||
// Post routes
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue