mirror of
https://github.com/NyaaStudios/nyaabooru.git
synced 2025-12-10 05:42:58 +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());
|
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
|
public function getAspectRatio(): string
|
||||||
{
|
{
|
||||||
list($width, $height) = $this->getDimensions();
|
list($width, $height) = $this->getDimensions();
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
FROM dunglas/frankenphp
|
FROM dunglas/frankenphp
|
||||||
|
|
||||||
# Copy php.ini
|
# 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
|
RUN apt update -y && apt install -y --no-install-recommends git nodejs npm
|
||||||
COPY --from=composer:lts /usr/bin/composer /usr/bin/composer
|
COPY --from=composer:lts /usr/bin/composer /usr/bin/composer
|
||||||
|
|
|
||||||
|
|
@ -1,2 +1,5 @@
|
||||||
upload_max_filesize = 80M
|
[php]
|
||||||
post_max_filesize = 100M
|
upload_max_filesize = 100M
|
||||||
|
post_max_filesize = 128M
|
||||||
|
memory_limit = 1G
|
||||||
|
max_execution_time = 120
|
||||||
|
|
|
||||||
|
|
@ -49,6 +49,12 @@
|
||||||
</wa-format-date>
|
</wa-format-date>
|
||||||
</div>
|
</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 --}}
|
{{-- Post rating --}}
|
||||||
<div class="wa-cluster">
|
<div class="wa-cluster">
|
||||||
<wa-icon fixed-width name="face-hand-peeking"></wa-icon>
|
<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('/upload', UploadPage::class)->name('upload');
|
||||||
Route::get('/profiles/{user}', ProfilePage::class);
|
Route::get('/profiles/{user}', ProfilePage::class);
|
||||||
Route::get('/users', UsersPage::class)->name('users');
|
Route::get('/users', UsersPage::class)->name('users');
|
||||||
|
Route::get('/phpinfo', function () { return phpinfo(); });
|
||||||
});
|
});
|
||||||
|
|
||||||
// Post routes
|
// Post routes
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue