mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-31 17:38:48 +00:00
Fix images being shown as unsupported formats in viewer
This commit is contained in:
@@ -105,19 +105,30 @@ export class ViewerComponent {
|
||||
return fileName.split('.').pop().toLowerCase();
|
||||
}
|
||||
|
||||
/**
|
||||
* check if the current file is a suppoerted image extension
|
||||
*/
|
||||
private isImage() {
|
||||
return this.isImageExtension() || this.isImageMimeType();
|
||||
}
|
||||
|
||||
/**
|
||||
* check if the current file is a supported image extension
|
||||
*/
|
||||
private isImageExtension() {
|
||||
return this.extension === 'png' || this.extension === 'jpg' ||
|
||||
this.extension === 'jpeg' || this.extension === 'gif' || this.extension === 'bmp';
|
||||
}
|
||||
|
||||
/**
|
||||
* check if the current file has an image-based mimetype
|
||||
*/
|
||||
private isImageMimeType() {
|
||||
return this.mimeType !== null && this.mimeType.indexOf('image/') === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* check if the current file is a suppoerted pdf extension
|
||||
*/
|
||||
private isPdf() {
|
||||
return this.extension === 'pdf' || this.mimeType == 'application/pdf';
|
||||
return this.extension === 'pdf' || this.mimeType === 'application/pdf';
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user