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:
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "ng2-alfresco-viewer",
|
"name": "ng2-alfresco-viewer",
|
||||||
"description": "Alfresco documents viewer",
|
"description": "Alfresco documents viewer",
|
||||||
"version": "0.1.14",
|
"version": "0.1.15",
|
||||||
"author": "Eugenio Romano",
|
"author": "Eugenio Romano",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"typings": "typings install",
|
"typings": "typings install",
|
||||||
|
@@ -105,19 +105,30 @@ export class ViewerComponent {
|
|||||||
return fileName.split('.').pop().toLowerCase();
|
return fileName.split('.').pop().toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* check if the current file is a suppoerted image extension
|
|
||||||
*/
|
|
||||||
private isImage() {
|
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' ||
|
return this.extension === 'png' || this.extension === 'jpg' ||
|
||||||
this.extension === 'jpeg' || this.extension === 'gif' || this.extension === 'bmp';
|
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
|
* check if the current file is a suppoerted pdf extension
|
||||||
*/
|
*/
|
||||||
private isPdf() {
|
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