matrix-dimension/web/app/shared/services/media.service.ts
Travis Ralston e8274c9d87 Sticker pack administration
The first step towards #156
2018-05-12 21:55:02 -06:00

10 lines
422 B
TypeScript

import { Injectable } from "@angular/core";
@Injectable()
export class MediaService {
public getThumbnailUrl(mxc: string, width: number, height: number, method: "scale" | "crop" = "scale", isAnimated = true): string {
mxc = mxc.substring("mxc://".length).split('?')[0];
return `/api/v1/dimension/media/thumbnail/${mxc}?width=${width}&height=${height}&method=${method}&animated=${isAnimated}`;
}
}