Images are now refreshed correctly after resizing/rotating when using a private S3 album. Corrected some more icons to Font Awesome v5. #147 #141

This commit is contained in:
Andy Heathershaw 2020-04-19 15:46:35 +01:00
parent b8b21cc06b
commit 09b4bc60dd
8 changed files with 22 additions and 18 deletions

View File

@ -140,7 +140,7 @@ class AmazonS3Source extends AlbumSourceBase implements IAlbumSource, IAnalysisQ
'Key' => $this->getPathToPhoto($photo, $thumbnail)
]);
return $client->createPresignedRequest($cmd, '+5 minutes')->getUri();
return (string)$client->createPresignedRequest($cmd, '+5 minutes')->getUri();
}
return $client->getObjectUrl($this->configuration->container_name, $this->getPathToPhoto($photo, $thumbnail));

View File

@ -162,7 +162,7 @@ class PhotoController extends Controller
$request->session()->flash('success', trans('admin.delete_photo_successful_message', ['name' => $photo->name]));
}
public function flip($photoId, $horizontal, $vertical)
public function flip(Request $request, $photoId, $horizontal, $vertical)
{
$this->authorizeAccessToAdminPanel();
@ -176,6 +176,8 @@ class PhotoController extends Controller
// Log an activity record for the user's feed
$this->createActivityRecord($photo, 'photo.edited');
return $photo->thumbnailUrl($request->get('t', 'admin-preview'));
}
public function move(Request $request, $photoId)
@ -241,13 +243,13 @@ class PhotoController extends Controller
return response()->json($result);
}
public function regenerateThumbnails($photoId)
public function regenerateThumbnails(Request $request, $photoId)
{
$this->authorizeAccessToAdminPanel();
$photo = $this->loadPhoto($photoId, 'change-metadata');
$result = ['is_successful' => false, 'message' => ''];
$result = ['is_successful' => false, 'message' => '', 'thumbnail_url' => ''];
try
{
@ -255,6 +257,7 @@ class PhotoController extends Controller
$photoService->regenerateThumbnails();
$result['is_successful'] = true;
$result['thumbnail_url'] = $photo->thumbnailUrl($request->get('t', 'admin-preview'));
}
catch (\Exception $ex)
{

View File

@ -280,10 +280,11 @@ function EditPhotosViewModel(album_id, language, urls) {
}
$('.loading', parent).show();
$.post(url, function () {
$.post(url, function (response) {
var image = $('img.photo-thumbnail', parent);
var originalUrl = image.data('original-src');
image.attr('src', originalUrl + "&_=" + new Date().getTime());
// response from server is the URL to the modified image
image.attr('src', response);
$('.loading', parent).hide();
});
@ -363,10 +364,10 @@ function EditPhotosViewModel(album_id, language, urls) {
url = url.replace(/\/0$/, '/' + this.photoIDs[0]);
$('.loading', parent).show();
$.post(url, function () {
$.post(url, function (response) {
var image = $('img.photo-thumbnail', parent);
var originalUrl = image.data('original-src');
image.attr('src', originalUrl + "&_=" + new Date().getTime());
image.attr('src', response.thumbnail_url);
$('.loading', parent).hide();
});

View File

@ -1,5 +1,5 @@
<nav class="navbar bg-primary navbar-dark">
<a class="navbar-brand" href="{{ route('install.check') }}" style="color: #fff;"><i class="fa fa-fw fa-photo"></i> @lang('installer.app_name')</a>
<a class="navbar-brand" href="{{ route('install.check') }}" style="color: #fff;"><i class="fa fa-fw fa-image"></i> @lang('installer.app_name')</a>
<div class="collapse navbar-collapse" id="navbar-content">
<ul class="navbar-nav mr-auto">
</ul>

View File

@ -21,7 +21,7 @@
</div>
<div class="card-footer">
<small class="text-muted">
<i class="fa fa-fw fa-photo"></i> {{ number_format($album->photos_count) }} {{ trans_choice('gallery.photos', $album->photos_count) }}
<i class="fa fa-fw fa-images"></i> {{ number_format($album->photos_count) }} {{ trans_choice('gallery.photos', $album->photos_count) }}
@if ($album->children_count > 0)
<i class="fa fa-fw fa-book ml-2"></i> {{ number_format($album->children_count) }} {{ trans_choice('gallery.child_albums', $album->children_count) }}

View File

@ -51,7 +51,7 @@
<table class="table table-striped stats-table mb-0">
<tbody>
<tr>
<td class="icon-col"><i class="fa fa-photo"></i></td>
<td class="icon-col"><i class="fa fa-images"></i></td>
<td class="stat-col">{{ number_format($photo_count, 0) }}</td>
<td class="text-col">{{ trans_choice('gallery.statistics.numbers.photos', $photo_count) }}</td>
</tr>

View File

@ -16,9 +16,9 @@
<div class="col-sm-8 col-md-9 col-xl-10">
@if ($can_follow)
@if ($is_following)
<a class="pull-right btn btn-lg btn-outline-primary" href="#" v-on:click="unFollowUser"><i class="fa fa-check fa-fw"></i> @lang('gallery.user_profile.following_button')</a>
<a class="float-right btn btn-lg btn-outline-primary" href="#" v-on:click="unFollowUser"><i class="fa fa-check fa-fw"></i> @lang('gallery.user_profile.following_button')</a>
@else
<a class="pull-right btn btn-lg btn-primary" href="#" v-on:click="followUser">@lang('gallery.user_profile.follow_button')</a>
<a class="float-right btn btn-lg btn-primary" href="#" v-on:click="followUser">@lang('gallery.user_profile.follow_button')</a>
@endif
@endif
<h1>{{ $user->name }}</h1>
@ -35,7 +35,7 @@
<a class="nav-link" href="{{ url()->current() }}" v-bind:class="{ active: isProfile }" v-on:click="switchToProfile"><i class="fa fa-fw fa-info-circle"></i> @lang('gallery.user_profile.profile_tab')</a>
</li>
<li class="nav-item">
<a class="nav-link" href="{{ url()->current() }}" v-bind:class="{ active: isFeed }" v-on:click="switchToFeed"><i class="fa fa-fw fa-clock-o"></i> @lang('gallery.user_profile.feed_tab')</a>
<a class="nav-link" href="{{ url()->current() }}" v-bind:class="{ active: isFeed }" v-on:click="switchToFeed"><i class="far fa-fw fa-clock"></i> @lang('gallery.user_profile.feed_tab')</a>
</li>
</ul>
</div>

View File

@ -7,7 +7,7 @@
<div class="card-footer">
<small class="text-muted">
@if (isset($show_text) && boolval($show_text))
<i class="fa fa-fw fa-photo"></i> {{ number_format($childAlbum->photos_count) }} {{ trans_choice('gallery.photos', $childAlbum->photos_count) }}
<i class="fa fa-fw fa-images"></i> {{ number_format($childAlbum->photos_count) }} {{ trans_choice('gallery.photos', $childAlbum->photos_count) }}
@if ($childAlbum->children_count > 0)
<i class="fa fa-fw fa-book ml-3"></i> {{ number_format($childAlbum->children_count) }} {{ trans_choice('gallery.child_albums', $childAlbum->children_count) }}
@ -15,7 +15,7 @@
{{-- We don't have enough room to show the album owner if show_text is true --}}
@else
<i class="fa fa-fw fa-photo" data-toggle="tooltip" data-placement="top" title="{{ number_format($childAlbum->photos_count) }} {{ trans_choice('gallery.photos', $childAlbum->photos_count) }}"></i>
<i class="fa fa-fw fa-images" data-toggle="tooltip" data-placement="top" title="{{ number_format($childAlbum->photos_count) }} {{ trans_choice('gallery.photos', $childAlbum->photos_count) }}"></i>
@if ($childAlbum->children_count > 0)
<i class="fa fa-fw fa-book ml-3" data-toggle="tooltip" data-placement="top" title="{{ number_format($childAlbum->children_count) }} {{ trans_choice('gallery.child_albums', $childAlbum->children_count) }}"></i>