mirror of
https://github.com/xuthus83/pigallery2.git
synced 2024-11-03 21:04:03 +08:00
improving bestfit photo
This commit is contained in:
parent
9e7e66a4aa
commit
5bb17294ec
@ -23,10 +23,12 @@ export class PhotoConverterMWs {
|
||||
return next();
|
||||
}
|
||||
|
||||
if (Config.Server.Media.Photo.Converting.onTheFly) {
|
||||
if (Config.Server.Media.Photo.Converting.onTheFly === true) {
|
||||
req.resultPipe = await PhotoProcessing.convertPhoto(fullMediaPath,
|
||||
Config.Server.Media.Photo.Converting.resolution);
|
||||
return next();
|
||||
}
|
||||
|
||||
// not converted and won't be now
|
||||
return res.redirect(req.originalUrl.slice(0, -1 * '\\bestFit'.length));
|
||||
}
|
||||
|
@ -185,7 +185,7 @@ export class ImageRendererFactory {
|
||||
const sharp = require('sharp');
|
||||
sharp.cache(false);
|
||||
return async (input: RendererInput): Promise<void> => {
|
||||
Logger.silly('[SharpThRenderer] rendering thumbnail:' + input.mediaPath);
|
||||
Logger.silly('[SharpRenderer] rendering photo:' + input.mediaPath + ', size:' + input.size);
|
||||
const image: Sharp = sharp(input.mediaPath, {failOnError: false});
|
||||
const metadata: Metadata = await image.metadata();
|
||||
|
||||
|
@ -40,10 +40,7 @@ export class MediaIcon {
|
||||
}
|
||||
|
||||
getBestFitMediaPath() {
|
||||
return Utils.concatUrls(Config.Client.urlBase,
|
||||
'/api/gallery/content/',
|
||||
this.media.directory.path, this.media.directory.name, this.media.name,
|
||||
'/bestFit');
|
||||
return Utils.concatUrls(this.getMediaPath(), '/bestFit');
|
||||
}
|
||||
|
||||
|
||||
|
@ -29,7 +29,7 @@ export class GalleryLightboxMediaComponent implements OnChanges {
|
||||
thumbnailSrc: string = null;
|
||||
photo = {
|
||||
src: <string>null,
|
||||
isBestFit: false
|
||||
isBestFit: <boolean>null
|
||||
};
|
||||
public transcodeNeedVideos = SupportedFormats.TranscodeNeed.Videos;
|
||||
private mediaLoaded = false;
|
||||
|
Loading…
Reference in New Issue
Block a user